[PATCH v3 13/25] mtd: spi-nor: sst: Get rid of SST_WRITE flash_info flag
Michael Walle
michael at walle.cc
Fri Nov 12 13:28:42 PST 2021
Am 2021-11-09 13:31, schrieb Tudor.Ambarus at microchip.com:
> On 11/9/21 2:21 PM, Michael Walle wrote:
>> EXTERNAL EMAIL: Do not click links or open attachments unless you know
>> the content is safe
>>
>> Am 2021-10-29 19:26, schrieb Tudor Ambarus:
>>> The flash_info flags should be generic and not manufacturer specific.
>>> Get rid of the manufacturer specific flag and use the late_init()
>>> fixup
>>> hook instead.
>>> Please note that sst_write is now set at flash level and not
>>> globally,
>>> per manufacturer. Manufacturer hooks are generally a bad idea,
>>> because
>>> it affects settings for all the flashes and we might end up with
>>> fixups
>>> for "manufacturer settings".
>>>
>>> Signed-off-by: Tudor Ambarus <tudor.ambarus at microchip.com>
>>
>> Reviewed-by: Michael Walle <michael at walle.cc>
>>
>> I'm still not sure, if having a just one fixup function will scale
>> with
>> different flashes. What do you think about having an additional
>> (opaque
>> to the core) (bit)field for the manufacturer and flash fixups
>> functions?
>
> Sounds fine. I can reserve few bits to manufacturers and introduce a
> MANUF_FLAGS genmask for the flash_info flags. Each specific
> manufacturer
> flag will be visible just for that manufacturer. Please check patch
> 14/25,
> I can extend the idea from there.
>
>
>> In this case, you can reuse the same function - and then a
>> manufacturer
>> will make more sense (addressing Pratyush comment about a common
>> manufacturer fixup here).
>>
>> I.e. the SST_WRITE flag would go into these flags, set per flash
>> device
>> and the fixup can still remain in the manufacturer fixup.
>>
>
> Right. Let me know if a MANUF_FLAGS genmask is better than this patch.
Yes, I think so.
-michael
More information about the linux-mtd
mailing list