Re: [PATCH v17 3/6] spi: pxa2xx: acquire active PM runtime reference in interrupt handler

From: Mark Brown

Date: Wed Sep 30 2026 - 14:06:15 EST


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.

Attachment: signature.asc
Description: PGP signature