[PATCH v2 1/3] mtd: spinand: Remove write_enable_op() in markbad()

Miquel Raynal miquel.raynal at bootlin.com
Mon Dec 2 09:08:06 PST 2024


Hello,

On 22/11/2024 at 09:37:45 GMT, Tudor Ambarus <tudor.ambarus at linaro.org> wrote:

> On 11/21/24 2:08 AM, tkuw584924 at gmail.com wrote:
>> From: Takahiro Kuwano <Takahiro.Kuwano at infineon.com>
>> 
>> We don't have to call spinand_write_enable_op() in spinand_markbad() as
>> it is called in spinand_write_page().
>
> Indeed. The patch is a follow up for:
> Fixes: b645ad39d568 ("mtd: spinand: Do not erase the block before
> writing a bad block marker")

Correct.

Takahiro, would you mind updating the commit log to mention that commit,
please? It makes sense to have it mentioned. Otherwise the series looks
good, I'll apply it once you send a v3.

> That commit removed spinand_erase_op(), but failed to remove
> spinand_write_enable_op() with it.
>
> Reviewed-by: Tudor Ambarus <tudor.ambarus at linaro.org>
>
> Miquel, shall the spinand_write_enable_op() call be moved into
> spinand_erase_op()?

Thanks a lot for the review!

spinand_erase_op() is just about the "op", not about handling an "mtd"
erase. It is called from spinand_erase() which already does the
spinand_write_enable_op() and I believe it makes more sense to keep it
there, so when we browse the code we don't need to enter the low-level
functions and immediately identify what operations we send to the chip
without surprises.

Cheers,
Miquèl



More information about the linux-mtd mailing list