]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.17-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Dec 2025 13:34:15 +0000 (14:34 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Dec 2025 13:34:15 +0000 (14:34 +0100)
added patches:
spi-cadence-quadspi-fix-cqspi_probe-error-handling-for-runtime-pm.patch

queue-6.17/series
queue-6.17/spi-cadence-quadspi-fix-cqspi_probe-error-handling-for-runtime-pm.patch [new file with mode: 0644]

index 126d6ccbacd92621fe5b62c0bfaaa6742cb2ecd4..f45e5df56175a1b0973552185b81e2f1098fd5b1 100644 (file)
@@ -143,3 +143,4 @@ mm-swap-remove-duplicate-nr_swap_pages-decrement-in-get_swap_page_of_type.patch
 usb-udc-add-trace-event-for-usb_gadget_set_state.patch
 usb-gadget-udc-fix-use-after-free-in-usb_gadget_state_work.patch
 revert-acpi-suppress-misleading-spcr-console-message-when-spcr-table-is-absent.patch
+spi-cadence-quadspi-fix-cqspi_probe-error-handling-for-runtime-pm.patch
diff --git a/queue-6.17/spi-cadence-quadspi-fix-cqspi_probe-error-handling-for-runtime-pm.patch b/queue-6.17/spi-cadence-quadspi-fix-cqspi_probe-error-handling-for-runtime-pm.patch
new file mode 100644 (file)
index 0000000..4c40249
--- /dev/null
@@ -0,0 +1,71 @@
+From 295fe8406a357bc0abb901a21d1a554fd4dd1d05 Mon Sep 17 00:00:00 2001
+From: Siddharth Vadapalli <s-vadapalli@ti.com>
+Date: Wed, 19 Nov 2025 20:53:53 +0530
+Subject: spi: cadence-quadspi: Fix cqspi_probe() error handling for runtime pm
+
+From: Siddharth Vadapalli <s-vadapalli@ti.com>
+
+commit 295fe8406a357bc0abb901a21d1a554fd4dd1d05 upstream.
+
+Commit f1eb4e792bb1 ("spi: spi-cadence-quadspi: Enable pm runtime earlier
+to avoid imbalance") relocated code but missed updating the error handling
+path associated with it.
+
+Prior to the relocation, runtime pm was enabled after the code-block
+associated with 'cqspi_request_mmap_dma()', due to which, the error
+handling for the same didn't require invoking 'pm_runtime_disable()'.
+
+Post refactoring, runtime pm has been enabled before the code-block and
+when an error is encountered, jumping to 'probe_dma_failed' doesn't
+invoke 'pm_runtime_disable()'. This leads to a race condition wherein
+'cqspi_runtime_suspend()' is invoked while the error handling path executes
+in parallel. The resulting error is the following:
+
+  clk:103:0 already disabled
+  WARNING: drivers/clk/clk.c:1188 at clk_core_disable+0x80/0xa0, CPU#1: kworker/u8:0/12
+  [TRIMMED]
+  pstate: 600000c5 (nZCv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
+  pc : clk_core_disable+0x80/0xa0
+  lr : clk_core_disable+0x80/0xa0
+  [TRIMMED]
+  Call trace:
+   clk_core_disable+0x80/0xa0 (P)
+   clk_core_disable_lock+0x88/0x10c
+   clk_disable+0x24/0x30
+   cqspi_probe+0xa3c/0xae8
+  [TRIMMED]
+
+The error is due to the second invocation of 'clk_disable_unprepare()' on
+'cqspi->clk' in the error handling within 'cqspi_probe()', with the first
+invocation being within 'cqspi_runtime_suspend()'.
+
+Fix this by correcting the error handling.
+
+Fixes: f1eb4e792bb1 ("spi: spi-cadence-quadspi: Enable pm runtime earlier to avoid imbalance")
+Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
+Link: https://patch.msgid.link/20251119152545.2591651-1-s-vadapalli@ti.com
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/spi/spi-cadence-quadspi.c |    3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+--- a/drivers/spi/spi-cadence-quadspi.c
++++ b/drivers/spi/spi-cadence-quadspi.c
+@@ -2002,7 +2002,7 @@ static int cqspi_probe(struct platform_d
+       if (cqspi->use_direct_mode) {
+               ret = cqspi_request_mmap_dma(cqspi);
+               if (ret == -EPROBE_DEFER)
+-                      goto probe_dma_failed;
++                      goto probe_setup_failed;
+       }
+       ret = spi_register_controller(host);
+@@ -2020,7 +2020,6 @@ static int cqspi_probe(struct platform_d
+ probe_setup_failed:
+       if (!(ddata && (ddata->quirks & CQSPI_DISABLE_RUNTIME_PM)))
+               pm_runtime_disable(dev);
+-probe_dma_failed:
+       cqspi_controller_enable(cqspi, 0);
+ probe_reset_failed:
+       if (cqspi->is_jh7110)