Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit bb98507

Browse files
Mani-Sadhasivammartinkpetersen
authored andcommitted
scsi: ufs: core: Honor runtime/system PM levels if set by host controller drivers
Otherwise, the default levels will override the levels set by the host controller drivers. Signed-off-by: Manivannan Sadhasivam <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 7bac656 commit bb98507

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

drivers/ufs/core/ufshcd.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10590,14 +10590,17 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq)
1059010590
}
1059110591

1059210592
/*
10593-
* Set the default power management level for runtime and system PM.
10593+
* Set the default power management level for runtime and system PM if
10594+
* not set by the host controller drivers.
1059410595
* Default power saving mode is to keep UFS link in Hibern8 state
1059510596
* and UFS device in sleep state.
1059610597
*/
10597-
hba->rpm_lvl = ufs_get_desired_pm_lvl_for_dev_link_state(
10598+
if (!hba->rpm_lvl)
10599+
hba->rpm_lvl = ufs_get_desired_pm_lvl_for_dev_link_state(
1059810600
UFS_SLEEP_PWR_MODE,
1059910601
UIC_LINK_HIBERN8_STATE);
10600-
hba->spm_lvl = ufs_get_desired_pm_lvl_for_dev_link_state(
10602+
if (!hba->spm_lvl)
10603+
hba->spm_lvl = ufs_get_desired_pm_lvl_for_dev_link_state(
1060110604
UFS_SLEEP_PWR_MODE,
1060210605
UIC_LINK_HIBERN8_STATE);
1060310606

0 commit comments

Comments
 (0)