There is an logic error in sdhci_esdhc_resume(), when the device
resume, the per clock and ipg clock will be disabled incorrectly.
And when execute STR with debug configs enabled, there will be
following warning calltrace:

        ------------[ cut here ]------------
        usdhc_core already disabled
        WARNING: CPU: 0 PID: 33 at drivers/clk/clk.c:952 
clk_core_disable+0xcc/0x2bc
        Modules linked in: 8021q llce_core sch_fq_codel openvswitch nsh 
nf_conncount nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 fuse
        CPU: 0 PID: 33 Comm: kworker/0:1 Not tainted 5.10.30-yocto-standard #1 
Hardware name: Freescale S32G274 (DT)
        Workqueue: pm pm_runtime_work
        pstate: 80000085 (Nzcv daIf -PAN -UAO -TCO BTYPE=--)
        PM: suspend exit
        pc : clk_core_disable+0xcc/0x2bc
        lr : clk_core_disable+0xcc/0x2bc
        sp : ffffffc012493ba0
        x29: ffffffc012493ba0 x28: 0000000000000000
        x27: ffffff88002fc1c8 x26: 00000000000f4240
        x25: ffffff88002b1b00 x24: ffffffc0100921a0
        x23: 0000000000000000 x22: ffffff88077dd300
        x21: ffffff88075768c0 x20: ffffff8800931e00
        x19: ffffff8800931e00 x18: 00000009a9b690f0
        x17: 0000000000000002 x16: 0000972d895d386c
        x15: 025bc5d43bdb73dc x14: ffffffc010c0bc90
        x13: 00000000000002c4 x12: fffffffffffc5f3f
        x11: ffffff88004a0ff8 x10: fffffffffffe0000
        x9 : ffffffc0100a41d0 x8 : 6165726c61206572
        x7 : 6f635f6368647375 x6 : 0000000000000000
        x5 : ffffff885f966ac0 x4 : 0000000000000000
        x3 : 0000000000000027 x2 : 0000000000000023
        x1 : 9cbf774e53148400 x0 : 0000000000000000 Call trace:
          clk_core_disable+0xcc/0x2bc
          clk_disable+0x3c/0x60
          sdhci_esdhc_runtime_suspend+0x98/0x150
          pm_generic_runtime_suspend+0x38/0x50
          __rpm_callback+0x98/0x160
          rpm_callback+0x64/0x90
          rpm_suspend+0x120/0x740
          rpm_idle+0x120/0x430
          pm_runtime_work+0xb0/0xd4
          process_one_work+0x1f4/0x4ac
          worker_thread+0x15c/0x464
          kthread+0x168/0x16c
          ret_from_fork+0x10/0x3c
        ---[ end trace f30e4f550c7143ad ]---

This patch is to fix this issue.

Signed-off-by: Zhantao Tang <[email protected]>
---
 drivers/mmc/host/sdhci-esdhc-imx.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c 
b/drivers/mmc/host/sdhci-esdhc-imx.c
index f5c603c6e933..2298a30bb118 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -1950,6 +1950,8 @@ static int sdhci_esdhc_resume(struct device *dev)
        if (!ret)
                ret = mmc_gpio_set_cd_wake(host->mmc, false);
 
+       return ret;
+
 disable_per_clk:
        clk_disable_unprepare(imx_data->clk_per);
 disable_ipg_clk:
-- 
2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#9851): 
https://lists.yoctoproject.org/g/linux-yocto/message/9851
Mute This Topic: https://lists.yoctoproject.org/mt/82711013/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to