mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: haibo.chen@oss.nxp.com
Cc: 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>,
	 linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
	 michael@walle.cc,  imx@lists.linux.dev,
	Haibo Chen <haibo.chen@nxp.com>
Subject: Re: [PATCH] mtd: spi-nor: do not issue the legacy RDCR (0x35) in 8D-8D-8D mode
Date: Mon, 28 Sep 2026 15:01:05 +0200	[thread overview]
Message-ID: <87v77p7coe.fsf@bootlin.com> (raw)
In-Reply-To: <20260928-spi-nor-fix-v1-1-ce65ba90cfbd@nxp.com> (haibo chen's message of "Mon, 28 Sep 2026 20:34:40 +0800")

Hi Haibo,

> +	/*
> +	 * RDCR (0x35) is the legacy single-byte "read SR2/configuration
> +	 * register" opcode and is only meaningful in the (x)STR protocols. In
> +	 * 8D-8D-8D (OPI/DOPI) mode flashes expose their second status or
> +	 * configuration register through a vendor-specific indirect register
> +	 * space, or do not expose it at all, so issuing a bare 0x35 is an
> +	 * unsupported command: the flash drives no data and the controller
> +	 * read times out. Unless a manufacturer driver installed a dedicated
> +	 * 8D-capable read_sr2 opcode (i.e. something other than the default
> +	 * RDCR), skip the SR2 read in 8D mode.
> +	 */
> +	if (nor->reg_proto == SNOR_PROTO_8_8_8_DTR &&
> +	    params->opcodes.read_sr2 == SPINOR_OP_RDCR)
> +		return -EOPNOTSUPP;

I believe this is not the correct solution. The correct solution would
be to clear opcodes.read_sr2 for ODTR flashes by default (if that's
really a default?) and then handle the read_sr2() error correctly in the
debugfs caching.

Also please tell your LLM not to put huge comments like that to explain
what is already in the commit log.

Thanks,
Miquèl

      reply	other threads:[~2026-09-28 13:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-28 12:34 haibo.chen
2026-09-28 13:01 ` Miquel Raynal [this message]

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=87v77p7coe.fsf@bootlin.com \
    --to=miquel.raynal@bootlin.com \
    --cc=haibo.chen@nxp.com \
    --cc=haibo.chen@oss.nxp.com \
    --cc=imx@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=michael@walle.cc \
    --cc=mwalle@kernel.org \
    --cc=pratyush@kernel.org \
    --cc=richard@nod.at \
    --cc=takahiro.kuwano@infineon.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®