Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 4db7a2360597 ("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>

authored by

Seunghui Lee and committed by
Martin K. Petersen
35dabf45 7bdc6892

+9 -1
+9 -1
drivers/ufs/core/ufshcd.c
··· 4383 4383 hba->uic_async_done = NULL; 4384 4384 if (reenable_intr) 4385 4385 ufshcd_enable_intr(hba, UIC_COMMAND_COMPL); 4386 - if (ret) { 4386 + if (ret && !hba->pm_op_in_progress) { 4387 4387 ufshcd_set_link_broken(hba); 4388 4388 ufshcd_schedule_eh_work(hba); 4389 4389 } 4390 4390 out_unlock: 4391 4391 spin_unlock_irqrestore(hba->host->host_lock, flags); 4392 4392 mutex_unlock(&hba->uic_cmd_mutex); 4393 + 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); 4393 4401 4394 4402 return ret; 4395 4403 }