[PATCH 2/7] mtd: spi-nor: core: Report correct name in case of ID collisions

Tudor.Ambarus at microchip.com Tudor.Ambarus at microchip.com
Mon Jul 5 06:27:51 PDT 2021


On 7/5/21 4:24 PM, Tudor Ambarus - M18064 wrote:
> On 7/5/21 4:13 PM, Pratyush Yadav wrote:
>> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>>
>> On 02/07/21 05:41PM, Tudor Ambarus wrote:
>>> Provide a way to report the correct flash name in case of ID collisions.
>>> There will be a single flash_info entry when flash IDs collide, and the
>>> differentiation between the flash types will be made at runtime
>>> if possible.
>>
>> I am not sure if having one entry for all flashes with a collision is a
>> good idea. For example, say we have one flash which supports SFDP and
>> that's all we need for it. Another flash with the same ID does not
>> support SFDP so it needs the SPI_NOR_DUAL_READ, etc. flags. How would
>> you handle this case with the same entry? You would have to set all the
>> flags in the disambiguation function. And nor->info is declared as const
>> so you can't change the flags in there. Any code checking for
>> info->flags would not work properly for these type of flashes. Wouldn't
>> it be better to have multiple entries with the same ID and just pick the
>> one we need in the disambiguation function?
> 
> Your scenario is hit in patches 3/7 and 4/7. In case of ID collisions between
> a SFDP and a non-SFDP compliant flash, I propose to set SPI_NOR_PARSE_SFDP, as
> well as all the other required flash info flags that statically init the flash.
> The SFDP flash will init all its NOR flags at runtime, while the non-SFDP flash

s/runtime/based on SFDP data

> will issue a RDSFDP command that will fail, and then it will init all the NOR
> flags based on the flash info flags.
> 
>>
>> Anyway, if you do decide to go with this approach, comments below.
> 
> Right, thanks.
> 



More information about the linux-mtd mailing list