summaryrefslogtreecommitdiffstats
path: root/drivers/ufs/core
diff options
context:
space:
mode:
authorPeter Wang <peter.wang@mediatek.com>2022-07-27 11:05:26 +0800
committerMartin K. Petersen <martin.petersen@oracle.com>2022-08-01 19:32:44 -0400
commit00511d2abf5708ad05dd5d1c36adb2468d274698 (patch)
tree803a081b39d31d5783f7beb4caf4704ec4fa429b /drivers/ufs/core
parent86a44f045b8cbfd885b7425f4cd8a1c353593057 (diff)
downloadlinux-00511d2abf5708ad05dd5d1c36adb2468d274698.tar.gz
linux-00511d2abf5708ad05dd5d1c36adb2468d274698.tar.bz2
linux-00511d2abf5708ad05dd5d1c36adb2468d274698.zip
scsi: ufs: core: Correct ufshcd_shutdown() flow
After ufshcd_wl_shutdown() set device power off and link off, ufshcd_shutdown() could turn off clock/power. Also remove pm_runtime_get_sync. The reason why it is safe to remove pm_runtime_get_sync() is because: - ufshcd_wl_shutdown() -> pm_runtime_get_sync() will resume hba->dev too. - device resume(turn on clk/power) is not required, even if device is in RPM_SUSPENDED. Link: https://lore.kernel.org/r/20220727030526.31022-1-peter.wang@mediatek.com Fixes: b294ff3e3449 ("scsi: ufs: core: Enable power management for wlun") Cc: <stable@vger.kernel.org> # 5.15.x Reviewed-by: Stanley Chu <stanley.chu@mediatek.com> Signed-off-by: Peter Wang <peter.wang@mediatek.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/ufs/core')
-rw-r--r--drivers/ufs/core/ufshcd.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index dbe74f6b0c47..0dc6437e956a 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -9487,12 +9487,8 @@ EXPORT_SYMBOL(ufshcd_runtime_resume);
int ufshcd_shutdown(struct ufs_hba *hba)
{
if (ufshcd_is_ufs_dev_poweroff(hba) && ufshcd_is_link_off(hba))
- goto out;
-
- pm_runtime_get_sync(hba->dev);
+ ufshcd_suspend(hba);
- ufshcd_suspend(hba);
-out:
hba->is_powered = false;
/* allow force shutdown even in case of errors */
return 0;