Skip to content

Commit 1a7edd0

Browse files
keosungmartinkpetersen
authored andcommitted
scsi: ufs: core: Fix I/O hang that occurs when BKOPS fails in W-LUN suspend
Even when urgent BKOPS fails, the consumer will get stuck in runtime suspend status. Like commit 1a5665f ("scsi: ufs: core: WLUN suspend SSU/enter hibern8 fail recovery"), trigger the error handler and return -EBUSY to break the suspend. Fixes: b294ff3 ("scsi: ufs: core: Enable power management for wlun") Signed-off-by: Keoseong Park <keosung.park@samsung.com> Link: https://lore.kernel.org/r/20230425031721epcms2p5d4de65616478c967d466626e20c42a3a@epcms2p5 Reviewed-by: Avri Altman <avri.altman@wdc.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent ac9a786 commit 1a7edd0

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
@@ -9459,8 +9459,16 @@ static int __ufshcd_wl_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op)
94599459
* that performance might be impacted.
94609460
*/
94619461
ret = ufshcd_urgent_bkops(hba);
9462-
if (ret)
9462+
if (ret) {
9463+
/*
9464+
* If return err in suspend flow, IO will hang.
9465+
* Trigger error handler and break suspend for
9466+
* error recovery.
9467+
*/
9468+
ufshcd_force_error_recovery(hba);
9469+
ret = -EBUSY;
94639470
goto enable_scaling;
9471+
}
94649472
} else {
94659473
/* make sure that auto bkops is disabled */
94669474
ufshcd_disable_auto_bkops(hba);

0 commit comments

Comments
 (0)