Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

spi: cadence-quadspi: fix runtime pm disable imbalance on probe failure

A recent attempt to fix the probe error handling introduced a runtime PM
disable depth imbalance by incorrectly disabling runtime PM on early
failures (e.g. probe deferral).

Fixes: f18c8cfa4f1a ("spi: cadence-qspi: Fix probe error path and remove")
Cc: stable@vger.kernel.org # 7.0
Cc: Miquel Raynal (Schneider Electric) <miquel.raynal@bootlin.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20260421125354.1534871-2-johan@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Johan Hovold and committed by
Mark Brown
5ff4d5d1 922f8c28

+5 -6
+5 -6
drivers/spi/spi-cadence-quadspi.c
··· 1867 1867 ret = clk_bulk_prepare_enable(CLK_QSPI_NUM, cqspi->clks); 1868 1868 if (ret) { 1869 1869 dev_err(dev, "Cannot enable QSPI clocks.\n"); 1870 - goto disable_rpm; 1870 + return ret; 1871 1871 } 1872 1872 1873 1873 /* Obtain QSPI reset control */ ··· 1977 1977 ret = cqspi_request_mmap_dma(cqspi); 1978 1978 if (ret == -EPROBE_DEFER) { 1979 1979 dev_err_probe(&pdev->dev, ret, "Failed to request mmap DMA\n"); 1980 - goto disable_controller; 1980 + goto disable_rpm; 1981 1981 } 1982 1982 } 1983 1983 ··· 1995 1995 release_dma_chan: 1996 1996 if (cqspi->rx_chan) 1997 1997 dma_release_channel(cqspi->rx_chan); 1998 - disable_controller: 1998 + disable_rpm: 1999 + if (!(ddata && (ddata->quirks & CQSPI_DISABLE_RUNTIME_PM))) 2000 + pm_runtime_disable(dev); 1999 2001 cqspi_controller_enable(cqspi, 0); 2000 2002 disable_clks: 2001 2003 if (pm_runtime_get_sync(&pdev->dev) >= 0) 2002 2004 clk_bulk_disable_unprepare(CLK_QSPI_NUM, cqspi->clks); 2003 - disable_rpm: 2004 - if (!(ddata && (ddata->quirks & CQSPI_DISABLE_RUNTIME_PM))) 2005 - pm_runtime_disable(dev); 2006 2005 2007 2006 return ret; 2008 2007 }