All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Miquel Raynal" <miquel.raynal@bootlin.com>,
	"Richard Weinberger" <richard@nod.at>,
	"Vignesh Raghavendra" <vigneshr@ti.com>,
	"Daisuke Mizobuchi" <mizo@atmark-techno.com>,
	"Dominique Martinet" <dominique.martinet@atmark-techno.com>
Cc: "Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	"Steam Lin" <stlin2@winbond.com>,
	linux-mtd@lists.infradead.org
Subject: Re: [PATCH 02/13] mtd: spinand: winbond: Generalize the KV OOB layout
Date: Fri, 30 Oct 2026 17:51:45 +0000	[thread overview]
Message-ID: <sashiko-outbox-191361@kernel.org> (raw)
In-Reply-To: <20261030-winbond-master-w25nxxlvw-v1-2-91f67407dc8b@bootlin.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] mtd: spinand: winbond: accidental revert of W25N04LW OOB layout
--

commit c7bc36662c75a5deeedb5e5ecc44d6bc3947d7fd
Author: Miquel Raynal <miquel.raynal@bootlin.com>

mtd: spinand: winbond: Generalize the KV OOB layout

This commit generalizes and renames the W25N02KV OOB layout helpers and
structures to w25nxxkv_kw_ooblayout so it is clearer that all W25NxxKV and
W25NxxKW chips share the same OOB layout.

> diff --git a/drivers/mtd/nand/spi/winbond.c b/drivers/mtd/nand/spi/winbond.c
> index 49fa545a4113e..4ef30f1a4aa8e 100644
> --- a/drivers/mtd/nand/spi/winbond.c
> +++ b/drivers/mtd/nand/spi/winbond.c

[ ... ]

> @@ -827,7 +819,7 @@ static const struct spinand_info winbond_spinand_table[] = {
>  					      &write_cache_variants,
>  					      &update_cache_variants),
>  		     0,
> -		     SPINAND_ECCINFO(&w25n02kv_ooblayout, w25n02kv_ecc_get_status)),
> +		     SPINAND_ECCINFO(&w25nxxkv_kw_ooblayout, w25n02kv_ecc_get_status)),
>  	SPINAND_INFO("W25N04LW", /* 1.8V */
>  		     SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xb2, 0x23),
>  		     NAND_MEMORG(1, 4096, 256, 64, 2048, 40, 1, 1, 1),
> @@ -836,7 +828,7 @@ static const struct spinand_info winbond_spinand_table[] = {
>  					      &write_cache_variants,
>  					      &update_cache_variants),
>  		     0,
> -		     SPINAND_ECCINFO(&w25n08lw_ooblayout, w25n02kv_ecc_get_status)),
> +		     SPINAND_ECCINFO(&w25nxxkv_kw_ooblayout, w25n02kv_ecc_get_status)),

[Severity: High]
Does changing the W25N04LW entry in winbond_spinand_table from
w25n08lw_ooblayout to w25nxxkv_kw_ooblayout accidentally revert the
preceding commit 4c37f4cb3704 ("mtd: spinand: winbond: Fix an OOB layout
inconsistency with W25NxxLW chips")?

That commit specifically switched W25N04LW to w25n08lw_ooblayout so that
w25n08lw_ooblayout_free() exposes only the 12 ECC-protected User Data I
bytes at offset (16 * section) + 4 and w25n08lw_ooblayout_ecc() returns
-ERANGE:

drivers/mtd/nand/spi/winbond.c:w25n08lw_ooblayout_free() {
	if (section > 7)
		return -ERANGE;

	region->offset = (16 * section) + 4;
	region->length = 12;

	return 0;
}

With w25nxxkv_kw_ooblayout assigned here instead, probing a W25N04LW chip
via spinand_init() registers w25nxxkv_kw_ooblayout_free() and
w25nxxkv_kw_ooblayout_ecc(), exposing 14 free OOB bytes starting at offset
(16 * section) + 2 (including unprotected User Data II bytes) and reporting
inaccessible ECC parity regions instead of keeping w25n08lw_ooblayout.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261030-winbond-master-w25nxxlvw-v1-0-91f67407dc8b@bootlin.com?part=2

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  reply	other threads:[~2026-10-30 17:51 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-30 17:45 [PATCH 00/13] mtd: spinand winbond: Add support for W25NxxLV and W25NxxLW chips Miquel Raynal
2026-10-30 17:45 ` [PATCH 01/13] mtd: spinand: winbond: Fix an OOB layout inconsistency with " Miquel Raynal
2026-10-30 17:45 ` [PATCH 02/13] mtd: spinand: winbond: Generalize the KV OOB layout Miquel Raynal
2026-10-30 17:51   ` sashiko-bot [this message]
2026-10-30 20:27   ` Dominique Martinet
2026-10-30 17:45 ` [PATCH 03/13] mtd: spinand: winbond: Generalize the LW " Miquel Raynal
2026-10-30 17:51   ` sashiko-bot
2026-10-30 17:45 ` [PATCH 04/13] mtd: spinand: winbond: Rename the ->set_cont_read() helper Miquel Raynal
2026-10-30 17:45 ` [PATCH 05/13] mtd: spinand: winbond: Rename the ->ecc_get_status() helper Miquel Raynal
2026-10-30 17:45 ` [PATCH 06/13] mtd: spinand: winbond: Add 1S_1S_1S continuous read variant Miquel Raynal
2026-10-30 17:45 ` [PATCH 07/13] mtd: spinand: winbond: Add basic support for W25N02LV Miquel Raynal
2026-10-30 17:45 ` [PATCH 08/13] mtd: spinand: winbond: Add basic support for W25N04LV Miquel Raynal
2026-10-30 17:45 ` [PATCH 09/13] mtd: spinand: winbond: Add basic support for W25N02LW Miquel Raynal
2026-10-30 17:45 ` [PATCH 10/13] mtd: spinand: winbond: Add continuous read support for W25N02LV Miquel Raynal
2026-10-30 17:45 ` [PATCH 11/13] mtd: spinand: winbond: Add continuous read support for W25N04LV Miquel Raynal
2026-10-30 17:45 ` [PATCH 12/13] mtd: spinand: winbond: Add continuous read support for W25N02LW Miquel Raynal
2026-10-30 17:45 ` [PATCH 13/13] mtd: spinand: winbond: Add continuous read support for W25N04LW Miquel Raynal
2026-10-30 17:57   ` sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-191361@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dominique.martinet@atmark-techno.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=mizo@atmark-techno.com \
    --cc=richard@nod.at \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=stlin2@winbond.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.