Linux-mtd Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Miquel Raynal" <miquel.raynal@bootlin.com>,
	"Pratyush Yadav" <pratyush@kernel.org>,
	"Michael Walle" <mwalle@kernel.org>,
	"Takahiro Kuwano" <takahiro.kuwano@infineon.com>,
	"Richard Weinberger" <richard@nod.at>,
	"Vignesh Raghavendra" <vigneshr@ti.com>
Cc: "Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	"Alvin Zhou" <alvinzhou@mxic.com.tw>,
	"Cheng Ming Lin" <chengminglin@mxic.com.tw>,
	linux-mtd@lists.infradead.org
Subject: Re: [PATCH 2/4] mtd: spi-nor: macronix: Clear the RDCR opcode on MX25L3255E
Date: Wed, 25 Nov 2026 18:22:30 +0000	[thread overview]
Message-ID: <sashiko-outbox-233974@kernel.org> (raw)
In-Reply-To: <20261125-macronix-upstreaming-spi-nor-cleanup-v1-2-0d1ab783fd8b@bootlin.com>

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] mtd: spi-nor: macronix: mx25l3255e_late_init_fixups() leaves
  2-byte WRSR set
- [Low] mtd: spi-nor: macronix: missing Fixes trailer for commit
  63489002d397
--

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

> mtd: spi-nor: macronix: Clear the RDCR opcode on MX25L3255E
>
> The MX25L3255E BFPT table is incorrect which leads to the RDCR opcode to
> be reset. Make sure the configuration for this chip remains correct.
>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>

[Severity: Low]
This fixes a regression on MX25L3255E where RDCR remained set after BFPT
parsing.  Should the commit message include:

  Fixes: 63489002d397 ("mtd: spi-nor: Refactor Read Status/Write Status support")

> diff --git a/drivers/mtd/spi-nor/macronix.c b/drivers/mtd/spi-nor/macronix.c
> index 2c6f507a2dde7..0331f9f3f853c 100644
> --- a/drivers/mtd/spi-nor/macronix.c
> +++ b/drivers/mtd/spi-nor/macronix.c
> @@ -64,13 +64,14 @@ mx25l3255e_late_init_fixups(struct spi_nor *nor)
>  	struct spi_nor_flash_parameter *params = nor->params;
>  
>  	/*
> -	 * SFDP of MX25L3255E is JESD216, which does not include the Quad
> -	 * Enable bit Requirement in BFPT. As a result, during BFPT parsing
> -	 * the quad_enable mask is reset. Therefore, it is necessary to
> -	 * correct this setting by late_init.
> +	 * SFDP of MX25L3255E does not include the Quad Enable bit
> +	 * Requirement in BFPT. As a result, during BFPT parsing the
> +	 * quad_enable mask and RDCR opcode are reset. Ensure these
> +	 * values remain valid.
>  	 */
>  	params->qe_mask[0] = BIT(6);
>  	params->qe_mask[1] = 0;
> +	params->opcodes.read_sr2 = 0;

[Severity: Medium]
Should this also clear params->opcodes.write_sr1_and_sr2?

spi_nor_parse_bfpt() initializes write_sr1_and_sr2 to SPINOR_OP_WRSR before
checking the QER field and only clears it in the BFPT_DWORD15_QER_SR1_BIT6
case:

drivers/mtd/spi-nor/sfdp.c:spi_nor_parse_bfpt() {
    ...
	case BFPT_DWORD15_QER_SR1_BIT6:
		params->opcodes.read_sr2 = 0;
		params->opcodes.write_sr1_and_sr2 = 0;
		params->qe_mask[0] = BIT(6);
		break;
    ...
}

Because MX25L3255E has no QER entry in its BFPT, write_sr1_and_sr2 remains
SPINOR_OP_WRSR, causing spi_nor_generic_quad_enable() ->
spi_nor_write_sr1_and_sr2() to issue a 2-byte WRSR command instead of a
1-byte SR1 write when enabling Quad mode.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261125-macronix-upstreaming-spi-nor-cleanup-v1-0-0d1ab783fd8b@bootlin.com?part=2

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

  reply	other threads:[~2026-11-25 18:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25 18:01 [PATCH 0/4] mtd: spi-nor: macronix: Improve general support Miquel Raynal
2026-11-25 18:01 ` [PATCH 1/4] mtd: spi-nor: macronix: Clear the default RDCR opcode Miquel Raynal
2026-11-25 18:17   ` sashiko-bot
2026-11-25 18:01 ` [PATCH 2/4] mtd: spi-nor: macronix: Clear the RDCR opcode on MX25L3255E Miquel Raynal
2026-11-25 18:22   ` sashiko-bot [this message]
2026-11-25 18:01 ` [PATCH 3/4] mtd: spi-nor: macronix: Enable RDCR for the parts that support it Miquel Raynal
2026-11-25 18:01 ` [PATCH 4/4] mtd: spi-nor: macronix: Describe locking support for MX25L51245G Miquel Raynal
2026-11-25 18:25   ` 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-233974@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=alvinzhou@mxic.com.tw \
    --cc=chengminglin@mxic.com.tw \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=mwalle@kernel.org \
    --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