Re: [PATCH] drivers/mtd: rawnand: nandsim: Fix stale NAND_ROW_ADDR_3 with overridesize

From: Miquel Raynal

Date: Thu Oct 01 2026 - 08:42:57 EST



>>> + if (chip->chip_shift - chip->page_shift > 16)
>>> + chip->options |= NAND_ROW_ADDR_3;
>>> + else
>>> + chip->options &= ~NAND_ROW_ADDR_3;
>>> }
>>>
>>> ret = ns_setup_wear_reporting(nsmtd);
>>
>>Instead of repeating the operation in nandsim, why not calling
>>nand_scan() after over writing the size? (inverting the two blocks)
>
> The override cannot be moved before nand_scan(): In nand_detect(),
> chip ->chipushift will be set to the actual flash size. In addition,
> In addition, expressed in erase blocks (new_size = nsmtd->erasesize << overridesize)
> and erasesize is what nand_scan_ident() decodes from the ID bytes, so
> the override has a hard data dependency on the scan.

Ok, fine then.