Commit 35dabf45 authored by Seunghui Lee's avatar Seunghui Lee Committed by Martin K. Petersen
Browse files

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: 4db7a236 ("scsi: ufs: Fix concurrency of error handler and other error recovery paths")
Signed-off-by: default avatarSeunghui Lee <sh043.lee@samsung.com>
Link: https://lore.kernel.org/r/20250717081213.6811-1-sh043.lee@samsung.com


Reviewed-by: default avatarBean Huo <beanhuo@micron.com>
Acked-by: default avatarBart Van Assche <bvanassche@acm.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 7bdc6892
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -4383,7 +4383,7 @@ static int ufshcd_uic_pwr_ctrl(struct ufs_hba *hba, struct uic_command *cmd)
	hba->uic_async_done = NULL;
	if (reenable_intr)
		ufshcd_enable_intr(hba, UIC_COMMAND_COMPL);
	if (ret) {
	if (ret && !hba->pm_op_in_progress) {
		ufshcd_set_link_broken(hba);
		ufshcd_schedule_eh_work(hba);
	}
@@ -4391,6 +4391,14 @@ static int ufshcd_uic_pwr_ctrl(struct ufs_hba *hba, struct uic_command *cmd)
	spin_unlock_irqrestore(hba->host->host_lock, flags);
	mutex_unlock(&hba->uic_cmd_mutex);

	/*
	 * If the h8 exit fails during the runtime resume process, it becomes
	 * stuck and cannot be recovered through the error handler.  To fix
	 * this, use link recovery instead of the error handler.
	 */
	if (ret && hba->pm_op_in_progress)
		ret = ufshcd_link_recovery(hba);

	return ret;
}