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: fix clock imbalance on probe failure

Make sure that the controller is active before disabling clocks on probe
failure to avoid unbalanced clock disable.

Also drop the usage count before returning (so that the controller can
be suspended after a probe deferral) and restore the autosuspend
setting.

Fixes: d36ccd9f7ea4 ("spi: cadence: Runtime pm adaptation")
Cc: stable@vger.kernel.org # 4.7
Cc: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20260421123615.1533617-3-johan@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Johan Hovold and committed by
Mark Brown
ecea4f0e 5b1689a4

+5 -1
+5 -1
drivers/spi/spi-cadence.c
··· 741 741 /* Set to default valid value */ 742 742 ctlr->max_speed_hz = xspi->clk_rate / 4; 743 743 xspi->speed_hz = ctlr->max_speed_hz; 744 - pm_runtime_put_autosuspend(&pdev->dev); 745 744 } else { 746 745 ctlr->mode_bits |= SPI_NO_CS; 747 746 ctlr->target_abort = cdns_target_abort; ··· 751 752 goto clk_dis_all; 752 753 } 753 754 755 + if (!spi_controller_is_target(ctlr)) 756 + pm_runtime_put_autosuspend(&pdev->dev); 757 + 754 758 return ret; 755 759 756 760 clk_dis_all: 757 761 if (!spi_controller_is_target(ctlr)) { 758 762 pm_runtime_disable(&pdev->dev); 759 763 pm_runtime_set_suspended(&pdev->dev); 764 + pm_runtime_put_noidle(&pdev->dev); 765 + pm_runtime_dont_use_autosuspend(&pdev->dev); 760 766 } 761 767 remove_ctlr: 762 768 spi_controller_put(ctlr);