Skip to content

Commit 15ef3f5

Browse files
ptr324martinkpetersen
authored andcommitted
scsi: ufs: host: mediatek: Enhance recovery on resume failure
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>
1 parent faac32d commit 15ef3f5

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

drivers/ufs/host/ufs-mediatek.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1775,8 +1775,21 @@ static int ufs_mtk_resume(struct ufs_hba *hba, enum ufs_pm_op pm_op)
17751775
}
17761776

17771777
return 0;
1778+
17781779
fail:
1779-
return ufshcd_link_recovery(hba);
1780+
/*
1781+
* Check if the platform (parent) device has resumed, and ensure that
1782+
* power, clock, and MTCMOS are all turned on.
1783+
*/
1784+
err = ufshcd_link_recovery(hba);
1785+
if (err) {
1786+
dev_err(hba->dev, "Device PM: req=%d, status:%d, err:%d\n",
1787+
hba->dev->power.request,
1788+
hba->dev->power.runtime_status,
1789+
hba->dev->power.runtime_error);
1790+
}
1791+
1792+
return 0; /* Cannot return a failure, otherwise, the I/O will hang. */
17801793
}
17811794

17821795
static void ufs_mtk_dbg_register_dump(struct ufs_hba *hba)

0 commit comments

Comments
 (0)