public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ufs: Fix handling of active power mode in ufshcd_suspend()
@ 2021-05-12 19:57 Bart Van Assche
  2021-05-13  1:35 ` Can Guo
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Van Assche @ 2021-05-12 19:57 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: James E . J . Bottomley, Jaegeuk Kim, Bean Huo, Avri Altman,
	Asutosh Das, Vignesh Raghavendra, Can Guo, linux-scsi,
	Bart Van Assche, Alim Akhtar, Stanley Chu, Adrian Hunter

If the rpm_lvl and spm_lvl sysfs attributes indicate that ufshcd_suspend()
should keep the link active, re-enable clock gating instead of disabling
clocks.

Suggested-by: Jaegeuk Kim <jaegeuk@kernel.org>
Cc: Can Guo <cang@codeaurora.org>
Cc: Alim Akhtar <alim.akhtar@samsung.com>
Cc: Avri Altman <avri.altman@wdc.com>
Cc: Stanley Chu <stanley.chu@mediatek.com>
Cc: Bean Huo <beanhuo@micron.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/ufs/ufshcd.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index f540b0cc253f..c96e36aab989 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -8690,9 +8690,8 @@ static int ufshcd_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op)
 	ufshcd_clk_scaling_suspend(hba, true);
 
 	if (req_dev_pwr_mode == UFS_ACTIVE_PWR_MODE &&
-			req_link_state == UIC_LINK_ACTIVE_STATE) {
-		goto disable_clks;
-	}
+			req_link_state == UIC_LINK_ACTIVE_STATE)
+		goto enable_gating;
 
 	if ((req_dev_pwr_mode == hba->curr_dev_pwr_mode) &&
 	    (req_link_state == hba->uic_link_state))
@@ -8754,7 +8753,6 @@ static int ufshcd_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op)
 	if (ret)
 		goto set_dev_active;
 
-disable_clks:
 	/*
 	 * Call vendor specific suspend callback. As these callbacks may access
 	 * vendor specific host controller register space call them before the

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-05-14 16:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-12 19:57 [PATCH] ufs: Fix handling of active power mode in ufshcd_suspend() Bart Van Assche
2021-05-13  1:35 ` Can Guo
2021-05-14 16:15   ` Bart Van Assche

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox