Re: [PATCH] mtd: spi-nor: do not issue the legacy RDCR (0x35) in 8D-8D-8D mode

From: Miquel Raynal

Date: Mon Sep 28 2026 - 09:26:50 EST


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