Skip to content

Commit 3fb2db6

Browse files
baekseunghwan8267gregkh
authored andcommitted
scsi: ufs: core: Add ufshcd_update_evt_hist() for UFS suspend error
commit c9f36f0 upstream. If UFS resume fails, the event history is updated in ufshcd_resume(), but there is no code anywhere to record UFS suspend. Therefore, add code to record UFS suspend error event history. Fixes: dd11376 ("scsi: ufs: Split the drivers/scsi/ufs directory") Cc: stable@vger.kernel.org Signed-off-by: Seunghwan Baek <sh8267.baek@samsung.com> Reviewed-by: Peter Wang <peter.wang@mediatek.com> Link: https://patch.msgid.link/20251210063854.1483899-2-sh8267.baek@samsung.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent a0d4e9e commit 3fb2db6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/ufs/core/ufshcd.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10223,7 +10223,7 @@ static int ufshcd_suspend(struct ufs_hba *hba)
1022310223
ret = ufshcd_setup_clocks(hba, false);
1022410224
if (ret) {
1022510225
ufshcd_enable_irq(hba);
10226-
return ret;
10226+
goto out;
1022710227
}
1022810228
if (ufshcd_is_clkgating_allowed(hba)) {
1022910229
hba->clk_gating.state = CLKS_OFF;
@@ -10235,6 +10235,9 @@ static int ufshcd_suspend(struct ufs_hba *hba)
1023510235
/* Put the host controller in low power mode if possible */
1023610236
ufshcd_hba_vreg_set_lpm(hba);
1023710237
ufshcd_pm_qos_update(hba, false);
10238+
out:
10239+
if (ret)
10240+
ufshcd_update_evt_hist(hba, UFS_EVT_SUSPEND_ERR, (u32)ret);
1023810241
return ret;
1023910242
}
1024010243

0 commit comments

Comments
 (0)