Linux SPI subsystem development
 help / color / mirror / Atom feed
From: Jisheng Zhang <jszhang@kernel.org>
To: Mark Brown <broonie@kernel.org>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>
Cc: linux-spi@vger.kernel.org, devicetree@vger.kernel.org,
	"Nuno Sá" <nuno.sa@analog.com>, "Fei Xie" <fei.xie@horizon.auto>
Subject: [PATCH 3/3] spi: cadence-xspi: Use writel_relaxed() for cmd regs
Date: Sat,  7 Nov 2026 15:20:44 +0800	[thread overview]
Message-ID: <20261107072044.17574-4-jszhang@kernel.org> (raw)
In-Reply-To: <20261107072044.17574-1-jszhang@kernel.org>

Use writel_relaxed() for all command register writes except the last
one in cdns_xspi_trigger_command(). The ordering guarantees provided
by the final writel() ensure that all preceding writes are completed
before the command is triggered.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 drivers/spi/spi-cadence-xspi.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/spi/spi-cadence-xspi.c b/drivers/spi/spi-cadence-xspi.c
index d9996ec42edd..72852849ba27 100644
--- a/drivers/spi/spi-cadence-xspi.c
+++ b/drivers/spi/spi-cadence-xspi.c
@@ -494,11 +494,11 @@ static int cdns_xspi_wait_for_controller_idle(struct cdns_xspi_dev *cdns_xspi)
 static void cdns_xspi_trigger_command(struct cdns_xspi_dev *cdns_xspi,
 				      u32 cmd_regs[6])
 {
-	writel(cmd_regs[5], cdns_xspi->iobase + CDNS_XSPI_CMD_REG_5);
-	writel(cmd_regs[4], cdns_xspi->iobase + CDNS_XSPI_CMD_REG_4);
-	writel(cmd_regs[3], cdns_xspi->iobase + CDNS_XSPI_CMD_REG_3);
-	writel(cmd_regs[2], cdns_xspi->iobase + CDNS_XSPI_CMD_REG_2);
-	writel(cmd_regs[1], cdns_xspi->iobase + CDNS_XSPI_CMD_REG_1);
+	writel_relaxed(cmd_regs[5], cdns_xspi->iobase + CDNS_XSPI_CMD_REG_5);
+	writel_relaxed(cmd_regs[4], cdns_xspi->iobase + CDNS_XSPI_CMD_REG_4);
+	writel_relaxed(cmd_regs[3], cdns_xspi->iobase + CDNS_XSPI_CMD_REG_3);
+	writel_relaxed(cmd_regs[2], cdns_xspi->iobase + CDNS_XSPI_CMD_REG_2);
+	writel_relaxed(cmd_regs[1], cdns_xspi->iobase + CDNS_XSPI_CMD_REG_1);
 	writel(cmd_regs[0], cdns_xspi->iobase + CDNS_XSPI_CMD_REG_0);
 }
 
-- 
2.55.0


      parent reply	other threads:[~2026-11-07  7:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-07  7:20 [PATCH 0/3] spi: cadence-xspi: add DMA support Jisheng Zhang
2026-11-07  7:20 ` [PATCH 1/3] spi: dt-bindings: cdns,xspi: Add DMA properties Jisheng Zhang
2026-11-07  7:20 ` [PATCH 2/3] spi: cadence-xspi: Support dmaengine for sdma io copy Jisheng Zhang
2026-11-07  7:20 ` Jisheng Zhang [this message]

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=20261107072044.17574-4-jszhang@kernel.org \
    --to=jszhang@kernel.org \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=fei.xie@horizon.auto \
    --cc=krzk+dt@kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=robh@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox