Skip to content

Commit c9f36f0

Browse files
baekseunghwan8267martinkpetersen
authored andcommitted
scsi: ufs: core: Add ufshcd_update_evt_hist() for UFS suspend error
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>
1 parent 0e16776 commit c9f36f0

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

drivers/ufs/core/ufshcd.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10359,7 +10359,7 @@ static int ufshcd_suspend(struct ufs_hba *hba)
1035910359
ret = ufshcd_setup_clocks(hba, false);
1036010360
if (ret) {
1036110361
ufshcd_enable_irq(hba);
10362-
return ret;
10362+
goto out;
1036310363
}
1036410364
if (ufshcd_is_clkgating_allowed(hba)) {
1036510365
hba->clk_gating.state = CLKS_OFF;
@@ -10371,6 +10371,9 @@ static int ufshcd_suspend(struct ufs_hba *hba)
1037110371
/* Put the host controller in low power mode if possible */
1037210372
ufshcd_hba_vreg_set_lpm(hba);
1037310373
ufshcd_pm_qos_update(hba, false);
10374+
out:
10375+
if (ret)
10376+
ufshcd_update_evt_hist(hba, UFS_EVT_SUSPEND_ERR, (u32)ret);
1037410377
return ret;
1037510378
}
1037610379

0 commit comments

Comments
 (0)