All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bough Chen <haibo.chen@oss.nxp.com>
To: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: "Mark Brown" <broonie@kernel.org>,
	"Liang Yang" <liang.yang@amlogic.com>,
	"Feng Chen" <feng.chen@amlogic.com>,
	"Xianwei Zhao" <xianwei.zhao@amlogic.com>,
	"Han Xu" <han.xu@nxp.com>,
	"Conor Dooley" <conor.dooley@microchip.com>,
	"Valentina Fernandez" <valentina.fernandezalanis@microchip.com>,
	"Daire McNamara" <daire.mcnamara@microchip.com>,
	"Haibo Chen" <haibo.chen@nxp.com>,
	"Jyan Chou" <jyanchou@realtek.com>,
	"Yu-Chun Lin" <eleanor.lin@realtek.com>,
	"Maxime Coquelin" <mcoquelin.stm32@gmail.com>,
	"Alexandre Torgue" <alexandre.torgue@foss.st.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>,
	"Tudor Ambarus" <tudor.ambarus@linaro.org>,
	"Steven Rostedt" <rostedt@goodmis.org>,
	"Masami Hiramatsu" <mhiramat@kernel.org>,
	"Mathieu Desnoyers" <mathieu.desnoyers@efficios.com>,
	"Nicolas Ferre" <nicolas.ferre@microchip.com>,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	"Claudiu Beznea" <claudiu.beznea@tuxon.dev>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@collabora.com>,
	"Yogesh Gaur" <yogeshgaur.83@gmail.com>,
	"Chris Packham" <chris.packham@alliedtelesis.co.nz>,
	"Jonathan Neuschäfer" <j.neuschaefer@gmx.net>,
	"Michal Simek" <michal.simek@amd.com>,
	"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	"Alvin Zhou" <alvinzhou@mxic.com.tw>,
	"Cheng Ming Lin" <chengminglin@mxic.com.tw>,
	linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-amlogic@lists.infradead.org, imx@lists.linux.dev,
	linux-riscv@lists.infradead.org,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-mtd@lists.infradead.org,
	linux-trace-kernel@vger.kernel.org,
	linux-mediatek@lists.infradead.org, openbmc@lists.ozlabs.org
Subject: Re: [PATCH RFC v2 20/35] spi: nxp-xspi: Consume dummy cycles directly
Date: Mon, 30 Nov 2026 19:37:25 +0800	[thread overview]
Message-ID: <20261130113725.ocyjmnlwc3wdvfvo@shlinux89> (raw)
In-Reply-To: <20261127-macronix-upstreaming-spi-mem-cycles-v2-20-5c93f5e5d630@bootlin.com>

On Fri, Nov 27, 2026 at 03:22:42PM +0100, Miquel Raynal wrote:
> The controller programs the dummy phase in clock cycles, but the driver
> converts the legacy dummy byte count into cycles. Advertise the
> dummy_cycles capability and use op->dummy.ncycles directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>

Tested on imx943-evk board, no issue find.

Reviewed-and-Tested-by: Haibo Chen <haibo.chen@nxp.com>

Regards
Haibo Chen
> ---
>  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
> 

WARNING: multiple messages have this Message-ID (diff)
From: Bough Chen <haibo.chen@oss.nxp.com>
To: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: "Mark Brown" <broonie@kernel.org>,
	"Liang Yang" <liang.yang@amlogic.com>,
	"Feng Chen" <feng.chen@amlogic.com>,
	"Xianwei Zhao" <xianwei.zhao@amlogic.com>,
	"Han Xu" <han.xu@nxp.com>,
	"Conor Dooley" <conor.dooley@microchip.com>,
	"Valentina Fernandez" <valentina.fernandezalanis@microchip.com>,
	"Daire McNamara" <daire.mcnamara@microchip.com>,
	"Haibo Chen" <haibo.chen@nxp.com>,
	"Jyan Chou" <jyanchou@realtek.com>,
	"Yu-Chun Lin" <eleanor.lin@realtek.com>,
	"Maxime Coquelin" <mcoquelin.stm32@gmail.com>,
	"Alexandre Torgue" <alexandre.torgue@foss.st.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>,
	"Tudor Ambarus" <tudor.ambarus@linaro.org>,
	"Steven Rostedt" <rostedt@goodmis.org>,
	"Masami Hiramatsu" <mhiramat@kernel.org>,
	"Mathieu Desnoyers" <mathieu.desnoyers@efficios.com>,
	"Nicolas Ferre" <nicolas.ferre@microchip.com>,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	"Claudiu Beznea" <claudiu.beznea@tuxon.dev>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@collabora.com>,
	"Yogesh Gaur" <yogeshgaur.83@gmail.com>,
	"Chris Packham" <chris.packham@alliedtelesis.co.nz>,
	"Jonathan Neuschäfer" <j.neuschaefer@gmx.net>,
	"Michal Simek" <michal.simek@amd.com>,
	"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	"Alvin Zhou" <alvinzhou@mxic.com.tw>,
	"Cheng Ming Lin" <chengminglin@mxic.com.tw>,
	linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-amlogic@lists.infradead.org, imx@lists.linux.dev,
	linux-riscv@lists.infradead.org,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-mtd@lists.infradead.org,
	linux-trace-kernel@vger.kernel.org,
	linux-mediatek@lists.infradead.org, openbmc@lists.ozlabs.org
Subject: Re: [PATCH RFC v2 20/35] spi: nxp-xspi: Consume dummy cycles directly
Date: Mon, 30 Nov 2026 19:37:25 +0800	[thread overview]
Message-ID: <20261130113725.ocyjmnlwc3wdvfvo@shlinux89> (raw)
In-Reply-To: <20261127-macronix-upstreaming-spi-mem-cycles-v2-20-5c93f5e5d630@bootlin.com>

On Fri, Nov 27, 2026 at 03:22:42PM +0100, Miquel Raynal wrote:
> The controller programs the dummy phase in clock cycles, but the driver
> converts the legacy dummy byte count into cycles. Advertise the
> dummy_cycles capability and use op->dummy.ncycles directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>

Tested on imx943-evk board, no issue find.

Reviewed-and-Tested-by: Haibo Chen <haibo.chen@nxp.com>

Regards
Haibo Chen
> ---
>  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
> 

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

WARNING: multiple messages have this Message-ID (diff)
From: Bough Chen <haibo.chen@oss.nxp.com>
To: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: "Mark Brown" <broonie@kernel.org>,
	"Liang Yang" <liang.yang@amlogic.com>,
	"Feng Chen" <feng.chen@amlogic.com>,
	"Xianwei Zhao" <xianwei.zhao@amlogic.com>,
	"Han Xu" <han.xu@nxp.com>,
	"Conor Dooley" <conor.dooley@microchip.com>,
	"Valentina Fernandez" <valentina.fernandezalanis@microchip.com>,
	"Daire McNamara" <daire.mcnamara@microchip.com>,
	"Haibo Chen" <haibo.chen@nxp.com>,
	"Jyan Chou" <jyanchou@realtek.com>,
	"Yu-Chun Lin" <eleanor.lin@realtek.com>,
	"Maxime Coquelin" <mcoquelin.stm32@gmail.com>,
	"Alexandre Torgue" <alexandre.torgue@foss.st.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>,
	"Tudor Ambarus" <tudor.ambarus@linaro.org>,
	"Steven Rostedt" <rostedt@goodmis.org>,
	"Masami Hiramatsu" <mhiramat@kernel.org>,
	"Mathieu Desnoyers" <mathieu.desnoyers@efficios.com>,
	"Nicolas Ferre" <nicolas.ferre@microchip.com>,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	"Claudiu Beznea" <claudiu.beznea@tuxon.dev>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@collabora.com>,
	"Yogesh Gaur" <yogeshgaur.83@gmail.com>,
	"Chris Packham" <chris.packham@alliedtelesis.co.nz>,
	"Jonathan Neuschäfer" <j.neuschaefer@gmx.net>,
	"Michal Simek" <michal.simek@amd.com>,
	"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	"Alvin Zhou" <alvinzhou@mxic.com.tw>,
	"Cheng Ming Lin" <chengminglin@mxic.com.tw>,
	linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-amlogic@lists.infradead.org, imx@lists.linux.dev,
	linux-riscv@lists.infradead.org,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-mtd@lists.infradead.org,
	linux-trace-kernel@vger.kernel.org,
	linux-mediatek@lists.infradead.org, openbmc@lists.ozlabs.org
Subject: Re: [PATCH RFC v2 20/35] spi: nxp-xspi: Consume dummy cycles directly
Date: Mon, 30 Nov 2026 19:37:25 +0800	[thread overview]
Message-ID: <20261130113725.ocyjmnlwc3wdvfvo@shlinux89> (raw)
In-Reply-To: <20261127-macronix-upstreaming-spi-mem-cycles-v2-20-5c93f5e5d630@bootlin.com>

On Fri, Nov 27, 2026 at 03:22:42PM +0100, Miquel Raynal wrote:
> The controller programs the dummy phase in clock cycles, but the driver
> converts the legacy dummy byte count into cycles. Advertise the
> dummy_cycles capability and use op->dummy.ncycles directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>

Tested on imx943-evk board, no issue find.

Reviewed-and-Tested-by: Haibo Chen <haibo.chen@nxp.com>

Regards
Haibo Chen
> ---
>  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
> 

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

WARNING: multiple messages have this Message-ID (diff)
From: Bough Chen <haibo.chen@oss.nxp.com>
To: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: "Mark Brown" <broonie@kernel.org>,
	"Liang Yang" <liang.yang@amlogic.com>,
	"Feng Chen" <feng.chen@amlogic.com>,
	"Xianwei Zhao" <xianwei.zhao@amlogic.com>,
	"Han Xu" <han.xu@nxp.com>,
	"Conor Dooley" <conor.dooley@microchip.com>,
	"Valentina Fernandez" <valentina.fernandezalanis@microchip.com>,
	"Daire McNamara" <daire.mcnamara@microchip.com>,
	"Haibo Chen" <haibo.chen@nxp.com>,
	"Jyan Chou" <jyanchou@realtek.com>,
	"Yu-Chun Lin" <eleanor.lin@realtek.com>,
	"Maxime Coquelin" <mcoquelin.stm32@gmail.com>,
	"Alexandre Torgue" <alexandre.torgue@foss.st.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>,
	"Tudor Ambarus" <tudor.ambarus@linaro.org>,
	"Steven Rostedt" <rostedt@goodmis.org>,
	"Masami Hiramatsu" <mhiramat@kernel.org>,
	"Mathieu Desnoyers" <mathieu.desnoyers@efficios.com>,
	"Nicolas Ferre" <nicolas.ferre@microchip.com>,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	"Claudiu Beznea" <claudiu.beznea@tuxon.dev>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@collabora.com>,
	"Yogesh Gaur" <yogeshgaur.83@gmail.com>,
	"Chris Packham" <chris.packham@alliedtelesis.co.nz>,
	"Jonathan Neuschäfer" <j.neuschaefer@gmx.net>,
	"Michal Simek" <michal.simek@amd.com>,
	"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	"Alvin Zhou" <alvinzhou@mxic.com.tw>,
	"Cheng Ming Lin" <chengminglin@mxic.com.tw>,
	linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-amlogic@lists.infradead.org, imx@lists.linux.dev,
	linux-riscv@lists.infradead.org,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-mtd@lists.infradead.org,
	linux-trace-kernel@vger.kernel.org,
	linux-mediatek@lists.infradead.org, openbmc@lists.ozlabs.org
