Thread (36 messages) 36 messages, 5 authors, 2023-08-22
STALE1048d
Revisions (2)
  1. v9 [diff vs current]
  2. v10 current

[PATCH v10 14/18] scsi: ufs: sprd: Rework the code for disabling auto-hibernation

From: Bart Van Assche <bvanassche@acm.org>
Date: 2023-08-18 19:46:40
Also in: linux-scsi
Subsystem: scsi subsystem, the rest · Maintainers: "James E.J. Bottomley", "Martin K. Petersen", Linus Torvalds

Call ufshcd_auto_hibern8_update() instead of writing directly into the
auto-hibernation control register. This patch is part of an effort to
move all auto-hibernation register changes into the UFSHCI driver core.

Cc: Martin K. Petersen <martin.petersen@oracle.com>
Cc: Can Guo <redacted>
Cc: Avri Altman <avri.altman@wdc.com>
Cc: Bao D. Nguyen <redacted>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/ufs/host/ufs-sprd.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/drivers/ufs/host/ufs-sprd.c b/drivers/ufs/host/ufs-sprd.c
index 2bad75dd6d58..15a1876656a7 100644
--- a/drivers/ufs/host/ufs-sprd.c
+++ b/drivers/ufs/host/ufs-sprd.c
@@ -180,15 +180,8 @@ static int sprd_ufs_pwr_change_notify(struct ufs_hba *hba,
 static int ufs_sprd_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op,
 			    enum ufs_notify_change_status status)
 {
-	unsigned long flags;
-
-	if (status == PRE_CHANGE) {
-		if (ufshcd_is_auto_hibern8_supported(hba)) {
-			spin_lock_irqsave(hba->host->host_lock, flags);
-			ufshcd_writel(hba, 0, REG_AUTO_HIBERNATE_IDLE_TIMER);
-			spin_unlock_irqrestore(hba->host->host_lock, flags);
-		}
-	}
+	if (status == PRE_CHANGE)
+		WARN_ON_ONCE(ufshcd_auto_hibern8_update(hba, 0) != 0);
 
 	return 0;
 }
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help