Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Paul Cercueil" <paul.cercueil@bootlin.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v5 1/4] spi: cadence-xspi: Handle SDMA errors in cdns_xspi_is_sdma_ready()
Date: Wed, 02 Dec 2026 13:27:54 +0000	[thread overview]
Message-ID: <sashiko-outbox-245877@kernel.org> (raw)
In-Reply-To: <20261202132135.470814-2-paul.cercueil@bootlin.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] spi: cadence-xspi: uncleared SDMA error bit in
  cdns_xspi_is_sdma_ready()
--

commit 122949242af56dfda1b41fa7001f1b06306596ab
Author: Tanmay Jagdale <tanmay@marvell.com>

spi: cadence-xspi: Handle SDMA errors in cdns_xspi_is_sdma_ready()

This commit updates cdns_xspi_is_sdma_ready() to poll for
CDNS_XSPI_SDMA_ERROR alongside CDNS_XSPI_SDMA_TRIGGER and return false
if an SDMA error bit is set.

> diff --git a/drivers/spi/spi-cadence-xspi.c b/drivers/spi/spi-cadence-xspi.c
> index a42fab719b7af..f5106df933552 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);

[Severity: Medium]
Should the error path clear CDNS_XSPI_SDMA_ERROR (and
CDNS_XSPI_SDMA_TRIGGER if also set) in CDNS_XSPI_INTR_STATUS_REG before
returning false?

CDNS_XSPI_INTR_STATUS_REG is write-1-to-clear, and polled callers such
as cdns_xspi_transfer_one_message_b0() run with interrupts disabled and
do not clear the status register on error unwind.  Leaving
CDNS_XSPI_SDMA_ERROR latched will cause subsequent calls to
cdns_xspi_is_sdma_ready() to immediately see the stale error bit and
fail.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261202132135.470814-1-paul.cercueil@bootlin.com?part=1

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

Thread overview: 8+ 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 ` [PATCH v5 1/4] spi: cadence-xspi: Handle SDMA errors in cdns_xspi_is_sdma_ready() Paul Cercueil
2026-12-02 13:27   ` sashiko-bot [this message]
2026-12-02 13:21 ` [PATCH v5 2/4] spi: cadence-xspi: Add irq-less support Paul Cercueil
2026-12-02 13:33   ` sashiko-bot
2026-12-02 13:21 ` [PATCH v5 3/4] spi: cadence-xspi: Add support for panic writes Paul Cercueil
2026-12-02 13:31   ` sashiko-bot
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=sashiko-outbox-245877@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=paul.cercueil@bootlin.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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