Subject: Re: [PATCH RFC v2 20/35] spi: nxp-xspi: Consume dummy cycles directly
Date: Mon, 30 Nov 2026 19:37:25 +0800	[thread overview]
Message-ID: <20261130113725.ocyjmnlwc3wdvfvo@shlinux89> (raw)
In-Reply-To: <20261127-macronix-upstreaming-spi-mem-cycles-v2-20-5c93f5e5d630@bootlin.com>

On Fri, Nov 27, 2026 at 03:22:42PM +0100, Miquel Raynal wrote:
> The controller programs the dummy phase in clock cycles, but the driver
> converts the legacy dummy byte count into cycles. Advertise the
> dummy_cycles capability and use op->dummy.ncycles directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>

Tested on imx943-evk board, no issue find.

Reviewed-and-Tested-by: Haibo Chen <haibo.chen@nxp.com>

Regards
Haibo Chen
> ---
>  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
> 

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  reply	other threads:[~2026-11-30 11:32 UTC|newest]

Thread overview: 240+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27 14:22 [PATCH RFC v2 00/35] spi: spi-mem: Express the dummy phase using cycles when relevant Miquel Raynal
2026-11-27 14:22 ` Miquel Raynal
2026-11-27 14:22 ` Miquel Raynal
2026-11-27 14:22 ` Miquel Raynal
2026-11-27 14:22 ` [PATCH RFC v2 01/35] spi: spi-mem: Stop checking the dummy buswidth against board wiring Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-30 10:12   ` Bough Chen
2026-11-30 10:12     ` Bough Chen
2026-11-30 10:12     ` Bough Chen
2026-11-30 10:12     ` Bough Chen
2026-11-27 14:22 ` [PATCH RFC v2 02/35] spi: spi-mem: Fix the odd byte count error message Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-30 10:13   ` Bough Chen
2026-11-30 10:13     ` Bough Chen
2026-11-30 10:13     ` Bough Chen
2026-11-30 10:13     ` Bough Chen
2026-11-27 14:22 ` [PATCH RFC v2 03/35] spi: spi-mem: Handle a corner case while sanitizing ops Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-30 10:25   ` Bough Chen
2026-11-30 10:25     ` Bough Chen
2026-11-30 10:25     ` Bough Chen
2026-11-30 10:25     ` Bough Chen
2026-11-27 14:22 ` [PATCH RFC v2 04/35] spi: spi-mem: Sanitize mixed DTR modes Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-30 10:30   ` Bough Chen
2026-11-30 10:30     ` Bough Chen
2026-11-30 10:30     ` Bough Chen
2026-11-30 10:30     ` Bough Chen
2026-11-30 10:57     ` Miquel Raynal
2026-11-30 10:57       ` Miquel Raynal
2026-11-30 10:57       ` Miquel Raynal
2026-11-30 10:57       ` Miquel Raynal
2026-11-27 14:22 ` [PATCH RFC v2 05/35] spi: spi-mem: Sanitize mixed buswidth Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-30 10:33   ` Bough Chen
2026-11-30 10:33     ` Bough Chen
2026-11-30 10:33     ` Bough Chen
2026-11-30 10:33     ` Bough Chen
2026-11-27 14:22 ` [PATCH RFC v2 06/35] spi: spi-mem: Add support for dummy cycles Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:43   ` sashiko-bot
2026-11-27 14:43     ` sashiko-bot
2026-11-27 14:43     ` sashiko-bot
2026-11-30 10:45     ` Bough Chen
2026-11-30 10:45       ` Bough Chen
2026-11-30 10:45       ` Bough Chen
2026-11-30 10:59   ` Bough Chen
2026-11-30 10:59     ` Bough Chen
2026-11-30 10:59     ` Bough Chen
2026-11-30 10:59     ` Bough Chen
2026-11-30 11:04   ` Bough Chen
2026-11-30 11:04     ` Bough Chen
2026-11-30 11:04     ` Bough Chen
2026-11-30 11:04     ` Bough Chen
2026-11-27 14:22 ` [PATCH RFC v2 07/35] spi: amlogic-spifc-a1: Consume dummy cycles directly Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22 ` [PATCH RFC v2 08/35] spi: amlogic-spifc-a1: Reject excessive dummy cycle counts Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22 ` [PATCH RFC v2 09/35] spi: amlogic-spifc-a4: Consume dummy cycles directly Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22 ` [PATCH RFC v2 10/35] spi: atmel-quadspi: " Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:41   ` sashiko-bot
2026-11-27 14:41     ` sashiko-bot
2026-11-27 14:41     ` sashiko-bot
2026-11-27 14:22 ` [PATCH RFC v2 11/35] spi: atmel-quadspi: Reject excessive dummy cycle counts Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:47   ` sashiko-bot
2026-11-27 14:47     ` sashiko-bot
2026-11-27 14:47     ` sashiko-bot
2026-11-27 14:22 ` [PATCH RFC v2 12/35] spi: cadence-qspi: Consume dummy cycles directly Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22 ` [PATCH RFC v2 13/35] spi: cadence-qspi: Drop redundant checks Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22 ` [PATCH RFC v2 14/35] spi: cadence-qspi: Drop now useless checks Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22 ` [PATCH RFC v2 15/35] spi: fsl-qspi: Consume dummy cycles directly Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-30 11:24   ` Bough Chen
2026-11-30 11:24     ` Bough Chen
2026-11-30 11:24     ` Bough Chen
2026-11-30 11:24     ` Bough Chen
2026-12-02 11:54     ` Miquel Raynal
2026-12-02 11:54       ` Miquel Raynal
2026-12-02 11:54       ` Miquel Raynal
2026-12-02 11:54       ` Miquel Raynal
2026-11-27 14:22 ` [PATCH RFC v2 16/35] spi: microchip-core-qspi: " Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22 ` [PATCH RFC v2 17/35] spi: mtk-snfi: Drop redundant check Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22 ` [PATCH RFC v2 18/35] spi: nxp-fspi: Consume dummy cycles directly Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:50   ` sashiko-bot
2026-11-27 14:50     ` sashiko-bot
2026-11-27 14:50     ` sashiko-bot
2026-11-30 11:31     ` Bough Chen
2026-11-30 11:31       ` Bough Chen
2026-11-30 11:31       ` Bough Chen
2026-12-02 11:57       ` Miquel Raynal
2026-12-02 11:57         ` Miquel Raynal
2026-12-02 11:57         ` Miquel Raynal
2026-11-27 14:22 ` [PATCH RFC v2 19/35] spi: nxp-fspi: Reject mixed DTR modes Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 15:00   ` sashiko-bot
2026-11-27 15:00     ` sashiko-bot
2026-11-27 15:00     ` sashiko-bot
2026-11-30 12:55     ` Bough Chen
2026-11-30 12:55       ` Bough Chen
2026-11-30 12:55       ` Bough Chen
2026-11-30 11:35   ` Bough Chen
2026-11-30 11:35     ` Bough Chen
2026-11-30 11:35     ` Bough Chen
2026-11-30 11:35     ` Bough Chen
2026-11-27 14:22 ` [PATCH RFC v2 20/35] spi: nxp-xspi: Consume dummy cycles directly Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-30 11:37   ` Bough Chen [this message]
2026-11-30 11:37     ` Bough Chen
2026-11-30 11:37     ` Bough Chen
2026-11-30 11:37     ` Bough Chen
2026-11-27 14:22 ` [PATCH RFC v2 21/35] spi: nxp-xspi: Fix a comment Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22 ` [PATCH RFC v2 22/35] spi: nxp-xspi: Reject mixed DTR modes Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:58   ` sashiko-bot
2026-11-27 14:58     ` sashiko-bot
2026-11-27 14:58     ` sashiko-bot
2026-11-30 13:20     ` Bough Chen
2026-11-30 13:20       ` Bough Chen
2026-11-30 13:20       ` Bough Chen
2026-12-02 12:05       ` Miquel Raynal
2026-12-02 12:05         ` Miquel Raynal
2026-12-02 12:05         ` Miquel Raynal
2026-11-27 14:22 ` [PATCH RFC v2 23/35] spi: realtek-rtl-snand: Drop redundant check Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-29 19:54   ` Chris Packham
2026-11-29 19:54     ` Chris Packham
2026-11-29 19:54     ` Chris Packham
2026-11-29 19:54     ` Chris Packham
2026-11-27 14:22 ` [PATCH RFC v2 24/35] spi: rpc-if: Consume dummy cycles directly Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22 ` [PATCH RFC v2 25/35] spi: rtk-nor: " Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22 ` [PATCH RFC v2 26/35] spi: rtk-nor: Drop redundant checks Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22 ` [PATCH RFC v2 27/35] spi: sn-f-ospi: Consume dummy cycles directly Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22 ` [PATCH RFC v2 28/35] spi: spi-qpic-snand: Drop redundant check Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22 ` [PATCH RFC v2 29/35] spi: stm32-ospi: Consume dummy cycles directly Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22 ` [PATCH RFC v2 30/35] spi: stm32-ospi: Reject excessive dummy cycle counts Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22 ` [PATCH RFC v2 31/35] spi: stm32-qspi: Consume dummy cycles directly Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22 ` [PATCH RFC v2 32/35] spi: stm32-qspi: Reject excessive dummy cycle counts Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22 ` [PATCH RFC v2 33/35] spi: wpcm-fiu: Drop redundant checks Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22 ` [PATCH RFC v2 34/35] spi: zynqmp-gqspi: Consume dummy cycles directly Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22 ` [PATCH RFC v2 35/35] mtd: spi-nor: Express the dummy phase in cycles Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-27 14:22   ` Miquel Raynal
2026-11-30 13:30   ` Bough Chen
2026-11-30 13:30     ` Bough Chen
2026-11-30 13:30     ` Bough Chen
2026-11-30 13:30     ` Bough Chen
2026-11-27 15:03 ` [PATCH RFC v2 00/35] spi: spi-mem: Express the dummy phase using cycles when relevant Mark Brown
2026-11-27 15:03   ` Mark Brown
2026-11-27 15:03   ` Mark Brown
2026-11-27 15:03   ` Mark Brown

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=20261130113725.ocyjmnlwc3wdvfvo@shlinux89 \
    --to=haibo.chen@oss.nxp.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=alvinzhou@mxic.com.tw \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=broonie@kernel.org \
    --cc=chengminglin@mxic.com.tw \
    --cc=chris.packham@alliedtelesis.co.nz \
    --cc=claudiu.beznea@tuxon.dev \
    --cc=conor.dooley@microchip.com \
    --cc=daire.mcnamara@microchip.com \
    --cc=eleanor.lin@realtek.com \
    --cc=feng.chen@amlogic.com \
    --cc=haibo.chen@nxp.com \
    --cc=han.xu@nxp.com \
    --cc=imx@lists.linux.dev \
    --cc=j.neuschaefer@gmx.net \
    --cc=jyanchou@realtek.com \
    --cc=liang.yang@amlogic.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=matthias.bgg@gmail.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=mhiramat@kernel.org \
    --cc=michal.simek@amd.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=mwalle@kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=openbmc@lists.ozlabs.org \
    --cc=pratyush@kernel.org \
    --cc=richard@nod.at \
    --cc=rostedt@goodmis.org \
    --cc=takahiro.kuwano@infineon.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=tudor.ambarus@linaro.org \
    --cc=valentina.fernandezalanis@microchip.com \
    --cc=vigneshr@ti.com \
    --cc=xianwei.zhao@amlogic.com \
    --cc=yogeshgaur.83@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.