| From 2b62c2c134fa32d9d3a9e7323c8ac74518eeb4ac Mon Sep 17 00:00:00 2001 |
| From: Can Peng <pengcan@kylinos.cn> |
| Date: Tue, 4 Aug 2026 15:18:31 +0800 |
| Subject: spi: bcm63xx: disable clock on resume failure |
| |
| From: Can Peng <pengcan@kylinos.cn> |
| |
| commit 2b62c2c134fa32d9d3a9e7323c8ac74518eeb4ac upstream. |
| |
| bcm63xx_spi_resume() enables the controller clock before restarting the |
| SPI controller queue. |
| |
| If spi_controller_resume() fails, the function currently reports success |
| and leaves the clock enabled. Propagate the error and disable the clock |
| before returning. |
| |
| Fixes: b42dfed83d95 ("spi: add Broadcom BCM63xx SPI controller driver") |
| Cc: stable@vger.kernel.org |
| Signed-off-by: Can Peng <pengcan@kylinos.cn> |
| Link: https://patch.msgid.link/20260804071831.860784-1-pengcan@kylinos.cn |
| Signed-off-by: Mark Brown <broonie@kernel.org> |
| Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| --- |
| drivers/spi/spi-bcm63xx.c | 6 +++++- |
| 1 file changed, 5 insertions(+), 1 deletion(-) |
| |
| --- a/drivers/spi/spi-bcm63xx.c |
| +++ b/drivers/spi/spi-bcm63xx.c |
| @@ -661,7 +661,11 @@ static int bcm63xx_spi_resume(struct dev |
| if (ret) |
| return ret; |
| |
| - spi_controller_resume(host); |
| + ret = spi_controller_resume(host); |
| + if (ret) { |
| + clk_disable_unprepare(bs->clk); |
| + return ret; |
| + } |
| |
| return 0; |
| } |