Skip to content

Commit 1d53864

Browse files
Stanley Chumartinkpetersen
authored andcommitted
scsi: ufs: Fix possible power drain during system suspend
Currently if device needs to do flush or BKOP operations, the device VCC power is kept during runtime-suspend period. However, if system suspend is happening while device is runtime-suspended, such power may not be disabled successfully. The reasons may be, 1. If current PM level is the same as SPM level, device will keep runtime-suspended by ufshcd_system_suspend(). 2. Flush recheck work may not be scheduled successfully during system suspend period. If it can wake up the system, this is also not the intention of the recheck work. To fix this issue, simply runtime-resume the device if the flush is allowed during runtime suspend period. Flush capability will be disabled while leaving runtime suspend, and also not be allowed in system suspend period. Link: https://lore.kernel.org/r/20201222072905.32221-2-stanley.chu@mediatek.com Fixes: 51dd905 ("scsi: ufs: Fix WriteBooster flush during runtime suspend") Reviewed-by: Chaotian Jing <chaotian.jing@mediatek.com> Reviewed-by: Can Guo <cang@codeaurora.org> Signed-off-by: Stanley Chu <stanley.chu@mediatek.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent a8f8088 commit 1d53864

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/scsi/ufs/ufshcd.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8938,7 +8938,8 @@ int ufshcd_system_suspend(struct ufs_hba *hba)
89388938
if ((ufs_get_pm_lvl_to_dev_pwr_mode(hba->spm_lvl) ==
89398939
hba->curr_dev_pwr_mode) &&
89408940
(ufs_get_pm_lvl_to_link_pwr_state(hba->spm_lvl) ==
8941-
hba->uic_link_state))
8941+
hba->uic_link_state) &&
8942+
!hba->dev_info.b_rpm_dev_flush_capable)
89428943
goto out;
89438944

89448945
if (pm_runtime_suspended(hba->dev)) {

0 commit comments

Comments
 (0)