[PATCH v17 3/6] spi: pxa2xx: acquire active PM runtime reference in interrupt handler
Mark Brown
broonie at kernel.org
Wed Sep 30 10:40:43 PDT 2026
On Thu, Oct 01, 2026 at 12:06:26AM +0800, Shih-Yuan Lee wrote:
> On a shared interrupt line, ssp_int() can be invoked while the SPI
> controller is suspended or transitioning power states. In ssp_int(),
> evaluating device power state without acquiring a reference before
> accessing MMIO registers is not atomic: another thread executing
> pm_runtime_suspend() can drop the last reference and gate the clock
> immediately after the check passes. Accessing unclocked registers then
> leads to PCIe Completion Timeouts and system hangs.
> @@ -1464,22 +1481,31 @@ int pxa2xx_spi_probe(struct device *dev, struct ssp_device *ssp,
> }
> }
>
> + ret = request_irq(ssp->irq, ssp_int, IRQF_SHARED, dev_name(dev),
> + drv_data);
> + if (ret < 0) {
> + ret = dev_err_probe(dev, ret, "cannot get IRQ %d\n", ssp->irq);
> + goto out_error_clock_enabled;
> + }
> +
> /* Register with the SPI framework */
> dev_set_drvdata(dev, drv_data);
We need the driver data before we request the interrupt, the interrupt
handler does runtime PM and the runtime PM operations use driver data.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20260930/8d520de0/attachment.sig>
More information about the linux-arm-kernel
mailing list