From: sashiko-bot@kernel.org
To: "Paul Cercueil" <paul.cercueil@bootlin.com>,
"Pratyush Yadav" <pratyush@kernel.org>,
"Michael Walle" <mwalle@kernel.org>,
"Takahiro Kuwano" <takahiro.kuwano@infineon.com>,
"Miquel Raynal" <miquel.raynal@bootlin.com>,
"Richard Weinberger" <richard@nod.at>,
"Vignesh Raghavendra" <vigneshr@ti.com>
Cc: "Nuno Sá" <nuno.sa@analog.com>,
linux-mtd@lists.infradead.org,
"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>
Subject: Re: [PATCH] mtd: spi-nor: Ignore octal PP bits on < JESD216F
Date: Thu, 03 Dec 2026 11:42:38 +0000 [thread overview]
Message-ID: <sashiko-outbox-247679@kernel.org> (raw)
In-Reply-To: <20261203111545.55678-1-paul.cercueil@bootlin.com>
Thank you for your contribution! Sashiko AI review found 3 potential
issues to consider:
- [High] mtd: spi-nor: spi_nor_parse_4bait() clears PP_8_8_8_DTR on
pre-JESD216F
- [Medium] mtd: spi-nor: spi_nor_parse_4bait() checks bfpt_header->minor
for JESD216F
- [Low] mtd: spi-nor: missing Fixes trailer for 4BAIT octal PP parsing
commit
--
commit 74e692d12384eca7766679af6c7f7592d5e62317
Author: Paul Cercueil <paul.cercueil@bootlin.com>
> mtd: spi-nor: Ignore octal PP bits on < JESD216F
>
> Octal page program support was added in JESD216F. Before that, the bits
> were marked as reserved. Some chips like the Winbond W25Q256JW have some
> of these bits set, which caused octal PP support to be incorrectly
> detected.
>
> Signed-off-by: Paul Cercueil <paul.cercueil@bootlin.com>
[Severity: Low]
This fixes a regression introduced when 4BAIT started parsing the 1-1-8
and 1-8-8 page program bits. Should this include:
Fixes: 68d7115d77a8 ("mtd: spi-nor: sfdp: get the 1-1-8 and 1-8-8 page programs from 4BAIT")
> diff --git a/drivers/mtd/spi-nor/sfdp.c b/drivers/mtd/spi-nor/sfdp.c
> index e0854b8f1d551..c3e6af66873a6 100644
> --- a/drivers/mtd/spi-nor/sfdp.c
> +++ b/drivers/mtd/spi-nor/sfdp.c
[ ... ]
> @@ -1162,6 +1165,12 @@ static int spi_nor_parse_4bait(struct spi_nor *nor,
> pp_hwcaps |= program->hwcaps;
> }
>
> + /* The octal page program bits are reserved before JESD216F. */
> + if (bfpt_header->minor < SFDP_JESD216F_MINOR) {
[Severity: Medium]
Should this check spi_nor_sfdp_get_header(nor)->minor instead of
bfpt_header->minor?
4BAIT is an independent optional parameter table. On a JESD216F flash
that reports a JESD216F top-level SFDP header while keeping an earlier
BFPT revision, checking bfpt_header->minor will discard valid 4-byte
1-1-8 and 1-8-8 page program support.
nor->sfdp is already populated before optional tables are parsed, so
spi_nor_parse_4bait() can check spi_nor_sfdp_get_header(nor)->minor like
is_w25qxxrv() and is_w25qxxpw() in winbond.c without taking bfpt_header.
> + discard_hwcaps |= SNOR_HWCAPS_PP_OCTAL;
> + pp_hwcaps &= ~SNOR_HWCAPS_PP_OCTAL;
> + }
[Severity: High]
Does adding SNOR_HWCAPS_PP_OCTAL to discard_hwcaps strip
SNOR_HWCAPS_PP_8_8_8_DTR on pre-JESD216F Octal DTR flashes?
SNOR_HWCAPS_PP_OCTAL includes PP_8_8_8 and PP_8_8_8_DTR in addition to
PP_1_1_8 and PP_1_8_8, whereas 4BAIT only handles PP_1_1_8 and PP_1_8_8
(already added to discard_hwcaps by the programs[] loop).
If xSPI Profile 1.0 precedes 4BAIT in SFDP, spi_nor_parse_profile1()
sets READ_8_8_8_DTR and PP_8_8_8_DTR, and 4BAIT then clears only
PP_8_8_8_DTR. spi_nor_set_octal_dtr() then sees a read/write protocol
mismatch and skips entering 8D-8D-8D mode while reads still use 8D-8D-8D.
Dropping the discard_hwcaps assignment and clearing only
SNOR_HWCAPS_PP_1_1_8 | SNOR_HWCAPS_PP_1_8_8 from pp_hwcaps avoids
clearing PP_8_8_8 and PP_8_8_8_DTR.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261203111545.55678-1-paul.cercueil@bootlin.com?part=1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2026-12-03 11:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-03 11:15 [PATCH] mtd: spi-nor: Ignore octal PP bits on < JESD216F Paul Cercueil
2026-12-03 11:42 ` sashiko-bot [this message]
2026-12-03 11:43 ` 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=sashiko-outbox-247679@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=miquel.raynal@bootlin.com \
--cc=mwalle@kernel.org \
--cc=nuno.sa@analog.com \
--cc=paul.cercueil@bootlin.com \
--cc=pratyush@kernel.org \
--cc=richard@nod.at \
--cc=sashiko-reviews@lists.linux.dev \
--cc=takahiro.kuwano@infineon.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