* [PATCH 6.6 1/2] Revert "spi: cadence-quadspi: fix cleanup of rx_chan on failure paths"
@ 2025-09-03 7:58 jinfeng.wang.cn
2025-09-03 7:58 ` [PATCH 6.6 2/2] Revert "spi: spi-cadence-quadspi: Fix pm runtime unbalance" jinfeng.wang.cn
2025-09-03 8:22 ` [PATCH 6.6 1/2] Revert "spi: cadence-quadspi: fix cleanup of rx_chan on failure paths" Greg KH
0 siblings, 2 replies; 4+ messages in thread
From: jinfeng.wang.cn @ 2025-09-03 7:58 UTC (permalink / raw)
To: gregkh, d-gole, ronald.wahl
Cc: broonie, matthew.gerlach, khairul.anuar.romli, stable
From: Jinfeng Wang <jinfeng.wang.cn@windriver.com>
This reverts commit 1af6d1696ca40b2d22889b4b8bbea616f94aaa84.
There is cadence-qspi ff8d2000.spi: Unbalanced pm_runtime_enable! error
without this revert.
After reverting commit cdfb20e4b34a ("spi: spi-cadence-quadspi: Fix pm runtime unbalance")
and commit 1af6d1696ca4 ("spi: cadence-quadspi: fix cleanup of rx_chan on failure paths"),
Unbalanced pm_runtime_enable! error does not appear.
These two commits are backported from upstream commit b07f349d1864 ("spi: spi-cadence-quadspi: Fix pm runtime unbalance")
and commit 04a8ff1bc351 ("spi: cadence-quadspi: fix cleanup of rx_chan on failure paths").
The commit 04a8ff1bc351 ("spi: cadence-quadspi: fix cleanup of rx_chan on failure paths")
fix commit b07f349d1864 ("spi: spi-cadence-quadspi: Fix pm runtime unbalance").
The commit b07f349d1864 ("spi: spi-cadence-quadspi: Fix pm runtime unbalance") fix
commit 86401132d7bb ("spi: spi-cadence-quadspi: Fix missing unwind goto warnings").
The commit 86401132d7bb ("spi: spi-cadence-quadspi: Fix missing unwind goto warnings") fix
commit 0578a6dbfe75 ("spi: spi-cadence-quadspi: add runtime pm support").
6.6.y only backport commit b07f349d1864 ("spi: spi-cadence-quadspi: Fix pm runtime unbalance")
and commit 04a8ff1bc351 ("spi: cadence-quadspi: fix cleanup of rx_chan on failure paths"),
but does not backport commit 0578a6dbfe75 ("spi: spi-cadence-quadspi: add runtime pm support")
and commit 86401132d7bb ("spi: spi-cadence-quadspi: Fix missing unwind goto warnings").
And the backport of commit b07f349d1864 ("spi: spi-cadence-quadspi: Fix pm runtime unbalance")
differs with the original patch. So there is Unbalanced pm_runtime_enable error.
If revert the backport for commit b07f349d1864 ("spi: spi-cadence-quadspi: Fix pm runtime unbalance")
and commit 04a8ff1bc351 ("spi: cadence-quadspi: fix cleanup of rx_chan on failure paths"), there is no error.
If backport commit 0578a6dbfe75 ("spi: spi-cadence-quadspi: add runtime pm support") and
commit 86401132d7bb ("spi: spi-cadence-quadspi: Fix missing unwind goto warnings"), there
is hang during booting. I didn't find the cause of the hang.
Since commit 0578a6dbfe75 ("spi: spi-cadence-quadspi: add runtime pm support") and
commit 86401132d7bb ("spi: spi-cadence-quadspi: Fix missing unwind goto warnings") are
not backported, commit b07f349d1864 ("spi: spi-cadence-quadspi: Fix pm runtime unbalance")
and commit 04a8ff1bc351 ("spi: cadence-quadspi: fix cleanup of rx_chan on failure paths") are not needed.
So revert commits commit cdfb20e4b34a ("spi: spi-cadence-quadspi: Fix pm runtime unbalance") and
commit 1af6d1696ca4 ("spi: cadence-quadspi: fix cleanup of rx_chan on failure paths").
Signed-off-by: Jinfeng Wang <jinfeng.wang.cn@windriver.com>
Signed-off-by: He Zhe <zhe.he@windriver.com>
---
Kernel builds successfully with patch.
Test enviroment overview:
Branch linux-6.6.y
Tree: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Hardware: compiled on X86 machine
GCC: gcc version 11.4.0 (Ubuntu~20.04)
commands: make clean;make allyesconfig;
no building error is seen
gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04.2)
Hardware: compiled on socfpga stratix10 board
verified by check the dmesg log and bind/unbind spi
and no Unbalanced pm_runtime_enable! error is seen any more.
cmds:
dmesg | grep "Unbalanced pm_runtime_enable"
echo ff8d2000.spi > /sys/bus/platform/drivers/cadence-qspi/unbind
echo ff8d2000.spi > /sys/bus/platform/drivers/cadence-qspi/bind
---
drivers/spi/spi-cadence-quadspi.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
index 7c17b8c0425e..9285a683324f 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -1870,6 +1870,11 @@ static int cqspi_probe(struct platform_device *pdev)
pm_runtime_enable(dev);
+ if (cqspi->rx_chan) {
+ dma_release_channel(cqspi->rx_chan);
+ goto probe_setup_failed;
+ }
+
ret = spi_register_controller(host);
if (ret) {
dev_err(&pdev->dev, "failed to register SPI ctlr %d\n", ret);
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 6.6 2/2] Revert "spi: spi-cadence-quadspi: Fix pm runtime unbalance"
2025-09-03 7:58 [PATCH 6.6 1/2] Revert "spi: cadence-quadspi: fix cleanup of rx_chan on failure paths" jinfeng.wang.cn
@ 2025-09-03 7:58 ` jinfeng.wang.cn
2025-09-03 8:22 ` [PATCH 6.6 1/2] Revert "spi: cadence-quadspi: fix cleanup of rx_chan on failure paths" Greg KH
1 sibling, 0 replies; 4+ messages in thread
From: jinfeng.wang.cn @ 2025-09-03 7:58 UTC (permalink / raw)
To: gregkh, d-gole, ronald.wahl
Cc: broonie, matthew.gerlach, khairul.anuar.romli, stable
From: Jinfeng Wang <jinfeng.wang.cn@windriver.com>
This reverts commit cdfb20e4b34ad99b3fe122aafb4f8ee7b9856e1f.
There is cadence-qspi ff8d2000.spi: Unbalanced pm_runtime_enable! error
without this revert.
After reverting commit cdfb20e4b34a ("spi: spi-cadence-quadspi: Fix pm runtime unbalance")
and commit 1af6d1696ca4 ("spi: cadence-quadspi: fix cleanup of rx_chan on failure paths"),
Unbalanced pm_runtime_enable! error does not appear.
These two commits are backported from upstream commit b07f349d1864 ("spi: spi-cadence-quadspi: Fix pm runtime unbalance")
and commit 04a8ff1bc351 ("spi: cadence-quadspi: fix cleanup of rx_chan on failure paths").
The commit 04a8ff1bc351 ("spi: cadence-quadspi: fix cleanup of rx_chan on failure paths")
fix commit b07f349d1864 ("spi: spi-cadence-quadspi: Fix pm runtime unbalance").
The commit b07f349d1864 ("spi: spi-cadence-quadspi: Fix pm runtime unbalance") fix
commit 86401132d7bb ("spi: spi-cadence-quadspi: Fix missing unwind goto warnings").
The commit 86401132d7bb ("spi: spi-cadence-quadspi: Fix missing unwind goto warnings") fix
commit 0578a6dbfe75 ("spi: spi-cadence-quadspi: add runtime pm support").
6.6.y only backport commit b07f349d1864 ("spi: spi-cadence-quadspi: Fix pm runtime unbalance")
and commit 04a8ff1bc351 ("spi: cadence-quadspi: fix cleanup of rx_chan on failure paths"),
but does not backport commit 0578a6dbfe75 ("spi: spi-cadence-quadspi: add runtime pm support")
and commit 86401132d7bb ("spi: spi-cadence-quadspi: Fix missing unwind goto warnings").
And the backport of commit b07f349d1864 ("spi: spi-cadence-quadspi: Fix pm runtime unbalance")
differs with the original patch. So there is Unbalanced pm_runtime_enable error.
If revert the backport for commit b07f349d1864 ("spi: spi-cadence-quadspi: Fix pm runtime unbalance")
and commit 04a8ff1bc351 ("spi: cadence-quadspi: fix cleanup of rx_chan on failure paths"), there is no error.
If backport commit 0578a6dbfe75 ("spi: spi-cadence-quadspi: add runtime pm support") and
commit 86401132d7bb ("spi: spi-cadence-quadspi: Fix missing unwind goto warnings"), there
is hang during booting. I didn't find the cause of the hang.
Since commit 0578a6dbfe75 ("spi: spi-cadence-quadspi: add runtime pm support") and
commit 86401132d7bb ("spi: spi-cadence-quadspi: Fix missing unwind goto warnings") are
not backported, commit b07f349d1864 ("spi: spi-cadence-quadspi: Fix pm runtime unbalance")
and commit 04a8ff1bc351 ("spi: cadence-quadspi: fix cleanup of rx_chan on failure paths") are not needed.
So revert commits commit cdfb20e4b34a ("spi: spi-cadence-quadspi: Fix pm runtime unbalance") and
commit 1af6d1696ca4 ("spi: cadence-quadspi: fix cleanup of rx_chan on failure paths").
Signed-off-by: Jinfeng Wang <jinfeng.wang.cn@windriver.com>
Signed-off-by: He Zhe <zhe.he@windriver.com>
---
Kernel builds successfully with patch.
Test enviroment overview:
Branch linux-6.6.y
Tree: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Hardware: compiled on X86 machine
GCC: gcc version 11.4.0 (Ubuntu~20.04)
commands: make clean;make allyesconfig;
no building error is seen
gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04.2)
Hardware: compiled on socfpga stratix10 board
verified by check the dmesg log and bind/unbind spi
and no Unbalanced pm_runtime_enable! error is seen any more.
cmds:
dmesg | grep "Unbalanced pm_runtime_enable"
echo ff8d2000.spi > /sys/bus/platform/drivers/cadence-qspi/unbind
echo ff8d2000.spi > /sys/bus/platform/drivers/cadence-qspi/bind
---
drivers/spi/spi-cadence-quadspi.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
index 9285a683324f..bf9b816637d0 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -1868,13 +1868,6 @@ static int cqspi_probe(struct platform_device *pdev)
goto probe_setup_failed;
}
- pm_runtime_enable(dev);
-
- if (cqspi->rx_chan) {
- dma_release_channel(cqspi->rx_chan);
- goto probe_setup_failed;
- }
-
ret = spi_register_controller(host);
if (ret) {
dev_err(&pdev->dev, "failed to register SPI ctlr %d\n", ret);
@@ -1884,7 +1877,6 @@ static int cqspi_probe(struct platform_device *pdev)
return 0;
probe_setup_failed:
cqspi_controller_enable(cqspi, 0);
- pm_runtime_disable(dev);
probe_reset_failed:
if (cqspi->is_jh7110)
cqspi_jh7110_disable_clk(pdev, cqspi);
@@ -1906,8 +1898,7 @@ static void cqspi_remove(struct platform_device *pdev)
if (cqspi->rx_chan)
dma_release_channel(cqspi->rx_chan);
- if (pm_runtime_get_sync(&pdev->dev) >= 0)
- clk_disable(cqspi->clk);
+ clk_disable_unprepare(cqspi->clk);
if (cqspi->is_jh7110)
cqspi_jh7110_disable_clk(pdev, cqspi);
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 6.6 1/2] Revert "spi: cadence-quadspi: fix cleanup of rx_chan on failure paths"
2025-09-03 7:58 [PATCH 6.6 1/2] Revert "spi: cadence-quadspi: fix cleanup of rx_chan on failure paths" jinfeng.wang.cn
2025-09-03 7:58 ` [PATCH 6.6 2/2] Revert "spi: spi-cadence-quadspi: Fix pm runtime unbalance" jinfeng.wang.cn
@ 2025-09-03 8:22 ` Greg KH
2025-09-04 6:54 ` Jinfeng Wang
1 sibling, 1 reply; 4+ messages in thread
From: Greg KH @ 2025-09-03 8:22 UTC (permalink / raw)
To: jinfeng.wang.cn
Cc: d-gole, ronald.wahl, broonie, matthew.gerlach,
khairul.anuar.romli, stable
On Wed, Sep 03, 2025 at 03:58:14PM +0800, jinfeng.wang.cn@windriver.com wrote:
> From: Jinfeng Wang <jinfeng.wang.cn@windriver.com>
>
> This reverts commit 1af6d1696ca40b2d22889b4b8bbea616f94aaa84.
What is the upstream commit id for this?
> There is cadence-qspi ff8d2000.spi: Unbalanced pm_runtime_enable! error
> without this revert.
>
> After reverting commit cdfb20e4b34a ("spi: spi-cadence-quadspi: Fix pm runtime unbalance")
> and commit 1af6d1696ca4 ("spi: cadence-quadspi: fix cleanup of rx_chan on failure paths"),
> Unbalanced pm_runtime_enable! error does not appear.
>
> These two commits are backported from upstream commit b07f349d1864 ("spi: spi-cadence-quadspi: Fix pm runtime unbalance")
> and commit 04a8ff1bc351 ("spi: cadence-quadspi: fix cleanup of rx_chan on failure paths").
>
> The commit 04a8ff1bc351 ("spi: cadence-quadspi: fix cleanup of rx_chan on failure paths")
> fix commit b07f349d1864 ("spi: spi-cadence-quadspi: Fix pm runtime unbalance").
>
> The commit b07f349d1864 ("spi: spi-cadence-quadspi: Fix pm runtime unbalance") fix
> commit 86401132d7bb ("spi: spi-cadence-quadspi: Fix missing unwind goto warnings").
>
> The commit 86401132d7bb ("spi: spi-cadence-quadspi: Fix missing unwind goto warnings") fix
> commit 0578a6dbfe75 ("spi: spi-cadence-quadspi: add runtime pm support").
I am sorry, but I can not parse any of this.
> 6.6.y only backport commit b07f349d1864 ("spi: spi-cadence-quadspi: Fix pm runtime unbalance")
> and commit 04a8ff1bc351 ("spi: cadence-quadspi: fix cleanup of rx_chan on failure paths"),
> but does not backport commit 0578a6dbfe75 ("spi: spi-cadence-quadspi: add runtime pm support")
> and commit 86401132d7bb ("spi: spi-cadence-quadspi: Fix missing unwind goto warnings").
> And the backport of commit b07f349d1864 ("spi: spi-cadence-quadspi: Fix pm runtime unbalance")
> differs with the original patch. So there is Unbalanced pm_runtime_enable error.
>
> If revert the backport for commit b07f349d1864 ("spi: spi-cadence-quadspi: Fix pm runtime unbalance")
> and commit 04a8ff1bc351 ("spi: cadence-quadspi: fix cleanup of rx_chan on failure paths"), there is no error.
> If backport commit 0578a6dbfe75 ("spi: spi-cadence-quadspi: add runtime pm support") and
> commit 86401132d7bb ("spi: spi-cadence-quadspi: Fix missing unwind goto warnings"), there
> is hang during booting. I didn't find the cause of the hang.
Is this hang also in newer kernels? Why is this only an issue in older
kernels?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 6.6 1/2] Revert "spi: cadence-quadspi: fix cleanup of rx_chan on failure paths"
2025-09-03 8:22 ` [PATCH 6.6 1/2] Revert "spi: cadence-quadspi: fix cleanup of rx_chan on failure paths" Greg KH
@ 2025-09-04 6:54 ` Jinfeng Wang
0 siblings, 0 replies; 4+ messages in thread
From: Jinfeng Wang @ 2025-09-04 6:54 UTC (permalink / raw)
To: Greg KH
Cc: d-gole, ronald.wahl, broonie, matthew.gerlach,
khairul.anuar.romli, stable
On 9/3/25 16:22, Greg KH wrote:
> CAUTION: This email comes from a non Wind River email account!
> Do not click links or open attachments unless you recognize the sender and know the content is safe.
>
> On Wed, Sep 03, 2025 at 03:58:14PM +0800, jinfeng.wang.cn@windriver.com wrote:
>> From: Jinfeng Wang <jinfeng.wang.cn@windriver.com>
>>
>> This reverts commit 1af6d1696ca40b2d22889b4b8bbea616f94aaa84.
> What is the upstream commit id for this?
I'm sorry, I didn't describe this clearly. Let me try to summarize and
clarify the issue:
### Background on the Commits and Dependencies:
- **Upstream Commit Chain**:
- Original feature: 0578a6dbfe75 ("spi: spi-cadence-quadspi: add
runtime pm support") – Introduces runtime power management support.
- Fix 1: 86401132d7bb ("spi: spi-cadence-quadspi: Fix missing unwind
goto warnings") – Fix unwind issue introduced by the previous commit.
- Fix 2: b07f349d1864 ("spi: spi-cadence-quadspi: Fix pm runtime
unbalance") – Fix unbalance issue introduced by the previous
two commits.
- Fix 3: 04a8ff1bc351 ("spi: cadence-quadspi: fix cleanup of rx_chan
on failure paths") – Fix cleanup issue introduced by previous commit.
- **Backports to 6.6.y Stable Branch**:
- Only the later fixes (Fix 2 and Fix 3) were backported:
- b07f349d1864 as cdfb20e4b34a ("spi: spi-cadence-quadspi: Fix pm
runtime unbalance") – Note: This backport differs from the upstream commit.
- 04a8ff1bc351 as 1af6d1696ca4 ("spi: cadence-quadspi: fix cleanup
of rx_chan on failure paths").
- The foundational commits (0578a6dbfe75 and 86401132d7bb) were
**not** backported to 6.6.y.
### The Problem:
- Without reverting these backports, we see the error: "cadence-qspi
ff8d2000.spi: Unbalanced pm_runtime_enable!" on 6.6.y.
- This error occurs because:
- The backported fixes (especially cdfb20e4b34a) assume the presence
of the earlier commits (0578a6dbfe75 and 86401132d7bb), which isn't in
6.6.y.
### Proposed Solutions and Testing:
- **Option 1: Revert the Backports** (this patch):
- Revert cdfb20e4b34a and 1af6d1696ca4.
- Result: The "unbalanced pm_runtime_enable" error disappears, and
the system works without issues.
- **Option 2: Backport the Foundational Commits**:
- First revert cdfb20e4b34a and 1af6d1696ca4. Then backport the
original feature and Fix 1, Fix 2, Fix 3, and 959043afe53a to avoid boot
hang.(I just identified the cause of boot hang. The commit 959043afe53a
is key to preventing the hang)
- Result: The "unbalanced pm_runtime_enable" error does not appear.
The newer kernels have all these commits including 959043afe53a, so
there is no boot hang issue in newer kernels.
I think Option 1 is simple and easy to fix "Unbalanced
pm_runtime_enable!" error. My patches are Option 1. If you have any
objections, please let me know.
Thanks.
Jinfeng
>
>> There is cadence-qspi ff8d2000.spi: Unbalanced pm_runtime_enable! error
>> without this revert.
>>
>> After reverting commit cdfb20e4b34a ("spi: spi-cadence-quadspi: Fix pm runtime unbalance")
>> and commit 1af6d1696ca4 ("spi: cadence-quadspi: fix cleanup of rx_chan on failure paths"),
>> Unbalanced pm_runtime_enable! error does not appear.
>>
>> These two commits are backported from upstream commit b07f349d1864 ("spi: spi-cadence-quadspi: Fix pm runtime unbalance")
>> and commit 04a8ff1bc351 ("spi: cadence-quadspi: fix cleanup of rx_chan on failure paths").
>>
>> The commit 04a8ff1bc351 ("spi: cadence-quadspi: fix cleanup of rx_chan on failure paths")
>> fix commit b07f349d1864 ("spi: spi-cadence-quadspi: Fix pm runtime unbalance").
>>
>> The commit b07f349d1864 ("spi: spi-cadence-quadspi: Fix pm runtime unbalance") fix
>> commit 86401132d7bb ("spi: spi-cadence-quadspi: Fix missing unwind goto warnings").
>>
>> The commit 86401132d7bb ("spi: spi-cadence-quadspi: Fix missing unwind goto warnings") fix
>> commit 0578a6dbfe75 ("spi: spi-cadence-quadspi: add runtime pm support").
> I am sorry, but I can not parse any of this.
>
>> 6.6.y only backport commit b07f349d1864 ("spi: spi-cadence-quadspi: Fix pm runtime unbalance")
>> and commit 04a8ff1bc351 ("spi: cadence-quadspi: fix cleanup of rx_chan on failure paths"),
>> but does not backport commit 0578a6dbfe75 ("spi: spi-cadence-quadspi: add runtime pm support")
>> and commit 86401132d7bb ("spi: spi-cadence-quadspi: Fix missing unwind goto warnings").
>> And the backport of commit b07f349d1864 ("spi: spi-cadence-quadspi: Fix pm runtime unbalance")
>> differs with the original patch. So there is Unbalanced pm_runtime_enable error.
>>
>> If revert the backport for commit b07f349d1864 ("spi: spi-cadence-quadspi: Fix pm runtime unbalance")
>> and commit 04a8ff1bc351 ("spi: cadence-quadspi: fix cleanup of rx_chan on failure paths"), there is no error.
>> If backport commit 0578a6dbfe75 ("spi: spi-cadence-quadspi: add runtime pm support") and
>> commit 86401132d7bb ("spi: spi-cadence-quadspi: Fix missing unwind goto warnings"), there
>> is hang during booting. I didn't find the cause of the hang.
> Is this hang also in newer kernels? Why is this only an issue in older
> kernels?
>
> thanks,
>
> greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-09-04 6:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-03 7:58 [PATCH 6.6 1/2] Revert "spi: cadence-quadspi: fix cleanup of rx_chan on failure paths" jinfeng.wang.cn
2025-09-03 7:58 ` [PATCH 6.6 2/2] Revert "spi: spi-cadence-quadspi: Fix pm runtime unbalance" jinfeng.wang.cn
2025-09-03 8:22 ` [PATCH 6.6 1/2] Revert "spi: cadence-quadspi: fix cleanup of rx_chan on failure paths" Greg KH
2025-09-04 6:54 ` Jinfeng Wang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.