All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jisheng Zhang <jszhang@kernel.org>
To: Mark Brown <broonie@kernel.org>
Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] spi: dw: Fix missing smp_mb() in dw_spi_exec_mem_op
Date: Sat, 10 Oct 2026 23:15:29 +0800	[thread overview]
Message-ID: <20261010151529.30590-1-jszhang@kernel.org> (raw)

Similar as commit bfda044533b2 ("spi: dw: use "smp_mb()" to avoid
sending spi data error"), we also need the smp_mb() in
dw_spi_exec_mem_op() after setting up the members in "dws" to ensure
the data change is visible for all CPUs.

Fixes: 6423207e57ea ("spi: dw: Add memory operations support")
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 drivers/spi/spi-dw-core.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/spi/spi-dw-core.c b/drivers/spi/spi-dw-core.c
index 2d671e31413e..90af2cc9e17d 100644
--- a/drivers/spi/spi-dw-core.c
+++ b/drivers/spi/spi-dw-core.c
@@ -842,6 +842,9 @@ static int dw_spi_exec_mem_op(struct spi_mem *mem, const struct spi_mem_op *op)
 		cfg.tmode = DW_SPI_CTRLR0_TMOD_TO;
 	}
 
+	/* Ensure the data change in dw_spi_init_mem_buf() is visible for all CPUs */
+	smp_mb();
+
 	dw_spi_enable_chip(dws, 0);
 
 	dw_spi_update_config(dws, mem->spi, &cfg, NULL);
-- 
2.53.0


             reply	other threads:[~2026-10-10 15:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-10 15:15 Jisheng Zhang [this message]
2026-10-13 22:10 ` [PATCH] spi: dw: Fix missing smp_mb() in dw_spi_exec_mem_op Mark Brown
2026-10-14  4:15   ` Jisheng Zhang

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=20261010151529.30590-1-jszhang@kernel.org \
    --to=jszhang@kernel.org \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    /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.