[PATCH v4 7/7] spi: dt-bindings: cadence: Make XSPI's IRQ line optional
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Fri Oct 16 03:39:46 PDT 2026
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] spi: cadence-xspi: polling mode silently ignores SDMA errors
--
commit 457f64897c53f7e99d4fa7392dbbec63291a9a97
Author: Tanmay Jagdale <tanmay at marvell.com>
spi: dt-bindings: cadence: Make XSPI's IRQ line optional
This commit modifies the Cadence XSPI device tree bindings to make the
interrupts property optional. It indicates that the spi-cadence-xspi
driver functions in polling mode when an IRQ is not provided.
> spi: dt-bindings: cadence: Make XSPI's IRQ line optional
>
> The spi-cadence-xspi driver will happily work without an IRQ line
> registered, which means that this IRQ line is optional.
[Severity: High]
Does the driver actually work correctly without an IRQ line?
Looking at cdns_xspi_is_sdma_ready() in drivers/spi/spi-cadence-xspi.c,
the polling loop checks for the trigger bit but fails to check or clear the
SDMA error bit:
drivers/spi/spi-cadence-xspi.c:cdns_xspi_is_sdma_ready() {
...
if (cdns_readl_poll(cdns_xspi->iobase + CDNS_XSPI_INTR_STATUS_REG,
ctrl_stat, (ctrl_stat & CDNS_XSPI_SDMA_TRIGGER),
MRVL_XSPI_POLL_DELAY_US, MRVL_XSPI_POLL_TIMEOUT_US,
sleep)) {
return false;
}
...
}
If a hardware SDMA transaction error occurs while the device is in polling
mode, the error is ignored. This could cause the driver to blindly proceed
or unnecessarily time out, potentially resulting in silent data corruption
during flash I/O.
Should the polling logic handle CDNS_XSPI_SDMA_ERROR before making the
interrupts property optional?
>
> Signed-off-by: Tanmay Jagdale <tanmay at marvell.com>
> Co-developed-by: Paul Cercueil <paul.cercueil at bootlin.com>
> Signed-off-by: Paul Cercueil <paul.cercueil at bootlin.com>
>
> diff --git a/Documentation/devicetree/bindings/spi/cdns,xspi.yaml b/Documentation/devicetree/bindings/spi/cdns,xspi.yaml
> index 38a5795589de2..dd8d03c07e688 100644
> --- a/Documentation/devicetree/bindings/spi/cdns,xspi.yaml
> +++ b/Documentation/devicetree/bindings/spi/cdns,xspi.yaml
> @@ -43,7 +43,6 @@ properties:
> required:
> - compatible
> - reg
> - - interrupts
>
> allOf:
> - $ref: spi-controller.yaml#
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261016102917.171095-1-paul.cercueil@bootlin.com?part=7
More information about the linux-mtd
mailing list