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

Miquel Raynal miquel.raynal at bootlin.com
Thu Oct 1 05:34:33 PDT 2026


>>> +		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.



More information about the linux-mtd mailing list