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: Probe and unbind fixes

Several fixes from Johan for probe failure and unbind issues in the
cadence-quadspi driver.

+18 -18
+18 -18
drivers/spi/spi-cadence-quadspi.c
··· 1860 1860 if (irq < 0) 1861 1861 return -ENXIO; 1862 1862 1863 - ret = pm_runtime_set_active(dev); 1864 - if (ret) 1865 - return ret; 1866 - 1867 1863 ret = clk_bulk_prepare_enable(CLK_QSPI_NUM, cqspi->clks); 1868 1864 if (ret) { 1869 1865 dev_err(dev, "Cannot enable QSPI clocks.\n"); 1870 - goto disable_rpm; 1866 + return ret; 1871 1867 } 1872 1868 1873 1869 /* Obtain QSPI reset control */ ··· 1958 1962 cqspi->sclk = 0; 1959 1963 1960 1964 if (!(ddata && (ddata->quirks & CQSPI_DISABLE_RUNTIME_PM))) { 1961 - pm_runtime_enable(dev); 1962 1965 pm_runtime_set_autosuspend_delay(dev, CQSPI_AUTOSUSPEND_TIMEOUT); 1963 1966 pm_runtime_use_autosuspend(dev); 1964 1967 pm_runtime_get_noresume(dev); 1968 + pm_runtime_set_active(dev); 1969 + pm_runtime_enable(dev); 1965 1970 } 1966 1971 1967 1972 host->num_chipselect = cqspi->num_chipselect; ··· 1974 1977 ret = cqspi_request_mmap_dma(cqspi); 1975 1978 if (ret == -EPROBE_DEFER) { 1976 1979 dev_err_probe(&pdev->dev, ret, "Failed to request mmap DMA\n"); 1977 - goto disable_controller; 1980 + goto disable_rpm; 1978 1981 } 1979 1982 } 1980 1983 ··· 1992 1995 release_dma_chan: 1993 1996 if (cqspi->rx_chan) 1994 1997 dma_release_channel(cqspi->rx_chan); 1995 - disable_controller: 1998 + disable_rpm: 1999 + if (!(ddata && (ddata->quirks & CQSPI_DISABLE_RUNTIME_PM))) { 2000 + pm_runtime_disable(dev); 2001 + pm_runtime_set_suspended(dev); 2002 + pm_runtime_put_noidle(dev); 2003 + pm_runtime_dont_use_autosuspend(dev); 2004 + } 1996 2005 cqspi_controller_enable(cqspi, 0); 1997 2006 disable_clks: 1998 - if (pm_runtime_get_sync(&pdev->dev) >= 0) 1999 - clk_bulk_disable_unprepare(CLK_QSPI_NUM, cqspi->clks); 2000 - disable_rpm: 2001 - if (!(ddata && (ddata->quirks & CQSPI_DISABLE_RUNTIME_PM))) 2002 - pm_runtime_disable(dev); 2007 + clk_bulk_disable_unprepare(CLK_QSPI_NUM, cqspi->clks); 2003 2008 2004 2009 return ret; 2005 2010 } ··· 2025 2026 if (cqspi->rx_chan) 2026 2027 dma_release_channel(cqspi->rx_chan); 2027 2028 2028 - cqspi_controller_enable(cqspi, 0); 2029 - 2030 - 2031 2029 if (!(ddata && (ddata->quirks & CQSPI_DISABLE_RUNTIME_PM))) 2032 2030 ret = pm_runtime_get_sync(&pdev->dev); 2033 2031 2034 - if (ret >= 0) 2032 + if (ret >= 0) { 2033 + cqspi_controller_enable(cqspi, 0); 2035 2034 clk_bulk_disable_unprepare(CLK_QSPI_NUM, cqspi->clks); 2035 + } 2036 2036 2037 2037 if (!(ddata && (ddata->quirks & CQSPI_DISABLE_RUNTIME_PM))) { 2038 - pm_runtime_put_sync(&pdev->dev); 2039 2038 pm_runtime_disable(&pdev->dev); 2039 + pm_runtime_set_suspended(&pdev->dev); 2040 + pm_runtime_put_noidle(&pdev->dev); 2041 + pm_runtime_dont_use_autosuspend(&pdev->dev); 2040 2042 } 2041 2043 } 2042 2044