Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC 00/16] spi: spi-mem: Express the dummy phase using cycles when relevant
@ 2026-11-25 17:51 Miquel Raynal
  2026-11-25 17:51 ` [PATCH RFC 01/16] spi: spi-mem: Handle a corner case while sanitizing ops Miquel Raynal
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: Miquel Raynal @ 2026-11-25 17:51 UTC (permalink / raw)
  To: Mark Brown, Liang Yang, Feng Chen, Xianwei Zhao, Han Xu,
	Conor Dooley, Valentina Fernandez, Daire McNamara, Haibo Chen,
	Jyan Chou, Yu-Chun Lin, Maxime Coquelin, Alexandre Torgue,
	Pratyush Yadav, Michael Walle, Takahiro Kuwano,
	Richard Weinberger, Vignesh Raghavendra
  Cc: Thomas Petazzoni, Alvin Zhou, Cheng Ming Lin, linux-spi,
	linux-kernel, linux-amlogic, imx, linux-riscv, linux-stm32,
	linux-arm-kernel, linux-mtd, Miquel Raynal

SPI NOR SFDP data gives dummy cycles. SPI NAND devices express the dummy
phase using cycles as well. Those numbers are converted to bytes, then
passed to the spi and spi-mem controller drivers. A non neglictible
amount of those controller drivers convert bytes into cycles before
programming the registers.

When the conversions are lossless, it is not a big deal, just time
spent. However these silent conversions sometimes hide bugs and
sometimes also prevent using certain chips/configurations, as recently
reported on Macronix 1-1-8 chips requiring 20 cycles. Not all
controllers can do that, but the ones that can, would anyway reject
those chips.

Convert spi-mem, all the trivial spi-mem controller drivers and then
SPI NOR to use dummy cycles instead of dummy bytes. SPI NAND may come
later.

This is only build tested for the moment and sent as an RFC because this
topic has raised a lot of questions, there may be things I have
forgotten about, so I would like all parties to agree on the direction
before I commit into something cleaner. I bet Sashiko will also have
interesting feedback to make...

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
Miquel Raynal (16):
      spi: spi-mem: Handle a corner case while sanitizing ops
      spi: spi-mem: Stop checking the dummy buswidth against board wiring
      spi: spi-mem: Add support for dummy cycles
      spi: amlogic-spifc-a1: Consume dummy cycles directly
      spi: amlogic-spifc-a1: Fix a typo in a macro
      spi: amlogic: spifc-a4: Consume dummy cycles directly
      spi: cadence-qspi: Consume dummy cycles directly
      spi: fsl-qspi: Consume dummy cycles directly
      spi: microchip-core-qspi: Consume dummy cycles directly
      spi: nxp-xspi: Consume dummy cycles directly
      spi: nxp-xspi: Fix a comment
      spi: rtk-nor: Consume dummy cycles directly
      spi: sn-f-ospi: Consume dummy cycles directly
      spi: stm32-ospi: Consume dummy cycles directly
      spi: stm32-qspi: Consume dummy cycles directly
      mtd: spi-nor: Express the dummy phase in cycles

 drivers/mtd/spi-nor/core.c            |  36 ++----
 drivers/mtd/spi-nor/core.h            |   8 +-
 drivers/mtd/spi-nor/micron-st.c       |   2 +-
 drivers/mtd/spi-nor/spansion.c        |   6 +-
 drivers/spi/spi-amlogic-spifc-a1.c    |   9 +-
 drivers/spi/spi-amlogic-spifc-a4.c    |  12 +-
 drivers/spi/spi-cadence-quadspi.c     |  35 ++----
 drivers/spi/spi-fsl-qspi.c            |  12 +-
 drivers/spi/spi-mem.c                 | 216 ++++++++++++++++++++++++++++++----
 drivers/spi/spi-microchip-core-qspi.c |   8 +-
 drivers/spi/spi-nxp-xspi.c            |  14 +--
 drivers/spi/spi-rtk-nor.c             |  28 ++---
 drivers/spi/spi-sn-f-ospi.c           |  13 +-
 drivers/spi/spi-stm32-ospi.c          |  14 ++-
 drivers/spi/spi-stm32-qspi.c          |  12 +-
 include/linux/spi/spi-mem.h           |  36 +++++-
 16 files changed, 303 insertions(+), 158 deletions(-)
---
base-commit: 19d1b4de6d37bccecc3ad9144d279f1baa405eb1
change-id: 20261125-macronix-upstreaming-spi-mem-cycles-103274708fec

Best regards,
-- 
Miquel Raynal <miquel.raynal@bootlin.com>



^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH RFC 01/16] spi: spi-mem: Handle a corner case while sanitizing ops
  2026-11-25 17:51 [PATCH RFC 00/16] spi: spi-mem: Express the dummy phase using cycles when relevant Miquel Raynal
@ 2026-11-25 17:51 ` Miquel Raynal
  2026-11-25 17:51 ` [PATCH RFC 02/16] spi: spi-mem: Stop checking the dummy buswidth against board wiring Miquel Raynal
                   ` (15 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Miquel Raynal @ 2026-11-25 17:51 UTC (permalink / raw)
  To: Mark Brown, Liang Yang, Feng Chen, Xianwei Zhao, Han Xu,
	Conor Dooley, Valentina Fernandez, Daire McNamara, Haibo Chen,
	Jyan Chou, Yu-Chun Lin, Maxime Coquelin, Alexandre Torgue,
	Pratyush Yadav, Michael Walle, Takahiro Kuwano,
	Richard Weinberger, Vignesh Raghavendra
  Cc: Thomas Petazzoni, Alvin Zhou, Cheng Ming Lin, linux-spi,
	linux-kernel, linux-amlogic, imx, linux-riscv, linux-stm32,
	linux-arm-kernel, linux-mtd, Miquel Raynal

Some mixed mode operations (such as 1S-xD-yD) will be flagged with
op_is_dtr but will not enter the ODTR checks. As a result, the number of
command bytes will never be checked.

Reorganize a little bit this helper:
- If the operation contains a DTR phase, sanitize it.
- Then sanitize the op, should it be:
  - ODTR (8D-8D-8D)
  - anything else

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/spi/spi-mem.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c
index 8047b7508c8d..c64e906ba919 100644
--- a/drivers/spi/spi-mem.c
+++ b/drivers/spi/spi-mem.c
@@ -170,6 +170,7 @@ bool spi_mem_default_supports_op(struct spi_mem *mem,
 	struct spi_controller *ctlr = mem->spi->controller;
 	bool op_is_dtr =
 		op->cmd.dtr || op->addr.dtr || op->dummy.dtr || op->data.dtr;
+	bool op_is_odtr = op->cmd.dtr && op->cmd.buswidth == 8;
 
 	if (op_is_dtr) {
 		if (!spi_mem_controller_is_capable(ctlr, dtr) && !ctlr->dtr_caps)
@@ -177,23 +178,22 @@ bool spi_mem_default_supports_op(struct spi_mem *mem,
 
 		if (op->data.swap16 && !spi_mem_controller_is_capable(ctlr, swap16))
 			return false;
+	}
 
-		/* Extra 8D-8D-8D limitations */
-		if (op->cmd.dtr && op->cmd.buswidth == 8) {
-			if (op->cmd.nbytes != 2)
-				return false;
-
-			if ((op->addr.nbytes % 2) ||
-			    (op->dummy.nbytes % 2) ||
-			    (op->data.nbytes % 2)) {
-				dev_err(&ctlr->dev,
-					"Even byte numbers not allowed in octal DTR operations\n");
-				return false;
-			}
-		}
-	} else {
+	if (!op_is_odtr) {
 		if (op->cmd.nbytes != 1)
 			return false;
+	} else {
+		if (op->cmd.nbytes != 2)
+			return false;
+
+		if ((op->addr.nbytes % 2) ||
+		    (op->dummy.nbytes % 2) ||
+		    (op->data.nbytes % 2)) {
+			dev_err(&ctlr->dev,
+				"Even byte numbers not allowed in octal DTR operations\n");
+			return false;
+		}
 	}
 
 	if (op->data.ecc) {

-- 
2.56.0



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH RFC 02/16] spi: spi-mem: Stop checking the dummy buswidth against board wiring
  2026-11-25 17:51 [PATCH RFC 00/16] spi: spi-mem: Express the dummy phase using cycles when relevant Miquel Raynal
  2026-11-25 17:51 ` [PATCH RFC 01/16] spi: spi-mem: Handle a corner case while sanitizing ops Miquel Raynal
@ 2026-11-25 17:51 ` Miquel Raynal
  2026-11-25 17:51 ` [PATCH RFC 03/16] spi: spi-mem: Add support for dummy cycles Miquel Raynal
                   ` (14 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Miquel Raynal @ 2026-11-25 17:51 UTC (permalink / raw)
  To: Mark Brown, Liang Yang, Feng Chen, Xianwei Zhao, Han Xu,
	Conor Dooley, Valentina Fernandez, Daire McNamara, Haibo Chen,
	Jyan Chou, Yu-Chun Lin, Maxime Coquelin, Alexandre Torgue,
	Pratyush Yadav, Michael Walle, Takahiro Kuwano,
	Richard Weinberger, Vignesh Raghavendra
  Cc: Thomas Petazzoni, Alvin Zhou, Cheng Ming Lin, linux-spi,
	linux-kernel, linux-amlogic, imx, linux-riscv, linux-stm32,
	linux-arm-kernel, linux-mtd, Miquel Raynal

The dummy phase does not transfer any data. Its buswidth only describes
the pin state during the dummy cycles, so it must not be validated
against the board's Tx/Rx wiring.

Drop that check (the sanity check in spi_mem_check_op() stays).

Suggested-by: Pratyush Yadav <pratyush@kernel.org>
Link: https://lore.kernel.org/linux-mtd/20241112075242.174010-1-linchengming884@gmail.com/T/#m7cc1a5055702f5a42a8f3949c968842d845914d7
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
This is not really a fix, so no fixes/cc:stable is on purpose.
---
 drivers/spi/spi-mem.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c
index c64e906ba919..9b8b8f2b3387 100644
--- a/drivers/spi/spi-mem.c
+++ b/drivers/spi/spi-mem.c
@@ -152,9 +152,10 @@ static bool spi_mem_check_buswidth(struct spi_mem *mem,
 	    spi_check_buswidth_req(mem, op->addr.buswidth, true))
 		return false;
 
-	if (op->dummy.nbytes &&
-	    spi_check_buswidth_req(mem, op->dummy.buswidth, true))
-		return false;
+	/*
+	 * The dummy phase implies no actual transmission nor reception.
+	 * Its buswidth therefore does not matter much.
+	 */
 
 	if (op->data.dir != SPI_MEM_NO_DATA &&
 	    spi_check_buswidth_req(mem, op->data.buswidth,

-- 
2.56.0



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH RFC 03/16] spi: spi-mem: Add support for dummy cycles
  2026-11-25 17:51 [PATCH RFC 00/16] spi: spi-mem: Express the dummy phase using cycles when relevant Miquel Raynal
  2026-11-25 17:51 ` [PATCH RFC 01/16] spi: spi-mem: Handle a corner case while sanitizing ops Miquel Raynal
  2026-11-25 17:51 ` [PATCH RFC 02/16] spi: spi-mem: Stop checking the dummy buswidth against board wiring Miquel Raynal
@ 2026-11-25 17:51 ` Miquel Raynal
  2026-11-25 17:51 ` [PATCH RFC 04/16] spi: amlogic-spifc-a1: Consume dummy cycles directly Miquel Raynal
                   ` (13 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Miquel Raynal @ 2026-11-25 17:51 UTC (permalink / raw)
  To: Mark Brown, Liang Yang, Feng Chen, Xianwei Zhao, Han Xu,
	Conor Dooley, Valentina Fernandez, Daire McNamara, Haibo Chen,
	Jyan Chou, Yu-Chun Lin, Maxime Coquelin, Alexandre Torgue,
	Pratyush Yadav, Michael Walle, Takahiro Kuwano,
	Richard Weinberger, Vignesh Raghavendra
  Cc: Thomas Petazzoni, Alvin Zhou, Cheng Ming Lin, linux-spi,
	linux-kernel, linux-amlogic, imx, linux-riscv, linux-stm32,
	linux-arm-kernel, linux-mtd, Miquel Raynal

The dummy phase is a number of clock cycles, not a number of bytes. SPI
NOR flashes commonly require a number of dummy cycles that is not a
multiple of 8, and the byte-based representation cannot express it.

Add a dummy.ncycles field and make it the primary representation. Keep
dummy.nbytes for the legacy byte-oriented controllers and users. The two
fields are mutually exclusive and spi_mem_check_op() enforces that rule.

Controllers that can program an arbitrary number of cycles advertise the
dummy_cycles capability and consume dummy.ncycles directly. The core
converts the legacy dummy.nbytes to cycles for them, so the users that
still describe the dummy phase in bytes keep working. If the byte count
cannot be expressed as a whole number of cycles, the operation is
rejected.

For the other controllers the core converts dummy.ncycles to the legacy
dummy.nbytes representation using the usual maths. If the cycle count
cannot be represented exactly, the operation is rejected instead of
being silently truncated.

Link: https://lore.kernel.org/all/20220911174551.653599-1-sergiu.moga@microchip.com/
Link: https://lore.kernel.org/all/20250115134158.19908-1-pratyush@kernel.org/

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/spi/spi-mem.c       | 181 ++++++++++++++++++++++++++++++++++++++++++--
 include/linux/spi/spi-mem.h |  36 ++++++++-
 2 files changed, 205 insertions(+), 12 deletions(-)

diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c
index 9b8b8f2b3387..7f5849bf1a0d 100644
--- a/drivers/spi/spi-mem.c
+++ b/drivers/spi/spi-mem.c
@@ -224,6 +224,134 @@ static bool spi_mem_buswidth_is_valid(u8 buswidth)
 	return true;
 }
 
+/**
+ * spi_mem_dummy_cycles_to_bytes() - Convert the dummy phase cycles to bytes
+ * @op: the SPI memory operation
+ *
+ * Return: the number of dummy bytes on success, a negative error code if the
+ *	   dummy phase cannot be represented as a whole number of bytes.
+ *	   If @op->dummy.ncycles is zero, @op->dummy.nbytes is returned.
+ *
+ * This helper can be used to convert dummy cycles into dummy bytes for
+ * controllers that can only insert a whole number of dummy bytes.
+ */
+static int spi_mem_dummy_cycles_to_bytes(const struct spi_mem_op *op)
+{
+	u32 bits;
+
+	if (!op->dummy.ncycles)
+		return op->dummy.nbytes;
+
+	if (!op->dummy.buswidth)
+		return -EOPNOTSUPP;
+
+	bits = (u32)op->dummy.ncycles * op->dummy.buswidth;
+	if (op->dummy.dtr)
+		bits *= 2;
+
+	if (bits % 8 || bits / 8 > U8_MAX)
+		return -EOPNOTSUPP;
+
+	return bits / 8;
+}
+
+/**
+ * spi_mem_get_lossy_dummy_bytes() - Give a rounded number of dummy bytes
+ * @op: the SPI memory operation
+ *
+ * Return: an upper rounded amount of dummy bytes without touching the @op.
+ */
+static unsigned int spi_mem_get_lossy_dummy_bytes(const struct spi_mem_op *op)
+{
+	u32 bits;
+
+	if (!op->dummy.ncycles)
+		return op->dummy.nbytes;
+
+	if (!op->dummy.buswidth)
+		return 0;
+
+	bits = (u32)op->dummy.ncycles * op->dummy.buswidth;
+	if (op->dummy.dtr)
+		bits *= 2;
+
+	return DIV_ROUND_UP(bits, 8);
+}
+
+/**
+ * spi_mem_dummy_bytes_to_cycles() - Convert the dummy phase bytes to cycles
+ * @op: the SPI memory operation
+ *
+ * Return: the number of dummy clock cycles on success, a negative error code
+ *	   if the dummy phase cannot be represented as a whole number of clock
+ *	   cycles. If @op->dummy.nbytes is zero, @op->dummy.ncycles is returned.
+ *
+ * This helper can be used to convert inlet operations using dummy bytes
+ * into operations using dummy cycles.
+ */
+static int spi_mem_dummy_bytes_to_cycles(const struct spi_mem_op *op)
+{
+	u32 bits, bits_per_cycle;
+
+	if (!op->dummy.nbytes)
+		return op->dummy.ncycles;
+
+	bits_per_cycle = op->dummy.buswidth;
+	if (op->dummy.dtr)
+		bits_per_cycle *= 2;
+	if (!bits_per_cycle)
+		return -EOPNOTSUPP;
+
+	bits = (u32)op->dummy.nbytes * 8;
+	if (bits % bits_per_cycle)
+		return -EOPNOTSUPP;
+
+	bits /= bits_per_cycle;
+	if (bits > U8_MAX)
+		return -EOPNOTSUPP;
+
+	return bits;
+}
+
+/*
+ * Controllers either program the dummy phase in clock cycles or in whole
+ * bytes. Convert the representation used by the operation to the one the
+ * controller expects.
+ *
+ * Return: 0 if the operation is lossless, -EOPNOTSUPP otherwise.
+ */
+static int spi_mem_convert_dummy(struct spi_mem *mem, struct spi_mem_op *op)
+{
+	struct spi_controller *ctlr = mem->spi->controller;
+	int n;
+
+	if (op->dummy.ncycles) {
+		if (spi_mem_controller_is_capable(ctlr, dummy_cycles))
+			return 0;
+
+		n = spi_mem_dummy_cycles_to_bytes(op);
+		if (n < 0)
+			return n;
+
+		op->dummy.nbytes = n;
+		op->dummy.ncycles = 0;
+	} else if (op->dummy.nbytes) {
+		if (!spi_mem_controller_is_capable(ctlr, dummy_cycles))
+			return 0;
+
+		n = spi_mem_dummy_bytes_to_cycles(op);
+		if (n < 0)
+			return n;
+
+		op->dummy.ncycles = n;
+		op->dummy.nbytes = 0;
+
+		return 0;
+	}
+
+	return 0;
+}
+
 static int spi_mem_check_op(const struct spi_mem_op *op)
 {
 	if (!op->cmd.buswidth || !op->cmd.nbytes)
@@ -231,9 +359,13 @@ static int spi_mem_check_op(const struct spi_mem_op *op)
 
 	if ((op->addr.nbytes && !op->addr.buswidth) ||
 	    (op->dummy.nbytes && !op->dummy.buswidth) ||
+	    (op->dummy.ncycles && !op->dummy.buswidth) ||
 	    (op->data.nbytes && !op->data.buswidth))
 		return -EINVAL;
 
+	if (op->dummy.nbytes && op->dummy.ncycles)
+		return -EINVAL;
+
 	if (!spi_mem_buswidth_is_valid(op->cmd.buswidth) ||
 	    !spi_mem_buswidth_is_valid(op->addr.buswidth) ||
 	    !spi_mem_buswidth_is_valid(op->dummy.buswidth) ||
@@ -290,6 +422,9 @@ bool spi_mem_supports_op(struct spi_mem *mem, const struct spi_mem_op *op)
 	 */
 	spi_mem_adjust_op_freq(mem, &eval_op);
 
+	if (spi_mem_convert_dummy(mem, &eval_op))
+		return false;
+
 	if (spi_mem_check_op(&eval_op))
 		return false;
 
@@ -338,6 +473,7 @@ static void spi_mem_access_end(struct spi_mem *mem)
 static void spi_mem_add_op_stats(struct spi_statistics __percpu *pcpu_stats,
 				 const struct spi_mem_op *op, int exec_op_ret)
 {
+	int dummy_nbytes = spi_mem_get_lossy_dummy_bytes(op);
 	struct spi_statistics *stats;
 	u64 len, l2len;
 
@@ -354,7 +490,7 @@ static void spi_mem_add_op_stats(struct spi_statistics __percpu *pcpu_stats,
 
 	/* Use the sum of all lengths as bytes count and histogram value. */
 	len = op->cmd.nbytes + op->addr.nbytes;
-	len += op->dummy.nbytes + op->data.nbytes;
+	len += dummy_nbytes + op->data.nbytes;
 	u64_stats_add(&stats->bytes, len);
 	l2len = min(fls(len), SPI_STATISTICS_HISTO_SIZE) - 1;
 	u64_stats_inc(&stats->transfer_bytes_histo[l2len]);
@@ -381,7 +517,7 @@ static void spi_mem_add_op_stats(struct spi_statistics __percpu *pcpu_stats,
 /**
  * spi_mem_exec_op() - Execute a memory operation
  * @mem: the SPI memory
- * @op: the memory operation to execute
+ * @ro_op: the memory operation to execute (shall not be edited)
  *
  * Executes a memory operation.
  *
@@ -390,22 +526,28 @@ static void spi_mem_add_op_stats(struct spi_statistics __percpu *pcpu_stats,
  *
  * Return: 0 in case of success, a negative error code otherwise.
  */
-int spi_mem_exec_op(struct spi_mem *mem, const struct spi_mem_op *op)
+int spi_mem_exec_op(struct spi_mem *mem, const struct spi_mem_op *ro_op)
 {
 	unsigned int tmpbufsize, xferpos = 0, totalxferlen = 0;
 	struct spi_controller *ctlr = mem->spi->controller;
+	struct spi_mem_op wr_op = *ro_op, *op = &wr_op;
 	struct spi_transfer xfers[4] = { };
 	struct spi_message msg;
 	u8 *tmpbuf;
 	int ret;
 
 	/* Make sure the operation frequency is correct before going futher */
-	spi_mem_adjust_op_freq(mem, (struct spi_mem_op *)op);
+	spi_mem_adjust_op_freq(mem, op);
+
+	/* Also make sure the dummy phase can be consumed by the controller */
+	ret = spi_mem_convert_dummy(mem, op);
+	if (ret)
+		return ret;
 
 	dev_vdbg(&mem->spi->dev, "[cmd: 0x%02x][%dB addr: %#8llx][%2dB dummy][%4dB data %s] %d%c-%d%c-%d%c-%d%c @ %uHz\n",
 		 op->cmd.opcode,
 		 op->addr.nbytes, (op->addr.nbytes ? op->addr.val : 0),
-		 op->dummy.nbytes,
+		 spi_mem_get_lossy_dummy_bytes(op),
 		 op->data.nbytes, (op->data.nbytes ? (op->data.dir == SPI_MEM_DATA_IN ? " read" : "write") : "     "),
 		 op->cmd.buswidth, op->cmd.dtr ? 'D' : 'S',
 		 op->addr.buswidth, op->addr.dtr ? 'D' : 'S',
@@ -597,6 +739,11 @@ int spi_mem_adjust_op_size(struct spi_mem *mem, struct spi_mem_op *op)
 {
 	struct spi_controller *ctlr = mem->spi->controller;
 	size_t len;
+	int ret;
+
+	ret = spi_mem_convert_dummy(mem, op);
+	if (ret)
+		return ret;
 
 	if (ctlr->mem_ops && ctlr->mem_ops->adjust_op_size)
 		return ctlr->mem_ops->adjust_op_size(mem, op);
@@ -673,9 +820,12 @@ u64 spi_mem_calc_op_duration(struct spi_mem *mem, struct spi_mem_op *op)
 	ncycles += ((op->cmd.nbytes * 8) / op->cmd.buswidth) / (op->cmd.dtr ? 2 : 1);
 	ncycles += ((op->addr.nbytes * 8) / op->addr.buswidth) / (op->addr.dtr ? 2 : 1);
 
-	/* Dummy bytes are optional for some SPI flash memory operations */
-	if (op->dummy.nbytes)
-		ncycles += ((op->dummy.nbytes * 8) / op->dummy.buswidth) / (op->dummy.dtr ? 2 : 1);
+	/* Dummy cycles are optional for some SPI flash memory operations */
+	if (op->dummy.ncycles)
+		ncycles += op->dummy.ncycles;
+	else if (op->dummy.nbytes)
+		ncycles += ((op->dummy.nbytes * 8) / op->dummy.buswidth) /
+			   (op->dummy.dtr ? 2 : 1);
 
 	ncycles += ((op->data.nbytes * 8) / op->data.buswidth) / (op->data.dtr ? 2 : 1);
 
@@ -781,6 +931,21 @@ spi_mem_dirmap_create(struct spi_mem *mem,
 	desc->mem = mem;
 	desc->info = *info;
 	desc->info.op_tmpl = &desc->info.primary_op_tmpl;
+
+	ret = spi_mem_convert_dummy(mem, &desc->info.primary_op_tmpl);
+	if (ret) {
+		kfree(desc);
+		return ERR_PTR(ret);
+	}
+
+	if (desc->info.secondary_op_tmpl.cmd.opcode) {
+		ret = spi_mem_convert_dummy(mem, &desc->info.secondary_op_tmpl);
+		if (ret) {
+			kfree(desc);
+			return ERR_PTR(ret);
+		}
+	}
+
 	if (ctlr->mem_ops && ctlr->mem_ops->dirmap_create) {
 		ret = spi_mem_access_start(mem);
 		if (ret) {
diff --git a/include/linux/spi/spi-mem.h b/include/linux/spi/spi-mem.h
index 0cce6b57242a..adc7f53b8474 100644
--- a/include/linux/spi/spi-mem.h
+++ b/include/linux/spi/spi-mem.h
@@ -75,6 +75,12 @@
 		.buswidth = __buswidth,				\
 	}
 
+#define SPI_MEM_OP_DUMMY_CYCLES(__ncycles, __buswidth)		\
+	{							\
+		.ncycles = __ncycles,				\
+		.buswidth = __buswidth,				\
+	}
+
 #define SPI_MEM_DTR_OP_DUMMY(__nbytes, __buswidth)		\
 	{							\
 		.nbytes = __nbytes,				\
@@ -82,6 +88,13 @@
 		.dtr = true,					\
 	}
 
+#define SPI_MEM_DTR_OP_DUMMY_CYCLES(__ncycles, __buswidth)	\
+	{							\
+		.ncycles = __ncycles,				\
+		.buswidth = __buswidth,				\
+		.dtr = true,					\
+	}
+
 #define SPI_MEM_OP_NO_DUMMY	{ }
 
 #define SPI_MEM_OP_DATA_IN(__nbytes, __buf, __buswidth)		\
@@ -154,10 +167,18 @@ enum spi_mem_data_dir {
  *	      address value, so users should make sure the value fits in the
  *	      assigned number of bytes.
  * @dummy: data for dummy operation
- * @dummy.nbytes: number of dummy bytes to send after an opcode or address. Can
- *		  be zero if the operation does not require dummy bytes
- * @dummy.buswidth: number of IO lanes used to transmit the dummy bytes
- * @dummy.dtr: whether the dummy bytes should be sent in DTR mode or not
+ * @dummy.ncycles: number of dummy clock cycles to insert after an opcode or
+ *		   address. Can be zero if the operation does not require
+ *		   dummy cycles. Mutually exclusive with @dummy.nbytes.
+ * @dummy.nbytes: legacy number of dummy bytes to send after an opcode or
+ *		  address. Can be zero if the operation does not require dummy
+ *		  bytes. Mutually exclusive with @dummy.ncycles.
+ * @dummy.buswidth: number of IO lanes used during the dummy phase. It is
+ *		    also used to convert @dummy.ncycles to bytes for controllers
+ *		    that can only insert a whole number of dummy bytes.
+ * @dummy.dtr: whether the dummy phase is clocked in DTR mode. This only
+ *	       describes the pin state and does not change the number of
+ *	       clock cycles.
  * @data: the data attributes
  * @data.buswidth: number of IO lanes used to send/receive the data
  * @data.dtr: whether the data should be sent in DTR mode or not
@@ -191,6 +212,7 @@ struct spi_mem_op {
 	} addr;
 
 	struct {
+		u8 ncycles;
 		u8 nbytes;
 		u8 buswidth;
 		u8 dtr : 1;
@@ -392,6 +414,11 @@ struct spi_controller_mem_ops {
  *                   is a pause in the transfer (eg. internal bus contention or
  *                   DMA arbitration on an interconnect). Features such as NAND
  *                   continuous reads shall not be leveraged.
+ * @dummy_cycles: Supports programming the exact number of dummy clock cycles.
+ *                When set, the core converts the legacy @dummy.nbytes to clock
+ *                cycles. When unset, the core converts @dummy.ncycles to whole
+ *                dummy bytes for the controller and rejects operations that
+ *                cannot be converted exactly.
  */
 struct spi_controller_mem_caps {
 	bool dtr;
@@ -400,6 +427,7 @@ struct spi_controller_mem_caps {
 	bool per_op_freq;
 	bool secondary_op_tmpl;
 	bool no_cs_assertion;
+	bool dummy_cycles;
 };
 
 #define spi_mem_controller_is_capable(ctlr, cap)	\

-- 
2.56.0



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH RFC 04/16] spi: amlogic-spifc-a1: Consume dummy cycles directly
  2026-11-25 17:51 [PATCH RFC 00/16] spi: spi-mem: Express the dummy phase using cycles when relevant Miquel Raynal
                   ` (2 preceding siblings ...)
  2026-11-25 17:51 ` [PATCH RFC 03/16] spi: spi-mem: Add support for dummy cycles Miquel Raynal
@ 2026-11-25 17:51 ` Miquel Raynal
  2026-11-25 17:51 ` [PATCH RFC 05/16] spi: amlogic-spifc-a1: Fix a typo in a macro Miquel Raynal
                   ` (12 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Miquel Raynal @ 2026-11-25 17:51 UTC (permalink / raw)
  To: Mark Brown, Liang Yang, Feng Chen, Xianwei Zhao, Han Xu,
	Conor Dooley, Valentina Fernandez, Daire McNamara, Haibo Chen,
	Jyan Chou, Yu-Chun Lin, Maxime Coquelin, Alexandre Torgue,
	Pratyush Yadav, Michael Walle, Takahiro Kuwano,
	Richard Weinberger, Vignesh Raghavendra
  Cc: Thomas Petazzoni, Alvin Zhou, Cheng Ming Lin, linux-spi,
	linux-kernel, linux-amlogic, imx, linux-riscv, linux-stm32,
	linux-arm-kernel, linux-mtd, Miquel Raynal

The spi-mem layer is now capable of providing the dummy phase in cycle
units rather than bytes, provided that drivers advertize the dummy_cycle
capability. Since this controller is consuming cycles and currently
converts bytes into cycles, flag it capable to consume cycles directly
and drop the extra conversions.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/spi/spi-amlogic-spifc-a1.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-amlogic-spifc-a1.c b/drivers/spi/spi-amlogic-spifc-a1.c
index 388bd2472dc0..282647cd6b56 100644
--- a/drivers/spi/spi-amlogic-spifc-a1.c
+++ b/drivers/spi/spi-amlogic-spifc-a1.c
@@ -90,7 +90,7 @@
 #define SPIFC_A1_USER_DUMMY(op) ( \
 	SPIFC_A1_USER_DUMMY_ENABLE | \
 	FIELD_PREP(SPIFC_A1_USER_DUMMY_MODE, ilog2((op)->dummy.buswidth)) | \
-	FIELD_PREP(SPIFC_A1_USER_DUMMY_CLK_SYCLES, (op)->dummy.nbytes << 3))
+	FIELD_PREP(SPIFC_A1_USER_DUMMY_CLK_SYCLES, (op)->dummy.ncycles))
 
 #define SPIFC_A1_TSLCH_VAL	FIELD_PREP(SPIFC_A1_TSLCH, 1)
 #define SPIFC_A1_TCLSH_VAL	FIELD_PREP(SPIFC_A1_TCLSH, 1)
@@ -269,7 +269,7 @@ static int amlogic_spifc_a1_exec_op(struct spi_mem *mem,
 		amlogic_spifc_a1_set_addr(spifc, op->addr.val,
 					  SPIFC_A1_USER_ADDR(op));
 
-	if (op->dummy.nbytes)
+	if (op->dummy.ncycles)
 		amlogic_spifc_a1_set_dummy(spifc, SPIFC_A1_USER_DUMMY(op));
 
 	if (data_size) {
@@ -321,6 +321,7 @@ static const struct spi_controller_mem_ops amlogic_spifc_a1_mem_ops = {
 
 static const struct spi_controller_mem_caps amlogic_spifc_a1_mem_caps = {
 	.per_op_freq = true,
+	.dummy_cycles = true,
 };
 
 static int amlogic_spifc_a1_probe(struct platform_device *pdev)

-- 
2.56.0



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH RFC 05/16] spi: amlogic-spifc-a1: Fix a typo in a macro
  2026-11-25 17:51 [PATCH RFC 00/16] spi: spi-mem: Express the dummy phase using cycles when relevant Miquel Raynal
                   ` (3 preceding siblings ...)
  2026-11-25 17:51 ` [PATCH RFC 04/16] spi: amlogic-spifc-a1: Consume dummy cycles directly Miquel Raynal
@ 2026-11-25 17:51 ` Miquel Raynal
  2026-11-25 17:51 ` [PATCH RFC 06/16] spi: amlogic: spifc-a4: Consume dummy cycles directly Miquel Raynal
                   ` (11 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Miquel Raynal @ 2026-11-25 17:51 UTC (permalink / raw)
  To: Mark Brown, Liang Yang, Feng Chen, Xianwei Zhao, Han Xu,
	Conor Dooley, Valentina Fernandez, Daire McNamara, Haibo Chen,
	Jyan Chou, Yu-Chun Lin, Maxime Coquelin, Alexandre Torgue,
	Pratyush Yadav, Michael Walle, Takahiro Kuwano,
	Richard Weinberger, Vignesh Raghavendra
  Cc: Thomas Petazzoni, Alvin Zhou, Cheng Ming Lin, linux-spi,
	linux-kernel, linux-amlogic, imx, linux-riscv, linux-stm32,
	linux-arm-kernel, linux-mtd, Miquel Raynal

Correct the macro name: sycles -> cycles.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/spi/spi-amlogic-spifc-a1.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-amlogic-spifc-a1.c b/drivers/spi/spi-amlogic-spifc-a1.c
index 282647cd6b56..d99c72c7a965 100644
--- a/drivers/spi/spi-amlogic-spifc-a1.c
+++ b/drivers/spi/spi-amlogic-spifc-a1.c
@@ -43,7 +43,7 @@
 #define SPIFC_A1_USER_CTRL2_REG		0x208
 #define SPIFC_A1_USER_DUMMY_ENABLE	BIT(31)
 #define SPIFC_A1_USER_DUMMY_MODE	GENMASK(30, 29)
-#define SPIFC_A1_USER_DUMMY_CLK_SYCLES	GENMASK(28, 23)
+#define SPIFC_A1_USER_DUMMY_CLK_CYCLES	GENMASK(28, 23)
 
 #define SPIFC_A1_USER_CTRL3_REG		0x20c
 #define SPIFC_A1_USER_DIN_ENABLE	BIT(31)
@@ -90,7 +90,7 @@
 #define SPIFC_A1_USER_DUMMY(op) ( \
 	SPIFC_A1_USER_DUMMY_ENABLE | \
 	FIELD_PREP(SPIFC_A1_USER_DUMMY_MODE, ilog2((op)->dummy.buswidth)) | \
-	FIELD_PREP(SPIFC_A1_USER_DUMMY_CLK_SYCLES, (op)->dummy.ncycles))
+	FIELD_PREP(SPIFC_A1_USER_DUMMY_CLK_CYCLES, (op)->dummy.ncycles))
 
 #define SPIFC_A1_TSLCH_VAL	FIELD_PREP(SPIFC_A1_TSLCH, 1)
 #define SPIFC_A1_TCLSH_VAL	FIELD_PREP(SPIFC_A1_TCLSH, 1)
@@ -195,7 +195,7 @@ static void amlogic_spifc_a1_set_dummy(struct amlogic_spifc_a1 *spifc,
 {
 	u32 val = readl(spifc->base + SPIFC_A1_USER_CTRL2_REG);
 
-	val &= ~(SPIFC_A1_USER_DUMMY_MODE | SPIFC_A1_USER_DUMMY_CLK_SYCLES);
+	val &= ~(SPIFC_A1_USER_DUMMY_MODE | SPIFC_A1_USER_DUMMY_CLK_CYCLES);
 	val |= dummy_cfg;
 	writel(val, spifc->base + SPIFC_A1_USER_CTRL2_REG);
 }

-- 
2.56.0



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH RFC 06/16] spi: amlogic: spifc-a4: Consume dummy cycles directly
  2026-11-25 17:51 [PATCH RFC 00/16] spi: spi-mem: Express the dummy phase using cycles when relevant Miquel Raynal
                   ` (4 preceding siblings ...)
  2026-11-25 17:51 ` [PATCH RFC 05/16] spi: amlogic-spifc-a1: Fix a typo in a macro Miquel Raynal
@ 2026-11-25 17:51 ` Miquel Raynal
  2026-11-25 17:51 ` [PATCH RFC 07/16] spi: cadence-qspi: " Miquel Raynal
                   ` (10 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Miquel Raynal @ 2026-11-25 17:51 UTC (permalink / raw)
  To: Mark Brown, Liang Yang, Feng Chen, Xianwei Zhao, Han Xu,
	Conor Dooley, Valentina Fernandez, Daire McNamara, Haibo Chen,
	Jyan Chou, Yu-Chun Lin, Maxime Coquelin, Alexandre Torgue,
	Pratyush Yadav, Michael Walle, Takahiro Kuwano,
	Richard Weinberger, Vignesh Raghavendra
  Cc: Thomas Petazzoni, Alvin Zhou, Cheng Ming Lin, linux-spi,
	linux-kernel, linux-amlogic, imx, linux-riscv, linux-stm32,
	linux-arm-kernel, linux-mtd, Miquel Raynal

The spi-mem layer is now capable of providing the dummy phase in cycle
units rather than bytes, provided that drivers advertize the dummy_cycle
capability. Since this controller is consuming cycles and currently
converts bytes into cycles, flag it capable to consume cycles directly
and drop the extra conversions.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/spi/spi-amlogic-spifc-a4.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/spi/spi-amlogic-spifc-a4.c b/drivers/spi/spi-amlogic-spifc-a4.c
index 16346f50c7d9..ac06ea735133 100644
--- a/drivers/spi/spi-amlogic-spifc-a4.c
+++ b/drivers/spi/spi-amlogic-spifc-a4.c
@@ -361,13 +361,8 @@ static int aml_sfc_send_cmd_addr_dummy(struct aml_sfc *sfc, const struct spi_mem
 	if (ret)
 		return ret;
 
-	if (op->dummy.nbytes) {
-		/*  Dummy buswidth configuration is not supported */
-		if (aml_sfc_is_xio_op(op))
-			dummy_cycle = op->dummy.nbytes * 8 / op->data.buswidth;
-		else
-			dummy_cycle = op->dummy.nbytes * 8;
-		cmd = CMD_DUMMY(sfc->cs_sel, dummy_cycle - 1);
+	if (op->dummy.ncycles) {
+		cmd = CMD_DUMMY(sfc->cs_sel, op->dummy.ncycles - 1);
 		return regmap_write(sfc->regmap_base, SFC_CMD, cmd);
 	}
 
@@ -803,7 +798,7 @@ static int aml_sfc_exec_op(struct spi_mem *mem, const struct spi_mem_op *op)
 
 	dev_dbg(sfc->dev, "cmd:0x%02x - addr:%08llX@%d:%u - dummy:%d:%u - data:%d:%u",
 		op->cmd.opcode, op->addr.val, op->addr.buswidth, op->addr.nbytes,
-		op->dummy.buswidth, op->dummy.nbytes, op->data.buswidth, op->data.nbytes);
+		op->dummy.buswidth, op->dummy.ncycles, op->data.buswidth, op->data.nbytes);
 
 	ret = aml_sfc_pre_transfer(sfc, DEFAULT_PULLUP_CYCLE, CS_SETUP_CYCLE);
 	if (ret)
@@ -1057,6 +1052,7 @@ static int aml_sfc_ecc_finish_io_req(struct nand_device *nand,
 
 static const struct spi_controller_mem_caps aml_sfc_mem_caps = {
 	.ecc = true,
+	.dummy_cycles = true,
 };
 
 static const struct nand_ecc_engine_ops aml_sfc_ecc_engine_ops = {

-- 
2.56.0



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH RFC 07/16] spi: cadence-qspi: Consume dummy cycles directly
  2026-11-25 17:51 [PATCH RFC 00/16] spi: spi-mem: Express the dummy phase using cycles when relevant Miquel Raynal
                   ` (5 preceding siblings ...)
  2026-11-25 17:51 ` [PATCH RFC 06/16] spi: amlogic: spifc-a4: Consume dummy cycles directly Miquel Raynal
@ 2026-11-25 17:51 ` Miquel Raynal
  2026-11-25 17:51 ` [PATCH RFC 08/16] spi: fsl-qspi: " Miquel Raynal
                   ` (9 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Miquel Raynal @ 2026-11-25 17:51 UTC (permalink / raw)
  To: Mark Brown, Liang Yang, Feng Chen, Xianwei Zhao, Han Xu,
	Conor Dooley, Valentina Fernandez, Daire McNamara, Haibo Chen,
	Jyan Chou, Yu-Chun Lin, Maxime Coquelin, Alexandre Torgue,
	Pratyush Yadav, Michael Walle, Takahiro Kuwano,
	Richard Weinberger, Vignesh Raghavendra
  Cc: Thomas Petazzoni, Alvin Zhou, Cheng Ming Lin, linux-spi,
	linux-kernel, linux-amlogic, imx, linux-riscv, linux-stm32,
	linux-arm-kernel, linux-mtd, Miquel Raynal

The spi-mem layer is now capable of providing the dummy phase in cycle
units rather than bytes, provided that drivers advertize the dummy_cycle
capability. Since this controller is consuming cycles and currently
converts bytes into cycles, flag it capable to consume cycles directly
and drop the extra conversions.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/spi/spi-cadence-quadspi.c | 35 +++++++++--------------------------
 1 file changed, 9 insertions(+), 26 deletions(-)

diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
index 44d96b8cf8f0..1bf21cadd1da 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -410,20 +410,6 @@ static unsigned int cqspi_calc_rdreg(const struct spi_mem_op *op)
 	return rdreg;
 }
 
-static unsigned int cqspi_calc_dummy(const struct spi_mem_op *op)
-{
-	unsigned int dummy_clk;
-
-	if (!op->dummy.nbytes)
-		return 0;
-
-	dummy_clk = op->dummy.nbytes * (8 / op->dummy.buswidth);
-	if (op->cmd.dtr)
-		dummy_clk /= 2;
-
-	return dummy_clk;
-}
-
 static int cqspi_wait_idle(struct cqspi_st *cqspi)
 {
 	const unsigned int poll_idle_retry = 3;
@@ -549,7 +535,6 @@ static int cqspi_command_read(struct cqspi_flash_pdata *f_pdata,
 	size_t n_rx = op->data.nbytes;
 	unsigned int rdreg;
 	unsigned int reg;
-	unsigned int dummy_clk;
 	size_t read_len;
 	int status;
 
@@ -574,12 +559,11 @@ static int cqspi_command_read(struct cqspi_flash_pdata *f_pdata,
 	rdreg = cqspi_calc_rdreg(op);
 	writel(rdreg, reg_base + CQSPI_REG_RD_INSTR);
 
-	dummy_clk = cqspi_calc_dummy(op);
-	if (dummy_clk > CQSPI_DUMMY_CLKS_MAX)
+	if (op->dummy.ncycles > CQSPI_DUMMY_CLKS_MAX)
 		return -EOPNOTSUPP;
 
-	if (dummy_clk)
-		reg |= (dummy_clk & CQSPI_REG_CMDCTRL_DUMMY_MASK)
+	if (op->dummy.ncycles)
+		reg |= (op->dummy.ncycles & CQSPI_REG_CMDCTRL_DUMMY_MASK)
 		     << CQSPI_REG_CMDCTRL_DUMMY_LSB;
 
 	reg |= BIT(CQSPI_REG_CMDCTRL_RD_EN_LSB);
@@ -696,7 +680,6 @@ static int cqspi_read_setup(struct cqspi_flash_pdata *f_pdata,
 {
 	struct cqspi_st *cqspi = f_pdata->cqspi;
 	void __iomem *reg_base = cqspi->iobase;
-	unsigned int dummy_clk = 0;
 	unsigned int reg;
 	int ret;
 	u8 opcode;
@@ -714,13 +697,11 @@ static int cqspi_read_setup(struct cqspi_flash_pdata *f_pdata,
 	reg |= cqspi_calc_rdreg(op);
 
 	/* Setup dummy clock cycles */
-	dummy_clk = cqspi_calc_dummy(op);
-
-	if (dummy_clk > CQSPI_DUMMY_CLKS_MAX)
+	if (op->dummy.ncycles > CQSPI_DUMMY_CLKS_MAX)
 		return -EOPNOTSUPP;
 
-	if (dummy_clk)
-		reg |= (dummy_clk & CQSPI_REG_RD_INSTR_DUMMY_MASK)
+	if (op->dummy.ncycles)
+		reg |= (op->dummy.ncycles & CQSPI_REG_RD_INSTR_DUMMY_MASK)
 		       << CQSPI_REG_RD_INSTR_DUMMY_LSB;
 
 	writel(reg, reg_base + CQSPI_REG_RD_INSTR);
@@ -1528,7 +1509,7 @@ static bool cqspi_supports_mem_op(struct spi_mem *mem,
 	 */
 	all_true = op->cmd.dtr &&
 		   (!op->addr.nbytes || op->addr.dtr) &&
-		   (!op->dummy.nbytes || op->dummy.dtr) &&
+		   (!op->dummy.ncycles || op->dummy.dtr) &&
 		   (!op->data.nbytes || op->data.dtr);
 
 	all_false = !op->cmd.dtr && !op->addr.dtr && !op->dummy.dtr &&
@@ -1739,12 +1720,14 @@ static const struct spi_controller_mem_ops cqspi_mem_ops = {
 static const struct spi_controller_mem_caps cqspi_mem_caps = {
 	.dtr = true,
 	.per_op_freq = true,
+	.dummy_cycles = true,
 };
 
 static const struct spi_controller_mem_caps cqspi_am654_mem_caps = {
 	.dtr = true,
 	.per_op_freq = true,
 	.no_cs_assertion = true,
+	.dummy_cycles = true,
 };
 
 static int cqspi_setup_flash(struct cqspi_st *cqspi)

-- 
2.56.0



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH RFC 08/16] spi: fsl-qspi: Consume dummy cycles directly
  2026-11-25 17:51 [PATCH RFC 00/16] spi: spi-mem: Express the dummy phase using cycles when relevant Miquel Raynal
                   ` (6 preceding siblings ...)
  2026-11-25 17:51 ` [PATCH RFC 07/16] spi: cadence-qspi: " Miquel Raynal
@ 2026-11-25 17:51 ` Miquel Raynal
  2026-11-25 17:51 ` [PATCH RFC 09/16] spi: microchip-core-qspi: " Miquel Raynal
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Miquel Raynal @ 2026-11-25 17:51 UTC (permalink / raw)
  To: Mark Brown, Liang Yang, Feng Chen, Xianwei Zhao, Han Xu,
	Conor Dooley, Valentina Fernandez, Daire McNamara, Haibo Chen,
	Jyan Chou, Yu-Chun Lin, Maxime Coquelin, Alexandre Torgue,
	Pratyush Yadav, Michael Walle, Takahiro Kuwano,
	Richard Weinberger, Vignesh Raghavendra
  Cc: Thomas Petazzoni, Alvin Zhou, Cheng Ming Lin, linux-spi,
	linux-kernel, linux-amlogic, imx, linux-riscv, linux-stm32,
	linux-arm-kernel, linux-mtd, Miquel Raynal

The spi-mem layer is now capable of providing the dummy phase in cycle
units rather than bytes, provided that drivers advertize the dummy_cycle
capability. Since this controller is consuming cycles and currently
converts bytes into cycles, flag it capable to consume cycles directly
and drop the extra conversions.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/spi/spi-fsl-qspi.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/spi/spi-fsl-qspi.c b/drivers/spi/spi-fsl-qspi.c
index d2c2090442f8..a1d6357e3203 100644
--- a/drivers/spi/spi-fsl-qspi.c
+++ b/drivers/spi/spi-fsl-qspi.c
@@ -399,7 +399,7 @@ static bool fsl_qspi_supports_op(struct spi_mem *mem,
 	if (op->addr.nbytes)
 		ret |= fsl_qspi_check_buswidth(q, op->addr.buswidth);
 
-	if (op->dummy.nbytes)
+	if (op->dummy.ncycles)
 		ret |= fsl_qspi_check_buswidth(q, op->dummy.buswidth);
 
 	if (op->data.nbytes)
@@ -413,13 +413,12 @@ static bool fsl_qspi_supports_op(struct spi_mem *mem,
 	 * to fit into a single LUT entry.
 	 */
 	if (op->addr.nbytes +
-	   (op->dummy.nbytes ? 1:0) +
+	   (op->dummy.ncycles ? 1:0) +
 	   (op->data.nbytes ? 1:0) > 6)
 		return false;
 
 	/* Max 64 dummy clock cycles supported */
-	if (op->dummy.nbytes &&
-	    (op->dummy.nbytes * 8 / op->dummy.buswidth > 64))
+	if (op->dummy.ncycles > 64)
 		return false;
 
 	/* Max data length, check controller limits and alignment */
@@ -460,11 +459,10 @@ static void fsl_qspi_prepare_lut(struct fsl_qspi *q,
 		lutidx++;
 	}
 
-	if (op->dummy.nbytes) {
+	if (op->dummy.ncycles) {
 		lutval[lutidx / 2] |= LUT_DEF(lutidx, LUT_DUMMY,
 					      LUT_PAD(op->dummy.buswidth),
-					      op->dummy.nbytes * 8 /
-					      op->dummy.buswidth);
+					      op->dummy.ncycles);
 		lutidx++;
 	}
 

-- 
2.56.0



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH RFC 09/16] spi: microchip-core-qspi: Consume dummy cycles directly
  2026-11-25 17:51 [PATCH RFC 00/16] spi: spi-mem: Express the dummy phase using cycles when relevant Miquel Raynal
                   ` (7 preceding siblings ...)
  2026-11-25 17:51 ` [PATCH RFC 08/16] spi: fsl-qspi: " Miquel Raynal
@ 2026-11-25 17:51 ` Miquel Raynal
  2026-11-25 17:51 ` [PATCH RFC 10/16] spi: nxp-xspi: " Miquel Raynal
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Miquel Raynal @ 2026-11-25 17:51 UTC (permalink / raw)
  To: Mark Brown, Liang Yang, Feng Chen, Xianwei Zhao, Han Xu,
	Conor Dooley, Valentina Fernandez, Daire McNamara, Haibo Chen,
	Jyan Chou, Yu-Chun Lin, Maxime Coquelin, Alexandre Torgue,
	Pratyush Yadav, Michael Walle, Takahiro Kuwano,
	Richard Weinberger, Vignesh Raghavendra
  Cc: Thomas Petazzoni, Alvin Zhou, Cheng Ming Lin, linux-spi,
	linux-kernel, linux-amlogic, imx, linux-riscv, linux-stm32,
	linux-arm-kernel, linux-mtd, Miquel Raynal

The spi-mem layer is now capable of providing the dummy phase in cycle
units rather than bytes, provided that drivers advertize the dummy_cycle
capability. Since this controller is consuming cycles and currently
converts bytes into cycles, flag it capable to consume cycles directly
and drop the extra conversions.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/spi/spi-microchip-core-qspi.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/spi/spi-microchip-core-qspi.c b/drivers/spi/spi-microchip-core-qspi.c
index c0ea65014d2e..2fc1df738062 100644
--- a/drivers/spi/spi-microchip-core-qspi.c
+++ b/drivers/spi/spi-microchip-core-qspi.c
@@ -420,7 +420,6 @@ static int mchp_coreqspi_setup_clock(struct mchp_coreqspi *qspi, struct spi_devi
 
 static void mchp_coreqspi_config_op(struct mchp_coreqspi *qspi, const struct spi_mem_op *op)
 {
-	u32 idle_cycles = 0;
 	int total_bytes, cmd_bytes, frames, ctrl;
 
 	cmd_bytes = op->cmd.nbytes + op->addr.nbytes;
@@ -459,11 +458,7 @@ static void mchp_coreqspi_config_op(struct mchp_coreqspi *qspi, const struct spi
 	writel_relaxed(frames, qspi->regs + REG_FRAMESUP);
 	frames = total_bytes & BYTESLOWER_MASK;
 	frames |= cmd_bytes << FRAMES_CMDBYTES_SHIFT;
-
-	if (op->dummy.buswidth)
-		idle_cycles = op->dummy.nbytes * 8 / op->dummy.buswidth;
-
-	frames |= idle_cycles << FRAMES_IDLE_SHIFT;
+	frames |= op->dummy.ncycles << FRAMES_IDLE_SHIFT;
 	ctrl = readl_relaxed(qspi->regs + REG_CONTROL);
 
 	if (ctrl & CONTROL_MODE12_MASK)
@@ -601,6 +596,7 @@ static const struct spi_controller_mem_ops mchp_coreqspi_mem_ops = {
 
 static const struct spi_controller_mem_caps mchp_coreqspi_mem_caps = {
 	.per_op_freq = true,
+	.dummy_cycles = true,
 };
 
 static int mchp_coreqspi_unprepare_message(struct spi_controller *ctlr, struct spi_message *m)

-- 
2.56.0



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH RFC 10/16] spi: nxp-xspi: Consume dummy cycles directly
  2026-11-25 17:51 [PATCH RFC 00/16] spi: spi-mem: Express the dummy phase using cycles when relevant Miquel Raynal
                   ` (8 preceding siblings ...)
  2026-11-25 17:51 ` [PATCH RFC 09/16] spi: microchip-core-qspi: " Miquel Raynal
@ 2026-11-25 17:51 ` Miquel Raynal
  2026-11-25 17:51 ` [PATCH RFC 11/16] spi: nxp-xspi: Fix a comment Miquel Raynal
                   ` (6 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Miquel Raynal @ 2026-11-25 17:51 UTC (permalink / raw)
  To: Mark Brown, Liang Yang, Feng Chen, Xianwei Zhao, Han Xu,
	Conor Dooley, Valentina Fernandez, Daire McNamara, Haibo Chen,
	Jyan Chou, Yu-Chun Lin, Maxime Coquelin, Alexandre Torgue,
	Pratyush Yadav, Michael Walle, Takahiro Kuwano,
	Richard Weinberger, Vignesh Raghavendra
  Cc: Thomas Petazzoni, Alvin Zhou, Cheng Ming Lin, linux-spi,
	linux-kernel, linux-amlogic, imx, linux-riscv, linux-stm32,
	linux-arm-kernel, linux-mtd, Miquel Raynal

The spi-mem layer is now capable of providing the dummy phase in cycle
units rather than bytes, provided that drivers advertize the dummy_cycle
capability. Since this controller is consuming cycles and currently
converts bytes into cycles, flag it capable to consume cycles directly
and drop the extra conversions.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/spi/spi-nxp-xspi.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/spi/spi-nxp-xspi.c b/drivers/spi/spi-nxp-xspi.c
index 38c8d6269aad..8b836662a5da 100644
--- a/drivers/spi/spi-nxp-xspi.c
+++ b/drivers/spi/spi-nxp-xspi.c
@@ -392,7 +392,7 @@ static bool nxp_xspi_supports_op(struct spi_mem *mem,
 	if (op->addr.nbytes)
 		ret |= nxp_xspi_check_buswidth(xspi, op->addr.buswidth);
 
-	if (op->dummy.nbytes)
+	if (op->dummy.ncycles)
 		ret |= nxp_xspi_check_buswidth(xspi, op->dummy.buswidth);
 
 	if (op->data.nbytes)
@@ -408,8 +408,7 @@ static bool nxp_xspi_supports_op(struct spi_mem *mem,
 		return false;
 
 	/* Max 32 dummy clock cycles supported */
-	if (op->dummy.buswidth &&
-	    (op->dummy.nbytes * 8 / op->dummy.buswidth > 64))
+	if (op->dummy.ncycles > 64)
 		return false;
 
 	if (needs_ip_only(xspi) && op->data.dir == SPI_MEM_DATA_IN &&
@@ -453,12 +452,10 @@ static void nxp_xspi_prepare_lut(struct nxp_xspi *xspi,
 	}
 
 	/* Dummy bytes, if needed */
-	if (op->dummy.nbytes) {
+	if (op->dummy.ncycles) {
 		lutval[lutidx / 2] |= LUT_DEF(lutidx, LUT_DUMMY,
 					      LUT_PAD(op->data.buswidth),
-					      op->dummy.nbytes * 8 /
-						/* need distinguish ddr mode */
-					      op->dummy.buswidth / (op->dummy.dtr ? 2 : 1));
+					      op->dummy.ncycles);
 		lutidx++;
 	}
 
@@ -1307,6 +1304,7 @@ static const struct spi_controller_mem_caps nxp_xspi_mem_caps = {
 	.dtr = true,
 	.per_op_freq = true,
 	.swap16 = true,
+	.dummy_cycles = true,
 };
 
 static void nxp_xspi_cleanup(void *data)

-- 
2.56.0



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH RFC 11/16] spi: nxp-xspi: Fix a comment
  2026-11-25 17:51 [PATCH RFC 00/16] spi: spi-mem: Express the dummy phase using cycles when relevant Miquel Raynal
                   ` (9 preceding siblings ...)
  2026-11-25 17:51 ` [PATCH RFC 10/16] spi: nxp-xspi: " Miquel Raynal
@ 2026-11-25 17:51 ` Miquel Raynal
  2026-11-25 17:51 ` [PATCH RFC 12/16] spi: rtk-nor: Consume dummy cycles directly Miquel Raynal
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Miquel Raynal @ 2026-11-25 17:51 UTC (permalink / raw)
  To: Mark Brown, Liang Yang, Feng Chen, Xianwei Zhao, Han Xu,
	Conor Dooley, Valentina Fernandez, Daire McNamara, Haibo Chen,
	Jyan Chou, Yu-Chun Lin, Maxime Coquelin, Alexandre Torgue,
	Pratyush Yadav, Michael Walle, Takahiro Kuwano,
	Richard Weinberger, Vignesh Raghavendra
  Cc: Thomas Petazzoni, Alvin Zhou, Cheng Ming Lin, linux-spi,
	linux-kernel, linux-amlogic, imx, linux-riscv, linux-stm32,
	linux-arm-kernel, linux-mtd, Miquel Raynal

Looking at the i.MX952 TRM which is I believe one of the SoCs with this
controller inside, the maximum number of supported dummy clock cycles is
64 and not 32, so the code seems more accurate than the comment, which
needs fixing.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/spi/spi-nxp-xspi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-nxp-xspi.c b/drivers/spi/spi-nxp-xspi.c
index 8b836662a5da..ccd00c744d18 100644
--- a/drivers/spi/spi-nxp-xspi.c
+++ b/drivers/spi/spi-nxp-xspi.c
@@ -407,7 +407,7 @@ static bool nxp_xspi_supports_op(struct spi_mem *mem,
 	if (op->addr.nbytes > 4)
 		return false;
 
-	/* Max 32 dummy clock cycles supported */
+	/* Max 64 dummy clock cycles supported */
 	if (op->dummy.ncycles > 64)
 		return false;
 

-- 
2.56.0



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH RFC 12/16] spi: rtk-nor: Consume dummy cycles directly
  2026-11-25 17:51 [PATCH RFC 00/16] spi: spi-mem: Express the dummy phase using cycles when relevant Miquel Raynal
                   ` (10 preceding siblings ...)
  2026-11-25 17:51 ` [PATCH RFC 11/16] spi: nxp-xspi: Fix a comment Miquel Raynal
@ 2026-11-25 17:51 ` Miquel Raynal
  2026-11-25 17:51 ` [PATCH RFC 13/16] spi: sn-f-ospi: " Miquel Raynal
                   ` (4 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Miquel Raynal @ 2026-11-25 17:51 UTC (permalink / raw)
  To: Mark Brown, Liang Yang, Feng Chen, Xianwei Zhao, Han Xu,
	Conor Dooley, Valentina Fernandez, Daire McNamara, Haibo Chen,
	Jyan Chou, Yu-Chun Lin, Maxime Coquelin, Alexandre Torgue,
	Pratyush Yadav, Michael Walle, Takahiro Kuwano,
	Richard Weinberger, Vignesh Raghavendra
  Cc: Thomas Petazzoni, Alvin Zhou, Cheng Ming Lin, linux-spi,
	linux-kernel, linux-amlogic, imx, linux-riscv, linux-stm32,
	linux-arm-kernel, linux-mtd, Miquel Raynal

The spi-mem layer is now capable of providing the dummy phase in cycle
units rather than bytes, provided that drivers advertize the dummy_cycle
capability. Since this controller is consuming cycles and currently
converts bytes into cycles, flag it capable to consume cycles directly
and drop the extra conversions.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/spi/spi-rtk-nor.c | 28 +++++++++++-----------------
 1 file changed, 11 insertions(+), 17 deletions(-)

diff --git a/drivers/spi/spi-rtk-nor.c b/drivers/spi/spi-rtk-nor.c
index 55ea7c371854..6febeee2541d 100644
--- a/drivers/spi/spi-rtk-nor.c
+++ b/drivers/spi/spi-rtk-nor.c
@@ -92,18 +92,10 @@ struct rtk_spi_host {
 	size_t			dirmap_size;
 };
 
-static u32 rtk_spi_calc_dummy_cycles(const struct spi_mem_op *op)
-{
-	if (!op->dummy.nbytes)
-		return 0;
-
-	return (op->dummy.nbytes * 8) / op->dummy.buswidth;
-}
-
 static void rtk_spi_read_mode(struct rtk_spi_host *host, const struct spi_mem_op *op)
 {
 	u32 opcode = op->cmd.opcode;
-	u32 dummy_cycles, val;
+	u32 val;
 
 	if (op->data.buswidth == 2)
 		opcode |= DUAL_MODE_EN;
@@ -113,10 +105,8 @@ static void rtk_spi_read_mode(struct rtk_spi_host *host, const struct spi_mem_op
 	val = readl(host->regbase + SFC_CTL);
 	val |= RW_DATAEN | ADDR_EN;
 
-	dummy_cycles = rtk_spi_calc_dummy_cycles(op);
-
 	val &= ~SFC_CTL_DMYCNT_MASK;
-	val |= (dummy_cycles << SFC_CTL_DMYCNT_SHIFT) & SFC_CTL_DMYCNT_MASK;
+	val |= (op->dummy.ncycles << SFC_CTL_DMYCNT_SHIFT) & SFC_CTL_DMYCNT_MASK;
 	writel(val, host->regbase + SFC_CTL);
 
 	readl(host->iobase);
@@ -192,7 +182,7 @@ static int rtk_spi_command_read(struct rtk_spi_host *host, const struct spi_mem_
 	size_t len = op->data.nbytes;
 	loff_t offset = op->addr.val;
 	u8 opcode = op->cmd.opcode;
-	u32 dummy_cycles, val;
+	u32 val;
 
 	writel(opcode, host->regbase + SFC_OPCODE);
 
@@ -203,8 +193,7 @@ static int rtk_spi_command_read(struct rtk_spi_host *host, const struct spi_mem_
 	if (op->addr.nbytes > 0)
 		val |= ADDR_EN;
 
-	dummy_cycles = rtk_spi_calc_dummy_cycles(op);
-	val |= (dummy_cycles << SFC_CTL_DMYCNT_SHIFT) & SFC_CTL_DMYCNT_MASK;
+	val |= (op.dummy.ncycles << SFC_CTL_DMYCNT_SHIFT) & SFC_CTL_DMYCNT_MASK;
 	writel(val, host->regbase + SFC_CTL);
 
 	return rtk_spi_byte_transfer(host, offset, len, op->data.buf.in, true);
@@ -346,8 +335,8 @@ static bool rtk_spi_supports_op(struct spi_mem *mem,
 	if (!op->addr.nbytes && op->data.nbytes > 1)
 		return false;
 
-	if (op->dummy.nbytes != 0) {
-		if (op->dummy.buswidth > 1 || op->dummy.nbytes > 7)
+	if (op->dummy.ncycles) {
+		if (op->dummy.buswidth > 1 || op->dummy.ncycles > 7 * BITS_PER_BYTE)
 			return false;
 	}
 
@@ -464,6 +453,10 @@ static const struct spi_controller_mem_ops rtk_spi_mem_ops = {
 	.adjust_op_size = rtk_spi_adjust_op_size,
 };
 
+static const struct spi_controller_mem_caps rtk_spi_mem_caps = {
+	.dummy_cycles = true,
+};
+
 static int rtk_spi_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
@@ -535,6 +528,7 @@ static int rtk_spi_probe(struct platform_device *pdev)
 	ctrl->mode_bits = SPI_RX_DUAL | SPI_TX_DUAL;
 	ctrl->bus_num = -1;
 	ctrl->mem_ops = &rtk_spi_mem_ops;
+	ctrl->mem_caps = &rtk_spi_mem_caps;
 	ctrl->num_chipselect = 1;
 	ctrl->auto_runtime_pm = true;
 

-- 
2.56.0



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH RFC 13/16] spi: sn-f-ospi: Consume dummy cycles directly
  2026-11-25 17:51 [PATCH RFC 00/16] spi: spi-mem: Express the dummy phase using cycles when relevant Miquel Raynal
                   ` (11 preceding siblings ...)
  2026-11-25 17:51 ` [PATCH RFC 12/16] spi: rtk-nor: Consume dummy cycles directly Miquel Raynal
@ 2026-11-25 17:51 ` Miquel Raynal
  2026-11-25 17:51 ` [PATCH RFC 14/16] spi: stm32-ospi: " Miquel Raynal
                   ` (3 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Miquel Raynal @ 2026-11-25 17:51 UTC (permalink / raw)
  To: Mark Brown, Liang Yang, Feng Chen, Xianwei Zhao, Han Xu,
	Conor Dooley, Valentina Fernandez, Daire McNamara, Haibo Chen,
	Jyan Chou, Yu-Chun Lin, Maxime Coquelin, Alexandre Torgue,
	Pratyush Yadav, Michael Walle, Takahiro Kuwano,
	Richard Weinberger, Vignesh Raghavendra
  Cc: Thomas Petazzoni, Alvin Zhou, Cheng Ming Lin, linux-spi,
	linux-kernel, linux-amlogic, imx, linux-riscv, linux-stm32,
	linux-arm-kernel, linux-mtd, Miquel Raynal

The spi-mem layer is now capable of providing the dummy phase in cycle
units rather than bytes, provided that drivers advertize the dummy_cycle
capability. Since this controller is consuming cycles and currently
converts bytes into cycles, flag it capable to consume cycles directly
and drop the extra conversions.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/spi/spi-sn-f-ospi.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/spi/spi-sn-f-ospi.c b/drivers/spi/spi-sn-f-ospi.c
index f0320e96fe23..ecfcf228c587 100644
--- a/drivers/spi/spi-sn-f-ospi.c
+++ b/drivers/spi/spi-sn-f-ospi.c
@@ -114,14 +114,6 @@ struct f_ospi {
 	struct mutex mlock;
 };
 
-static u32 f_ospi_get_dummy_cycle(const struct spi_mem_op *op)
-{
-	if (!op->dummy.nbytes)
-		return 0;
-
-	return (op->dummy.nbytes * 8) / op->dummy.buswidth;
-}
-
 static void f_ospi_clear_irq(struct f_ospi *ospi)
 {
 	writel(OSPI_IRQ_CS_DEASSERT | OSPI_IRQ_CS_TRANS_COMP,
@@ -348,7 +340,7 @@ static int f_ospi_indir_prepare_op(struct f_ospi *ospi, struct spi_mem *mem,
 
 	f_ospi_config_indir_protocol(ospi, mem, op);
 
-	writel(f_ospi_get_dummy_cycle(op), ospi->base + OSPI_DMY_INDIR);
+	writel(op->dummy.ncycles, ospi->base + OSPI_DMY_INDIR);
 	writel(op->addr.val, ospi->base + OSPI_ADDR);
 	writel(op->cmd.opcode, ospi->base + OSPI_CMD_IDX_INDIR);
 
@@ -553,7 +545,7 @@ static bool f_ospi_supports_op_width(struct spi_mem *mem,
 static bool f_ospi_supports_op(struct spi_mem *mem,
 			       const struct spi_mem_op *op)
 {
-	if (f_ospi_get_dummy_cycle(op) > OSPI_DUMMY_CYCLE_MAX)
+	if (op.dummy.ncycles > OSPI_DUMMY_CYCLE_MAX)
 		return false;
 
 	if (op->addr.nbytes > 4)
@@ -580,6 +572,7 @@ static const struct spi_controller_mem_ops f_ospi_mem_ops = {
 
 static const struct spi_controller_mem_caps f_ospi_mem_caps = {
 	.per_op_freq = true,
+	.dummy_cycles = true,
 };
 
 static int f_ospi_init(struct f_ospi *ospi)

-- 
2.56.0



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH RFC 14/16] spi: stm32-ospi: Consume dummy cycles directly
  2026-11-25 17:51 [PATCH RFC 00/16] spi: spi-mem: Express the dummy phase using cycles when relevant Miquel Raynal
                   ` (12 preceding siblings ...)
  2026-11-25 17:51 ` [PATCH RFC 13/16] spi: sn-f-ospi: " Miquel Raynal
@ 2026-11-25 17:51 ` Miquel Raynal
  2026-11-25 17:51 ` [PATCH RFC 15/16] spi: stm32-qspi: " Miquel Raynal
                   ` (2 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Miquel Raynal @ 2026-11-25 17:51 UTC (permalink / raw)
  To: Mark Brown, Liang Yang, Feng Chen, Xianwei Zhao, Han Xu,
	Conor Dooley, Valentina Fernandez, Daire McNamara, Haibo Chen,
	Jyan Chou, Yu-Chun Lin, Maxime Coquelin, Alexandre Torgue,
	Pratyush Yadav, Michael Walle, Takahiro Kuwano,
	Richard Weinberger, Vignesh Raghavendra
  Cc: Thomas Petazzoni, Alvin Zhou, Cheng Ming Lin, linux-spi,
	linux-kernel, linux-amlogic, imx, linux-riscv, linux-stm32,
	linux-arm-kernel, linux-mtd, Miquel Raynal

The spi-mem layer is now capable of providing the dummy phase in cycle
units rather than bytes, provided that drivers advertize the dummy_cycle
capability. Since this controller is consuming cycles and currently
converts bytes into cycles, flag it capable to consume cycles directly
and drop the extra conversions.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/spi/spi-stm32-ospi.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/spi/spi-stm32-ospi.c b/drivers/spi/spi-stm32-ospi.c
index fa0e8e83cb1b..9b28d1f24482 100644
--- a/drivers/spi/spi-stm32-ospi.c
+++ b/drivers/spi/spi-stm32-ospi.c
@@ -492,10 +492,9 @@ static int stm32_ospi_send(struct spi_device *spi, const struct spi_mem_op *op)
 	}
 
 	tcr = TCR_SSHIFT;
-	if (op->dummy.buswidth && op->dummy.nbytes) {
-		tcr |= FIELD_PREP(TCR_DCYC_MASK,
-				  op->dummy.nbytes * 8 / op->dummy.buswidth);
-	}
+	if (op->dummy.buswidth && op->dummy.ncycles)
+		tcr |= FIELD_PREP(TCR_DCYC_MASK, op->dummy.ncycles);
+
 	writel_relaxed(tcr, regs_base + OSPI_TCR);
 
 	if (op->data.nbytes) {
@@ -691,7 +690,7 @@ static int stm32_ospi_transfer_one_message(struct spi_controller *ctrl,
 		 */
 		if (transfer->dummy_data) {
 			op.dummy.buswidth = transfer->tx_nbits;
-			op.dummy.nbytes = transfer->len;
+			op.dummy.ncycles = transfer->len * 8 / transfer->tx_nbits;
 			dummy_bytes = transfer->len;
 
 			/* If happens, means that message is not correctly built */
@@ -784,6 +783,10 @@ static const struct spi_controller_mem_ops stm32_ospi_mem_ops = {
 	.poll_status	= stm32_ospi_poll_status,
 };
 
+static const struct spi_controller_mem_caps stm32_ospi_mem_caps = {
+	.dummy_cycles = true,
+};
+
 static int stm32_ospi_get_resources(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
@@ -933,6 +936,7 @@ static int stm32_ospi_probe(struct platform_device *pdev)
 	ctrl->setup = stm32_ospi_setup;
 	ctrl->bus_num = -1;
 	ctrl->mem_ops = &stm32_ospi_mem_ops;
+	ctrl->mem_caps = &stm32_ospi_mem_caps;
 	ctrl->use_gpio_descriptors = true;
 	ctrl->transfer_one_message = stm32_ospi_transfer_one_message;
 	ctrl->num_chipselect = STM32_OSPI_MAX_NORCHIP;

-- 
2.56.0



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH RFC 15/16] spi: stm32-qspi: Consume dummy cycles directly
  2026-11-25 17:51 [PATCH RFC 00/16] spi: spi-mem: Express the dummy phase using cycles when relevant Miquel Raynal
                   ` (13 preceding siblings ...)
  2026-11-25 17:51 ` [PATCH RFC 14/16] spi: stm32-ospi: " Miquel Raynal
@ 2026-11-25 17:51 ` Miquel Raynal
  2026-11-25 17:51 ` [PATCH RFC 16/16] mtd: spi-nor: Express the dummy phase in cycles Miquel Raynal
  2026-11-26 11:09 ` [PATCH RFC 00/16] spi: spi-mem: Express the dummy phase using cycles when relevant Miquel Raynal
  16 siblings, 0 replies; 18+ messages in thread
From: Miquel Raynal @ 2026-11-25 17:51 UTC (permalink / raw)
  To: Mark Brown, Liang Yang, Feng Chen, Xianwei Zhao, Han Xu,
	Conor Dooley, Valentina Fernandez, Daire McNamara, Haibo Chen,
	Jyan Chou, Yu-Chun Lin, Maxime Coquelin, Alexandre Torgue,
	Pratyush Yadav, Michael Walle, Takahiro Kuwano,
	Richard Weinberger, Vignesh Raghavendra
  Cc: Thomas Petazzoni, Alvin Zhou, Cheng Ming Lin, linux-spi,
	linux-kernel, linux-amlogic, imx, linux-riscv, linux-stm32,
	linux-arm-kernel, linux-mtd, Miquel Raynal

The spi-mem layer is now capable of providing the dummy phase in cycle
units rather than bytes, provided that drivers advertize the dummy_cycle
capability. Since this controller is consuming cycles and currently
converts bytes into cycles, flag it capable to consume cycles directly
and drop the extra conversions.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/spi/spi-stm32-qspi.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-stm32-qspi.c b/drivers/spi/spi-stm32-qspi.c
index b77daba6db83..993b09cc5124 100644
--- a/drivers/spi/spi-stm32-qspi.c
+++ b/drivers/spi/spi-stm32-qspi.c
@@ -393,9 +393,8 @@ static int stm32_qspi_send(struct spi_device *spi, const struct spi_mem_op *op)
 		ccr |= FIELD_PREP(CCR_ADSIZE_MASK, op->addr.nbytes - 1);
 	}
 
-	if (op->dummy.nbytes)
-		ccr |= FIELD_PREP(CCR_DCYC_MASK,
-				  op->dummy.nbytes * 8 / op->dummy.buswidth);
+	if (op->dummy.ncycles)
+		ccr |= FIELD_PREP(CCR_DCYC_MASK, op->dummy.ncycles);
 
 	if (op->data.nbytes) {
 		ccr |= FIELD_PREP(CCR_DMODE_MASK,
@@ -593,7 +592,7 @@ static int stm32_qspi_transfer_one_message(struct spi_controller *ctrl,
 		 */
 		if (transfer->dummy_data) {
 			op.dummy.buswidth = transfer->tx_nbits;
-			op.dummy.nbytes = transfer->len;
+			op.dummy.ncycles = transfer->len * 8 / transfer->tx_nbits;
 			dummy_bytes = transfer->len;
 
 			/* if happens, means that message is not correctly built */
@@ -773,6 +772,10 @@ static const struct spi_controller_mem_ops stm32_qspi_mem_ops = {
 	.poll_status	= stm32_qspi_poll_status,
 };
 
+static const struct spi_controller_mem_caps stm32_qspi_mem_caps = {
+	.dummy_cycles = true,
+};
+
 static int stm32_qspi_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
@@ -856,6 +859,7 @@ static int stm32_qspi_probe(struct platform_device *pdev)
 	ctrl->setup = stm32_qspi_setup;
 	ctrl->bus_num = -1;
 	ctrl->mem_ops = &stm32_qspi_mem_ops;
+	ctrl->mem_caps = &stm32_qspi_mem_caps;
 	ctrl->use_gpio_descriptors = true;
 	ctrl->transfer_one_message = stm32_qspi_transfer_one_message;
 	ctrl->num_chipselect = STM32_QSPI_MAX_NORCHIP;

-- 
2.56.0



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH RFC 16/16] mtd: spi-nor: Express the dummy phase in cycles
  2026-11-25 17:51 [PATCH RFC 00/16] spi: spi-mem: Express the dummy phase using cycles when relevant Miquel Raynal
                   ` (14 preceding siblings ...)
  2026-11-25 17:51 ` [PATCH RFC 15/16] spi: stm32-qspi: " Miquel Raynal
@ 2026-11-25 17:51 ` Miquel Raynal
  2026-11-26 11:09 ` [PATCH RFC 00/16] spi: spi-mem: Express the dummy phase using cycles when relevant Miquel Raynal
  16 siblings, 0 replies; 18+ messages in thread
From: Miquel Raynal @ 2026-11-25 17:51 UTC (permalink / raw)
  To: Mark Brown, Liang Yang, Feng Chen, Xianwei Zhao, Han Xu,
	Conor Dooley, Valentina Fernandez, Daire McNamara, Haibo Chen,
	Jyan Chou, Yu-Chun Lin, Maxime Coquelin, Alexandre Torgue,
	Pratyush Yadav, Michael Walle, Takahiro Kuwano,
	Richard Weinberger, Vignesh Raghavendra
  Cc: Thomas Petazzoni, Alvin Zhou, Cheng Ming Lin, linux-spi,
	linux-kernel, linux-amlogic, imx, linux-riscv, linux-stm32,
	linux-arm-kernel, linux-mtd, Miquel Raynal

SFDP tables and datasheets provide the number of dummy cycles, not the
number of dummy bytes. Set dummy.ncycles directly instead of converting
it to dummy.nbytes. Depending on controller capabilities, this may help
supporting more use cases (typically Macronix 1S-8S-8S 20 dummy cycles)
while performing less useless maths in the core.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/spi-nor/core.c      | 36 ++++++++++--------------------------
 drivers/mtd/spi-nor/core.h      |  8 ++++----
 drivers/mtd/spi-nor/micron-st.c |  2 +-
 drivers/mtd/spi-nor/spansion.c  |  6 +++---
 4 files changed, 18 insertions(+), 34 deletions(-)

diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
index a04d22d2e2e1..dcc36f532aaa 100644
--- a/drivers/mtd/spi-nor/core.c
+++ b/drivers/mtd/spi-nor/core.c
@@ -91,7 +91,7 @@ void spi_nor_spimem_setup_op(const struct spi_nor *nor,
 	if (op->addr.nbytes)
 		op->addr.buswidth = spi_nor_get_protocol_addr_nbits(proto);
 
-	if (op->dummy.nbytes)
+	if (op->dummy.nbytes || op->dummy.ncycles)
 		op->dummy.buswidth = spi_nor_get_protocol_addr_nbits(proto);
 
 	if (op->data.nbytes)
@@ -109,9 +109,6 @@ void spi_nor_spimem_setup_op(const struct spi_nor *nor,
 		op->dummy.dtr = true;
 		op->data.dtr = true;
 
-		/* 2 bytes per clock cycle in DTR mode. */
-		op->dummy.nbytes *= 2;
-
 		ext = spi_nor_get_cmd_ext(nor, op);
 		op->cmd.opcode = (op->cmd.opcode << 8) | ext;
 		op->cmd.nbytes = 2;
@@ -205,7 +202,7 @@ static ssize_t spi_nor_spimem_read_data(struct spi_nor *nor, loff_t from,
 	struct spi_mem_op op =
 		SPI_MEM_OP(SPI_MEM_OP_CMD(nor->read_opcode, 0),
 			   SPI_MEM_OP_ADDR(nor->addr_nbytes, from, 0),
-			   SPI_MEM_OP_DUMMY(nor->read_dummy, 0),
+			   SPI_MEM_OP_DUMMY_CYCLES(nor->read_dummy, 0),
 			   SPI_MEM_OP_DATA_IN(len, buf, 0));
 	bool usebouncebuf;
 	ssize_t nbytes;
@@ -213,11 +210,6 @@ static ssize_t spi_nor_spimem_read_data(struct spi_nor *nor, loff_t from,
 
 	spi_nor_spimem_setup_op(nor, &op, nor->read_proto);
 
-	/* convert the dummy cycles to the number of bytes */
-	op.dummy.nbytes = (nor->read_dummy * op.dummy.buswidth) / 8;
-	if (spi_nor_protocol_is_dtr(nor->read_proto))
-		op.dummy.nbytes *= 2;
-
 	usebouncebuf = spi_nor_spimem_bounce(nor, &op);
 
 	if (nor->dirmap.rdesc) {
@@ -418,22 +410,23 @@ int spi_nor_write_disable(struct spi_nor *nor)
  * @nor:	pointer to 'struct spi_nor'.
  * @naddr:	number of address bytes to send. Can be zero if the operation
  *		does not need to send an address.
- * @ndummy:	number of dummy bytes to send after an opcode or address. Can
- *		be zero if the operation does not require dummy bytes.
+ * @ncycles:	number of dummy clock cycles to insert after an opcode or
+ *		address. Can be zero if the operation does not require dummy
+ *		cycles.
  * @id:		pointer to a DMA-able buffer where the value of the JEDEC ID
  *		will be written.
  * @proto:	the SPI protocol for register operation.
  *
  * Return: 0 on success, -errno otherwise.
  */
-int spi_nor_read_id(struct spi_nor *nor, u8 naddr, u8 ndummy, u8 *id,
+int spi_nor_read_id(struct spi_nor *nor, u8 naddr, u8 ncycles, u8 *id,
 		    enum spi_nor_protocol proto)
 {
 	int ret;
 
 	if (nor->spimem) {
 		struct spi_mem_op op =
-			SPI_NOR_READID_OP(naddr, ndummy, id, SPI_NOR_MAX_ID_LEN);
+			SPI_NOR_READID_OP(naddr, ncycles, id, SPI_NOR_MAX_ID_LEN);
 
 		spi_nor_spimem_setup_op(nor, &op, proto);
 		ret = spi_mem_exec_op(nor->spimem, &op);
@@ -741,7 +734,7 @@ int spi_nor_read_sr_ll(struct spi_nor *nor, u8 opcode, u8 *sr,
 
 		if (nor->reg_proto == SNOR_PROTO_8_8_8_DTR) {
 			op.addr.nbytes = nor->params->rdsr_addr_nbytes;
-			op.dummy.nbytes = nor->params->rdsr_dummy;
+			op.dummy.ncycles = nor->params->rdsr_dummy;
 			/*
 			 * We don't want to read only one byte in DTR mode. So,
 			 * read 2 and then discard the second byte.
@@ -2247,11 +2240,7 @@ static int spi_nor_spimem_check_readop(struct spi_nor *nor,
 
 	spi_nor_spimem_setup_op(nor, &op, read->proto);
 
-	/* convert the dummy cycles to the number of bytes */
-	op.dummy.nbytes = (read->num_mode_clocks + read->num_wait_states) *
-			  op.dummy.buswidth / 8;
-	if (spi_nor_protocol_is_dtr(read->proto))
-		op.dummy.nbytes *= 2;
+	op.dummy.ncycles = read->num_mode_clocks + read->num_wait_states;
 
 	return spi_nor_spimem_check_read_pp_op(nor, &op);
 }
@@ -3492,7 +3481,7 @@ static int spi_nor_create_read_dirmap(struct spi_nor *nor)
 		.op_tmpl = &info.primary_op_tmpl,
 		.primary_op_tmpl = SPI_MEM_OP(SPI_MEM_OP_CMD(nor->read_opcode, 0),
 					      SPI_MEM_OP_ADDR(nor->addr_nbytes, 0, 0),
-					      SPI_MEM_OP_DUMMY(nor->read_dummy, 0),
+					      SPI_MEM_OP_DUMMY_CYCLES(nor->read_dummy, 0),
 					      SPI_MEM_OP_DATA_IN(0, NULL, 0)),
 		.offset = 0,
 		.length = nor->params->size,
@@ -3501,11 +3490,6 @@ static int spi_nor_create_read_dirmap(struct spi_nor *nor)
 
 	spi_nor_spimem_setup_op(nor, op, nor->read_proto);
 
-	/* convert the dummy cycles to the number of bytes */
-	op->dummy.nbytes = (nor->read_dummy * op->dummy.buswidth) / 8;
-	if (spi_nor_protocol_is_dtr(nor->read_proto))
-		op->dummy.nbytes *= 2;
-
 	/*
 	 * Since spi_nor_spimem_setup_op() only sets buswidth when the number
 	 * of data bytes is non-zero, the data buswidth won't be set here. So,
diff --git a/drivers/mtd/spi-nor/core.h b/drivers/mtd/spi-nor/core.h
index 670182b3c2ad..11817280f650 100644
--- a/drivers/mtd/spi-nor/core.h
+++ b/drivers/mtd/spi-nor/core.h
@@ -19,10 +19,10 @@
 #define SPI_NOR_DEFAULT_SECTOR_SIZE SZ_64K
 
 /* Standard SPI NOR flash operations. */
-#define SPI_NOR_READID_OP(naddr, ndummy, buf, len)			\
+#define SPI_NOR_READID_OP(naddr, ncycles, buf, len)			\
 	SPI_MEM_OP(SPI_MEM_OP_CMD(SPINOR_OP_RDID, 0),			\
 		   SPI_MEM_OP_ADDR(naddr, 0, 0),			\
-		   SPI_MEM_OP_DUMMY(ndummy, 0),				\
+		   SPI_MEM_OP_DUMMY_CYCLES(ncycles, 0),			\
 		   SPI_MEM_OP_DATA_IN(len, buf, 0))
 
 #define SPI_NOR_WREN_OP							\
@@ -82,7 +82,7 @@
 #define SPI_NOR_READ_OP(opcode)						\
 	SPI_MEM_OP(SPI_MEM_OP_CMD(opcode, 0),				\
 		   SPI_MEM_OP_ADDR(3, 0, 0),				\
-		   SPI_MEM_OP_DUMMY(1, 0),				\
+		   SPI_MEM_OP_DUMMY_CYCLES(1, 0),			\
 		   SPI_MEM_OP_DATA_IN(2, NULL, 0))
 
 #define SPI_NOR_PP_OP(opcode)						\
@@ -652,7 +652,7 @@ int spi_nor_wait_till_ready(struct spi_nor *nor);
 int spi_nor_global_block_unlock(struct spi_nor *nor);
 int spi_nor_prep_and_lock(struct spi_nor *nor);
 void spi_nor_unlock_and_unprep(struct spi_nor *nor);
-int spi_nor_read_id(struct spi_nor *nor, u8 naddr, u8 ndummy, u8 *id,
+int spi_nor_read_id(struct spi_nor *nor, u8 naddr, u8 ncycles, u8 *id,
 		    enum spi_nor_protocol reg_proto);
 int spi_nor_sr_ready(struct spi_nor *nor);
 int spi_nor_read_sr_ll(struct spi_nor *nor, u8 opcode, u8 *sr,
diff --git a/drivers/mtd/spi-nor/micron-st.c b/drivers/mtd/spi-nor/micron-st.c
index f97f2dead8c2..34eb15c7d3b3 100644
--- a/drivers/mtd/spi-nor/micron-st.c
+++ b/drivers/mtd/spi-nor/micron-st.c
@@ -525,7 +525,7 @@ static int micron_st_nor_read_fsr(struct spi_nor *nor, u8 *fsr)
 
 		if (nor->reg_proto == SNOR_PROTO_8_8_8_DTR) {
 			op.addr.nbytes = nor->params->rdsr_addr_nbytes;
-			op.dummy.nbytes = nor->params->rdsr_dummy;
+			op.dummy.ncycles = nor->params->rdsr_dummy;
 			/*
 			 * We don't want to read only one byte in DTR mode. So,
 			 * read 2 and then discard the second byte.
diff --git a/drivers/mtd/spi-nor/spansion.c b/drivers/mtd/spi-nor/spansion.c
index b1b14ed0fd46..72cc11d3f1d3 100644
--- a/drivers/mtd/spi-nor/spansion.c
+++ b/drivers/mtd/spi-nor/spansion.c
@@ -53,10 +53,10 @@
 		   SPI_MEM_OP_NO_DUMMY,					\
 		   SPI_MEM_OP_DATA_OUT(ndata, buf, 0))
 
-#define CYPRESS_NOR_RD_ANY_REG_OP(naddr, addr, ndummy, buf)		\
+#define CYPRESS_NOR_RD_ANY_REG_OP(naddr, addr, ncycles, buf)		\
 	SPI_MEM_OP(SPI_MEM_OP_CMD(SPINOR_OP_RD_ANY_REG, 0),		\
 		   SPI_MEM_OP_ADDR(naddr, addr, 0),			\
-		   SPI_MEM_OP_DUMMY(ndummy, 0),				\
+		   SPI_MEM_OP_DUMMY_CYCLES(ncycles, 0),			\
 		   SPI_MEM_OP_DATA_IN(1, buf, 0))
 
 #define CYPRESS_NOR_EN4B_EX4B_OP(enable)				\
@@ -115,7 +115,7 @@ static int cypress_nor_sr_ready_and_clear_reg(struct spi_nor *nor, u64 addr)
 
 	if (nor->reg_proto == SNOR_PROTO_8_8_8_DTR) {
 		op.addr.nbytes = nor->addr_nbytes;
-		op.dummy.nbytes = params->rdsr_dummy;
+		op.dummy.ncycles = params->rdsr_dummy;
 		op.data.nbytes = 2;
 	}
 

-- 
2.56.0



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH RFC 00/16] spi: spi-mem: Express the dummy phase using cycles when relevant
  2026-11-25 17:51 [PATCH RFC 00/16] spi: spi-mem: Express the dummy phase using cycles when relevant Miquel Raynal
                   ` (15 preceding siblings ...)
  2026-11-25 17:51 ` [PATCH RFC 16/16] mtd: spi-nor: Express the dummy phase in cycles Miquel Raynal
@ 2026-11-26 11:09 ` Miquel Raynal
  16 siblings, 0 replies; 18+ messages in thread
From: Miquel Raynal @ 2026-11-26 11:09 UTC (permalink / raw)
  To: Mark Brown
  Cc: Liang Yang, Feng Chen, Xianwei Zhao, Han Xu, Conor Dooley,
	Valentina Fernandez, Daire McNamara, Haibo Chen, Jyan Chou,
	Yu-Chun Lin, Maxime Coquelin, Alexandre Torgue, Pratyush Yadav,
	Michael Walle, Takahiro Kuwano, Richard Weinberger,
	Vignesh Raghavendra, Thomas Petazzoni, Alvin Zhou, Cheng Ming Lin,
	linux-spi, linux-kernel, linux-amlogic, imx, linux-riscv,
	linux-stm32, linux-arm-kernel, linux-mtd


> Convert spi-mem, all the trivial spi-mem controller drivers and then
> SPI NOR to use dummy cycles instead of dummy bytes. SPI NAND may come
> later.
>
> This is only build tested for the moment and sent as an RFC because this
> topic has raised a lot of questions, there may be things I have
> forgotten about, so I would like all parties to agree on the direction
> before I commit into something cleaner. I bet Sashiko will also have
> interesting feedback to make...

I made several trivial issues in the controller's conversions which
triggered a lot of Sashiko answers expressing the feeling that the
patchset was not ready. The important part clearly are the spi-mem
changes, the modifications on top are almost independent follow-ups
showing why this may be useful. Nevertheless, I'm gonna address all
those issues and send a v2 with hopefully less obvious issues.

Thanks,
Miquèl


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2026-11-26 11:09 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-25 17:51 [PATCH RFC 00/16] spi: spi-mem: Express the dummy phase using cycles when relevant Miquel Raynal
2026-11-25 17:51 ` [PATCH RFC 01/16] spi: spi-mem: Handle a corner case while sanitizing ops Miquel Raynal
2026-11-25 17:51 ` [PATCH RFC 02/16] spi: spi-mem: Stop checking the dummy buswidth against board wiring Miquel Raynal
2026-11-25 17:51 ` [PATCH RFC 03/16] spi: spi-mem: Add support for dummy cycles Miquel Raynal
2026-11-25 17:51 ` [PATCH RFC 04/16] spi: amlogic-spifc-a1: Consume dummy cycles directly Miquel Raynal
2026-11-25 17:51 ` [PATCH RFC 05/16] spi: amlogic-spifc-a1: Fix a typo in a macro Miquel Raynal
2026-11-25 17:51 ` [PATCH RFC 06/16] spi: amlogic: spifc-a4: Consume dummy cycles directly Miquel Raynal
2026-11-25 17:51 ` [PATCH RFC 07/16] spi: cadence-qspi: " Miquel Raynal
2026-11-25 17:51 ` [PATCH RFC 08/16] spi: fsl-qspi: " Miquel Raynal
2026-11-25 17:51 ` [PATCH RFC 09/16] spi: microchip-core-qspi: " Miquel Raynal
2026-11-25 17:51 ` [PATCH RFC 10/16] spi: nxp-xspi: " Miquel Raynal
2026-11-25 17:51 ` [PATCH RFC 11/16] spi: nxp-xspi: Fix a comment Miquel Raynal
2026-11-25 17:51 ` [PATCH RFC 12/16] spi: rtk-nor: Consume dummy cycles directly Miquel Raynal
2026-11-25 17:51 ` [PATCH RFC 13/16] spi: sn-f-ospi: " Miquel Raynal
2026-11-25 17:51 ` [PATCH RFC 14/16] spi: stm32-ospi: " Miquel Raynal
2026-11-25 17:51 ` [PATCH RFC 15/16] spi: stm32-qspi: " Miquel Raynal
2026-11-25 17:51 ` [PATCH RFC 16/16] mtd: spi-nor: Express the dummy phase in cycles Miquel Raynal
2026-11-26 11:09 ` [PATCH RFC 00/16] spi: spi-mem: Express the dummy phase using cycles when relevant Miquel Raynal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox