Skip to content

Commit 35dabf4

Browse files
sh043leemartinkpetersen
authored andcommitted
scsi: ufs: core: Use link recovery when h8 exit fails during runtime resume
If the h8 exit fails during runtime resume process, the runtime thread enters runtime suspend immediately and the error handler operates at the same time. It becomes stuck and cannot be recovered through the error handler. To fix this, use link recovery instead of the error handler. Fixes: 4db7a23 ("scsi: ufs: Fix concurrency of error handler and other error recovery paths") Signed-off-by: Seunghui Lee <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Bean Huo <[email protected]> Acked-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 7bdc689 commit 35dabf4

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

drivers/ufs/core/ufshcd.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4383,14 +4383,22 @@ static int ufshcd_uic_pwr_ctrl(struct ufs_hba *hba, struct uic_command *cmd)
43834383
hba->uic_async_done = NULL;
43844384
if (reenable_intr)
43854385
ufshcd_enable_intr(hba, UIC_COMMAND_COMPL);
4386-
if (ret) {
4386+
if (ret && !hba->pm_op_in_progress) {
43874387
ufshcd_set_link_broken(hba);
43884388
ufshcd_schedule_eh_work(hba);
43894389
}
43904390
out_unlock:
43914391
spin_unlock_irqrestore(hba->host->host_lock, flags);
43924392
mutex_unlock(&hba->uic_cmd_mutex);
43934393

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

0 commit comments

Comments
 (0)