Skip to content

Commit 00511d2

Browse files
ptr324martinkpetersen
authored andcommitted
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/[email protected] Fixes: b294ff3 ("scsi: ufs: core: Enable power management for wlun") Cc: <[email protected]> # 5.15.x Reviewed-by: Stanley Chu <[email protected]> Signed-off-by: Peter Wang <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 86a44f0 commit 00511d2

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

drivers/ufs/core/ufshcd.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9487,12 +9487,8 @@ EXPORT_SYMBOL(ufshcd_runtime_resume);
94879487
int ufshcd_shutdown(struct ufs_hba *hba)
94889488
{
94899489
if (ufshcd_is_ufs_dev_poweroff(hba) && ufshcd_is_link_off(hba))
9490-
goto out;
9491-
9492-
pm_runtime_get_sync(hba->dev);
9490+
ufshcd_suspend(hba);
94939491

9494-
ufshcd_suspend(hba);
9495-
out:
94969492
hba->is_powered = false;
94979493
/* allow force shutdown even in case of errors */
94989494
return 0;

0 commit comments

Comments
 (0)