Skip to content

Commit 450b2a5

Browse files
sh043leegregkh
authored andcommitted
scsi: ufs: core: Use link recovery when h8 exit fails during runtime resume
[ Upstream commit 35dabf4 ] 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 <sh043.lee@samsung.com> Link: https://lore.kernel.org/r/20250717081213.6811-1-sh043.lee@samsung.com Reviewed-by: Bean Huo <beanhuo@micron.com> Acked-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 4933567 commit 450b2a5

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

drivers/ufs/core/ufshcd.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4274,14 +4274,22 @@ static int ufshcd_uic_pwr_ctrl(struct ufs_hba *hba, struct uic_command *cmd)
42744274
hba->uic_async_done = NULL;
42754275
if (reenable_intr)
42764276
ufshcd_enable_intr(hba, UIC_COMMAND_COMPL);
4277-
if (ret) {
4277+
if (ret && !hba->pm_op_in_progress) {
42784278
ufshcd_set_link_broken(hba);
42794279
ufshcd_schedule_eh_work(hba);
42804280
}
42814281
out_unlock:
42824282
spin_unlock_irqrestore(hba->host->host_lock, flags);
42834283
mutex_unlock(&hba->uic_cmd_mutex);
42844284

4285+
/*
4286+
* If the h8 exit fails during the runtime resume process, it becomes
4287+
* stuck and cannot be recovered through the error handler. To fix
4288+
* this, use link recovery instead of the error handler.
4289+
*/
4290+
if (ret && hba->pm_op_in_progress)
4291+
ret = ufshcd_link_recovery(hba);
4292+
42854293
return ret;
42864294
}
42874295

0 commit comments

Comments
 (0)