mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 10:04:04 +02:00
scsi: ufs: host: mediatek: Correct system PM flow
Refine the system power management (PM) flow by skipping low power mode (LPM) and MTCMOS settings if runtime PM is already applied. Prevent redundant operations to ensure a more efficient PM process. Signed-off-by: Peter Wang <peter.wang@mediatek.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
15ef3f5aa8
commit
77b96ef70b
|
|
@ -2304,27 +2304,38 @@ static int ufs_mtk_system_suspend(struct device *dev)
|
|||
|
||||
ret = ufshcd_system_suspend(dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
goto out;
|
||||
|
||||
if (pm_runtime_suspended(hba->dev))
|
||||
goto out;
|
||||
|
||||
ufs_mtk_dev_vreg_set_lpm(hba, true);
|
||||
|
||||
if (ufs_mtk_is_rtff_mtcmos(hba))
|
||||
ufs_mtk_mtcmos_ctrl(false, res);
|
||||
|
||||
return 0;
|
||||
out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int ufs_mtk_system_resume(struct device *dev)
|
||||
{
|
||||
int ret = 0;
|
||||
struct ufs_hba *hba = dev_get_drvdata(dev);
|
||||
struct arm_smccc_res res;
|
||||
|
||||
if (pm_runtime_suspended(hba->dev))
|
||||
goto out;
|
||||
|
||||
ufs_mtk_dev_vreg_set_lpm(hba, false);
|
||||
|
||||
if (ufs_mtk_is_rtff_mtcmos(hba))
|
||||
ufs_mtk_mtcmos_ctrl(true, res);
|
||||
|
||||
return ufshcd_system_resume(dev);
|
||||
out:
|
||||
ret = ufshcd_system_resume(dev);
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user