Re: [PATCH v2] mtd: spi-nor: Check for zero erase size in spi_nor_find_best_erase_type()

From: Alexander Sverdlin
Date: Mon Dec 20 2021 - 07:35:05 EST


Hi!

On 20/12/2021 12:28, Tudor.Ambarus@xxxxxxxxxxxxx wrote:
>> I however run the above patch because of the reasons described in the commit message.
>> Nevertheless, the bug fixed now remains a bug no matter what triggers it.
> I'm not yet convinced that this is the best way to fix it. Should we update
> the erase mask to cover this case?

Well, let's wait until the maintainers form their opinion. I've listed the functions which
zero the size (spi_nor_parse_4bait() or spi_nor_init_non_uniform_erase_map()), there are
already functions which check for zero:
spi_nor_select_uniform_erase()
spi_nor_select_erase()

--
Best regards,
Alexander Sverdlin.