[PATCH v2 5/7] spi: cadence-xspi: Add irq-less support

Paul Cercueil paul.cercueil at bootlin.com
Tue Oct 13 08:40:12 PDT 2026


Hi Sashiko,

Le mardi 13 octobre 2026 à 14:33 +0000, sashiko-bot at kernel.org a écrit :
> Thank you for your contribution! Sashiko AI review found 4 potential issue(s)
> to consider:
> - [High] spi: cadence-xspi: 1ms polling timeout is too short for large STIG
> transfers
> - [High] spi: cadence-xspi: stale completion state after early abort or
> double-completion
> - [High] spi: cadence-xspi: missing SDMA error check in polling mode
> - [High] spi: cadence-xspi: spurious completions from uncleared polling status
> --
> 
> commit 16ebab91423ce939f852c48607b518f29634b538
> Author: Tanmay Jagdale <tanmay at marvell.com>
> 
> spi: cadence-xspi: Add irq-less support
> 
> Make the interrupt line optional. If not provided, the driver will
> instead resort to polling registers.
> 
> > diff --git a/drivers/spi/spi-cadence-xspi.c b/drivers/spi/spi-cadence-xspi.c
> > index 095bf640b379a..185dffda54bbd 100644
> > --- a/drivers/spi/spi-cadence-xspi.c
> > +++ b/drivers/spi/spi-cadence-xspi.c
> > @@ -365,6 +365,39 @@ static int cdns_xspi_wait_for_controller_idle(struct
> > cdns_xspi_dev *cdns_xspi)
> >  					  100, 1000);
> >  }
> >  
> > +static bool cdns_xspi_is_stig_ready(struct cdns_xspi_dev *cdns_xspi, bool
> > sleep)
> > +{
> > +	u32 ctrl_stat;
> > +
> > +	return !readl_relaxed_poll_timeout
> > +		(cdns_xspi->iobase + CDNS_XSPI_CTRL_STATUS_REG,
> > +		ctrl_stat,
> > +		((ctrl_stat & BIT(3)) == 0),
> > +		sleep ? MRVL_XSPI_POLL_DELAY_US : 0,
> > +		sleep ? MRVL_XSPI_POLL_TIMEOUT_US : 0);
> 
> [Severity: High]
> Does this polling loop leave the CDNS_XSPI_STIG_DONE bit uncleared in
> INTR_STATUS_REG?
> 
> If a shared IRQ fires later, cdns_xspi_irq_handler() will see the uncleared
> CDNS_XSPI_STIG_DONE bit and call complete(&cdns_xspi->cmd_complete). This can
> corrupt the completion counter and cause subsequent commands to prematurely
> return from wait_for_completion().

Whether or not this is true, it is irrelevant for this patchset, this code is
just being moved around the driver without changes.

Cheers,
-Paul



More information about the linux-mtd mailing list