Devicetree
 help / color / mirror / Atom feed
From: Paul Cercueil <paul.cercueil@bootlin.com>
To: Mark Brown <broonie@kernel.org>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>, Kees Cook <kees@kernel.org>,
	Tony Luck <tony.luck@intel.com>,
	"Guilherme G. Piccoli" <gpiccoli@igalia.com>
Cc: linux-spi@vger.kernel.org, devicetree@vger.kernel.org,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Sunil Kovvuri Goutham <sgoutham@marvell.com>,
	Tanmay Jagdale <tanmay@marvell.com>,
	Paul Cercueil <paul.cercueil@bootlin.com>
Subject: [PATCH v5 1/4] spi: cadence-xspi: Handle SDMA errors in cdns_xspi_is_sdma_ready()
Date: Wed,  2 Dec 2026 14:21:32 +0100	[thread overview]
Message-ID: <20261202132135.470814-2-paul.cercueil@bootlin.com> (raw)
In-Reply-To: <20261202132135.470814-1-paul.cercueil@bootlin.com>

From: Tanmay Jagdale <tanmay@marvell.com>

Handle SDMA transfer errors reported by the hardware in
cdns_xspi_is_dma_ready(). When a transfer error is found, just print an
error message and return false.

Signed-off-by: Tanmay Jagdale <tanmay@marvell.com>
Co-developed-by: Paul Cercueil <paul.cercueil@bootlin.com>
Signed-off-by: Paul Cercueil <paul.cercueil@bootlin.com>
---

Changelog:

v5: New patch
---
 drivers/spi/spi-cadence-xspi.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-cadence-xspi.c b/drivers/spi/spi-cadence-xspi.c
index a42fab719b7a..f5106df93355 100644
--- a/drivers/spi/spi-cadence-xspi.c
+++ b/drivers/spi/spi-cadence-xspi.c
@@ -1236,12 +1236,17 @@ static bool cdns_xspi_is_sdma_ready(struct cdns_xspi_dev *cdns_xspi, bool sleep)
 	if (readl_relaxed_poll_timeout
 	    (cdns_xspi->iobase + CDNS_XSPI_INTR_STATUS_REG,
 	     ctrl_stat,
-	     (ctrl_stat & CDNS_XSPI_SDMA_TRIGGER),
+	     ctrl_stat & (CDNS_XSPI_SDMA_TRIGGER | CDNS_XSPI_SDMA_ERROR),
 	     sleep ? MRVL_XSPI_POLL_DELAY_US : 0,
 	     sleep ? MRVL_XSPI_POLL_TIMEOUT_US : 0)) {
 		return false;
 	}
 
+	if (ctrl_stat & CDNS_XSPI_SDMA_ERROR) {
+		dev_err(cdns_xspi->dev, "Slave DMA transaction error\n");
+		return false;
+	}
+
 	/* Clear the flag */
 	writel(CDNS_XSPI_SDMA_TRIGGER,
 	       cdns_xspi->iobase + CDNS_XSPI_INTR_STATUS_REG);
-- 
2.47.3


  reply	other threads:[~2026-12-02 13:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02 13:21 [PATCH v5 0/4] spi: cadence-xspi: Add support for panic mem writes Paul Cercueil
2026-12-02 13:21 ` Paul Cercueil [this message]
2026-12-02 13:27   ` [PATCH v5 1/4] spi: cadence-xspi: Handle SDMA errors in cdns_xspi_is_sdma_ready() sashiko-bot
2026-12-02 13:21 ` [PATCH v5 2/4] spi: cadence-xspi: Add irq-less support Paul Cercueil
2026-12-02 13:21 ` [PATCH v5 3/4] spi: cadence-xspi: Add support for panic writes Paul Cercueil
2026-12-02 13:21 ` [PATCH v5 4/4] spi: dt-bindings: cadence: Make XSPI's IRQ line optional Paul Cercueil

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=20261202132135.470814-2-paul.cercueil@bootlin.com \
    --to=paul.cercueil@bootlin.com \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gpiccoli@igalia.com \
    --cc=kees@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sgoutham@marvell.com \
    --cc=tanmay@marvell.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=tony.luck@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox