From: Dominique Martinet <dominique.martinet@atmark-techno.com>
To: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Richard Weinberger <richard@nod.at>,
Vignesh Raghavendra <vigneshr@ti.com>,
Daisuke Mizobuchi <mizo@atmark-techno.com>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
Steam Lin <stlin2@winbond.com>,
linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 02/13] mtd: spinand: winbond: Generalize the KV OOB layout
Date: Sat, 31 Oct 2026 05:27:33 +0900 [thread overview]
Message-ID: <auT9takcaT1TWj0W@atmark-techno.com> (raw)
In-Reply-To: <20261030-winbond-master-w25nxxlvw-v1-2-91f67407dc8b@bootlin.com>
Miquel Raynal wrote on Fri, Oct 30, 2026 at 06:45:26PM +0100:
> --- a/drivers/mtd/nand/spi/winbond.c
> +++ b/drivers/mtd/nand/spi/winbond.c
> @@ -318,16 +318,11 @@ static int w25n01kv_ooblayout_ecc(struct mtd_info *mtd, int section,
> return 0;
> }
>
> -static int w25n02kv_ooblayout_ecc(struct mtd_info *mtd, int section,
> - struct mtd_oob_region *region)
> +static int w25nxxkv_kw_ooblayout_ecc(struct mtd_info *mtd, int section,
> + struct mtd_oob_region *region)
> {
> - int num_sections = 4;
> - int offset = 64;
> -
> - if (mtd->oobsize == 256) {
> - num_sections = 8;
> - offset = 128;
> - }
> + unsigned int offset = mtd->oobsize / 2;
> + unsigned int num_sections = mtd->writesize / 512;
Ah, I couldn't use oobsize for num_sections because of W25N01KV but
using writesize makes sense as well as there's one section per 512 bytes
chunk, and this works for all devices.
Good cleanup!
Reviewed-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
--
Dominique
next prev parent reply other threads:[~2026-10-30 20:27 UTC|newest]
Thread overview: 15+ 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 20:27 ` Dominique Martinet [this message]
2026-10-30 17:45 ` [PATCH 03/13] mtd: spinand: winbond: Generalize the LW " Miquel Raynal
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
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=auT9takcaT1TWj0W@atmark-techno.com \
--to=dominique.martinet@atmark-techno.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=miquel.raynal@bootlin.com \
--cc=mizo@atmark-techno.com \
--cc=richard@nod.at \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®