]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
scsi: ufs: host: mediatek: Add debug information for Auto-Hibern8
authorPeter Wang <peter.wang@mediatek.com>
Mon, 11 Aug 2025 13:11:19 +0000 (21:11 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 15 Aug 2025 02:49:12 +0000 (22:49 -0400)
Enhance the clock gating logic by adding debug information for the
Auto-Hibern8 (AHIT) register.  This additional logging aids in
troubleshooting by providing insights into the AHIT configuration when
the clock is not turned off as expected.

Signed-off-by: Peter Wang <peter.wang@mediatek.com>
Link: https://lore.kernel.org/r/20250811131423.3444014-4-peter.wang@mediatek.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/ufs/host/ufs-mediatek.c

index e1eac1b428f81e25566565dd0be3dd922cd9cc58..32f8d8da381e642b7c66001ea2a5e40f8d48c17d 100644 (file)
@@ -798,8 +798,14 @@ static int ufs_mtk_setup_clocks(struct ufs_hba *hba, bool on,
                                clk_pwr_off = true;
                }
 
-               if (clk_pwr_off)
+               if (clk_pwr_off) {
                        ufs_mtk_pwr_ctrl(hba, false);
+               } else {
+                       dev_warn(hba->dev, "Clock is not turned off, hba->ahit = 0x%x, AHIT = 0x%x\n",
+                               hba->ahit,
+                               ufshcd_readl(hba,
+                                       REG_AUTO_HIBERNATE_IDLE_TIMER));
+               }
                ufs_mtk_mcq_disable_irq(hba);
        } else if (on && status == POST_CHANGE) {
                ufs_mtk_pwr_ctrl(hba, true);