Re: [PATCH] spi: cadence-quadspi: Fix pm_runtime unbalance on dma EPROBE_DEFER

From: Dan Carpenter
Date: Wed Oct 08 2025 - 11:50:58 EST


On Wed, Oct 08, 2025 at 03:38:39PM +0200, Mattijs Korpershoek wrote:
> In csqspi_probe(), when cqspi_request_mmap_dma() returns -EPROBE_DEFER,
> we handle the error by jumping to probe_setup_failed.
> In that label, we call pm_runtime_disable(), even if we never called
> pm_runtime_enable() before.
>
> Because of this, the driver cannot probe:
>
> [ 2.690018] cadence-qspi 47040000.spi: No Rx DMA available
> [ 2.699735] spi-nor spi0.0: resume failed with -13
> [ 2.699741] spi-nor: probe of spi0.0 failed with error -13
>
> Only call pm_runtime_disable() if it was enabled by adding a new
> label to handle cqspi_request_mmap_dma() failures.
>
> Fixes: 04a8ff1bc351 ("spi: cadence-quadspi: fix cleanup of rx_chan on failure paths")
> Signed-off-by: Mattijs Korpershoek <mkorpershoek@xxxxxxxxxx>
> ---
> This has been tested on a AM69 SK board.

The patch seems correct, but the correct Fixes tag is:
Fixes: b07f349d1864 ("spi: spi-cadence-quadspi: Fix pm runtime unbalance")

regards,
dan carpenter