Re: [PATCH v16 4/7] spi: pxa2xx: lock out runtime autosuspend for Intel LPSS SPI in PIO mode
From: Andy Shevchenko
Date: Mon Jul 20 2026 - 16:00:19 EST
On Tue, Jul 21, 2026 at 12:21:13AM +0800, Shih-Yuan Lee wrote:
> When operating in PIO mode on Intel LPSS SPI controllers, runtime PM
> autosuspend clock-gates the hardware block when idle. On subsequent
> transfers, MMIO accesses to trigger resume are performed before the runtime
> PM state machine can wake the controller, causing PCIe Completion Timeouts.
> This issue does not affect DMA mode, where the DMA engine holds the required
> resources, nor does it affect non-LPSS controllers.
>
> Lock out runtime PM autosuspend for LPSS SPI controllers specifically
> when operating in PIO mode.
>
> Acquire a runtime PM reference via pm_runtime_get_noresume() in
> pxa2xx_spi_probe() after registration, and release it via
> pm_runtime_put_noidle() in pxa2xx_spi_remove() before hardware teardown to
> ensure the runtime PM reference held in probe is released without invoking
> runtime_suspend on already-unclocked hardware.
.runtime_suspend()
// this is how we refer to the callbacks.
...
> + /* Release the PM reference held in probe for LPSS PIO mode before
> + * hardware teardown so the PM core does not invoke runtime_suspend
> + * on already-unclocked hardware.
> + */
/*
* Keep the comment style as per SPI and many other subsystems
* and as in this example.
*/
--
With Best Regards,
Andy Shevchenko