Re: [PATCH 1/2] mtd: spi-nor: Introduce erase_proto

From: Alexander Sverdlin
Date: Mon Jul 25 2022 - 10:54:26 EST


Hi Tudor!

On 18/07/2022 18:50, Tudor.Ambarus@xxxxxxxxxxxxx wrote:
>>> @@ -2727,6 +2727,9 @@ static void spi_nor_late_init_params(struct spi_nor *nor)
>>> */
>>> if (nor->flags & SNOR_F_HAS_LOCK && !nor->params->locking_ops)
>>> spi_nor_init_default_locking_ops(nor);
>>> +
>>> + if (!nor->erase_proto)
>>> + nor->erase_proto = nor->write_proto;
>> I get that you are trying to not break any existing flashes with this,
>> but I don't quite like it. We should keep the same initialization flow
>> with erase_proto as with write_proto, read_proto, etc. That is,
>> initialize it to SNOR_PROTO_1_1_1 in spi_nor_scan() and then let the
>> initialization procedure change it as needed.
>>
>> The problem with this is of course that it could break some flashes by
>> selecting the wrong erase. I would expect _most_ flashes to use
>> erase_proto as 1-1-1 but I of course haven't went and looked at every
>> single flash to point out the exceptions.
>>
>> I would like to hear from others if they think it is okay to do this.
>>
> Doesn't [1] solve Alexander's problem? Alexander, would you please test
> Patrice's patch and provide a Tested-by tag if everything is ok?

Yes, looks good, provided the Tested-by tag.

> Thanks,
> ta
>
> [1] https://patchwork.ozlabs.org/project/linux-mtd/patch/20220629133013.3382393-1-patrice.chotard@xxxxxxxxxxx/
>

--
Best regards,
Alexander Sverdlin.