Skip to content

Commit 62c0153

Browse files
ptr324martinkpetersen
authored andcommitted
scsi: ufs: core: Move link recovery for hibern8 exit failure to wl_resume
Move the link recovery trigger from ufshcd_uic_pwr_ctrl() to __ufshcd_wl_resume(). Ensure link recovery is only attempted when hibern8 exit fails during resume, not during hibern8 enter in suspend. Improve error handling and prevent unnecessary link recovery attempts. Fixes: 35dabf4 ("scsi: ufs: core: Use link recovery when h8 exit fails during runtime resume") Signed-off-by: Peter Wang <peter.wang@mediatek.com> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Link: https://patch.msgid.link/20260223103906.2533654-1-peter.wang@mediatek.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 30df81f commit 62c0153

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

drivers/ufs/core/ufshcd.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4390,14 +4390,6 @@ static int ufshcd_uic_pwr_ctrl(struct ufs_hba *hba, struct uic_command *cmd)
43904390
spin_unlock_irqrestore(hba->host->host_lock, flags);
43914391
mutex_unlock(&hba->uic_cmd_mutex);
43924392

4393-
/*
4394-
* If the h8 exit fails during the runtime resume process, it becomes
4395-
* stuck and cannot be recovered through the error handler. To fix
4396-
* this, use link recovery instead of the error handler.
4397-
*/
4398-
if (ret && hba->pm_op_in_progress)
4399-
ret = ufshcd_link_recovery(hba);
4400-
44014393
return ret;
44024394
}
44034395

@@ -10200,7 +10192,15 @@ static int __ufshcd_wl_resume(struct ufs_hba *hba, enum ufs_pm_op pm_op)
1020010192
} else {
1020110193
dev_err(hba->dev, "%s: hibern8 exit failed %d\n",
1020210194
__func__, ret);
10203-
goto vendor_suspend;
10195+
/*
10196+
* If the h8 exit fails during the runtime resume
10197+
* process, it becomes stuck and cannot be recovered
10198+
* through the error handler. To fix this, use link
10199+
* recovery instead of the error handler.
10200+
*/
10201+
ret = ufshcd_link_recovery(hba);
10202+
if (ret)
10203+
goto vendor_suspend;
1020410204
}
1020510205
} else if (ufshcd_is_link_off(hba)) {
1020610206
/*

0 commit comments

Comments
 (0)