scsi: ufs: host: mediatek: Enhance recovery on resume failure

[ Upstream commit 15ef3f5aa822f32524cba1463422a2c9372443f0 ]

Improve the recovery process for failed resume operations. Log the
device's power status and return 0 if both resume and recovery fail to
prevent I/O hang.

Signed-off-by: Peter Wang <peter.wang@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Peter Wang
2025-09-03 10:44:38 +08:00
committed by Greg Kroah-Hartman
parent 5a4f1a9db4
commit b6f7828c1f

View File

@@ -1727,8 +1727,21 @@ static int ufs_mtk_resume(struct ufs_hba *hba, enum ufs_pm_op pm_op)
}
return 0;
fail:
return ufshcd_link_recovery(hba);
/*
* Check if the platform (parent) device has resumed, and ensure that
* power, clock, and MTCMOS are all turned on.
*/
err = ufshcd_link_recovery(hba);
if (err) {
dev_err(hba->dev, "Device PM: req=%d, status:%d, err:%d\n",
hba->dev->power.request,
hba->dev->power.runtime_status,
hba->dev->power.runtime_error);
}
return 0; /* Cannot return a failure, otherwise, the I/O will hang. */
}
static void ufs_mtk_dbg_register_dump(struct ufs_hba *hba)