[PATCH RFC 02/16] spi: spi-mem: Stop checking the dummy buswidth against board wiring
Bough Chen
haibo.chen at oss.nxp.com
Fri Nov 27 00:53:59 PST 2026
On Wed, Nov 25, 2026 at 06:51:16PM +0100, Miquel Raynal wrote:
> 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 at kernel.org>
> Link: https://lore.kernel.org/linux-mtd/20241112075242.174010-1-linchengming884@gmail.com/T/#m7cc1a5055702f5a42a8f3949c968842d845914d7
> Signed-off-by: Miquel Raynal <miquel.raynal at 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.
> + */
>
Hi Miquel,
With this change, do you plan to add the linked patch back?
Setting the dummy buswidth to match the data buswidth is more reasonable.
Regards
Haibo Chen
> if (op->data.dir != SPI_MEM_NO_DATA &&
> spi_check_buswidth_req(mem, op->data.buswidth,
>
> --
> 2.56.0
>
More information about the linux-riscv
mailing list