Skip to contentSkip to conversation

scsi: ufs: Export ufshcd_hba_stop

PATCH Superseded Alice 2 participants 3 messages May 27, 2021 SCSI

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Alice

author
#0 lore raw

PATCH 1/1 scsi: ufs: Export ufshcd_hba_stop

From: "Alice.Chao" <[email protected]>

Export ufshcd_hba_stop to allow vendors to disable HCI in variant ops.

---
 drivers/scsi/ufs/ufshcd.c | 3 ++-
 drivers/scsi/ufs/ufshcd.h | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/scsi/ufs/ufshcd.c +2 -1
index 3eb54937f1d8..986fab41bc42 100644
@@ -4417,7 +4417,7 @@ EXPORT_SYMBOL_GPL(ufshcd_make_hba_operational);
  * ufshcd_hba_stop - Send controller to reset state
  * @hba: per adapter instance
  */
-static inline void ufshcd_hba_stop(struct ufs_hba *hba)
+void ufshcd_hba_stop(struct ufs_hba *hba)
 {
 	unsigned long flags;
 	int err;
@@ -4436,6 +4436,7 @@ static inline void ufshcd_hba_stop(struct ufs_hba *hba)
 	if (err)
 		dev_err(hba->dev, "%s: Controller disable failed\n", __func__);
 }
+EXPORT_SYMBOL_GPL(ufshcd_hba_stop);
 
 /**
  * ufshcd_hba_execute_hce - initialize the controller
drivers/scsi/ufs/ufshcd.h +1 -0
index 5eb66a8debc7..708a0a9acff5 100644
@@ -947,6 +947,7 @@ int ufshcd_wait_for_register(struct ufs_hba *hba, u32 reg, u32 mask,
 				unsigned long timeout_ms);
 void ufshcd_parse_dev_ref_clk_freq(struct ufs_hba *hba, struct clk *refclk);
 void ufshcd_update_evt_hist(struct ufs_hba *hba, u32 id, u32 val);
+void ufshcd_hba_stop(struct ufs_hba *hba);
 
 static inline void check_upiu_size(void)
 {
Signature · 1 line
2.18.0
author
#1 lore raw

PATCH 1/1 scsi: ufs-mediatek: Fix HWReset timing

From: "Alice.Chao" <[email protected]>

HCI disable before HW Reset.
Because of the property of mtk ufshci,
we need to change reset flow to avoid potential issues.

Change-Id I3eb917fd2953b58dcf7e021286d1de71c9232cfb

CR-Id: ALPS05728133
Feature: UFS(Universal Flash Storage)

---
 drivers/scsi/ufs/ufs-mediatek.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/scsi/ufs/ufs-mediatek.c +3 -0
index a981f261b304..c62603ed3d33 100644
@@ -846,6 +846,9 @@ static int ufs_mtk_device_reset(struct ufs_hba *hba)
 {
 	struct arm_smccc_res res;
 
+	/* disable hba before device reset */
+	ufshcd_hba_stop(hba);
+
 	ufs_mtk_device_reset_ctrl(0, res);
 
 	/*
Signature · 1 line
2.18.0
#2 lore raw

RE: [PATCH 1/1] scsi: ufs-mediatek: Fix HWReset timing

Quoted 15 lines

-----Original Message-----
From: Alice <[email protected]>
Sent: 27 May 2021 21:28
To: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; chun- [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: [PATCH 1/1] scsi: ufs-mediatek: Fix HWReset timing

Quoted 6 lines

From: "Alice.Chao" <[email protected]>

HCI disable before HW Reset.
Because of the property of mtk ufshci,
we need to change reset flow to avoid potential issues.

Please re-format the commit message and mention few wards about potential issues.

Quoted 1 line

Change-Id: I3eb917fd2953b58dcf7e021286d1de71c9232cfb

Hmm, run a checkpatch before submitting any patch.

Quoted 2 lines

CR-Id: ALPS05728133

What are these ID? Please remove.

Quoted 1 line

Feature: UFS(Universal Flash Storage)

Please check Documentation/process/submitting-patches.rst, before submitting patches.

Review

Quoted 5 lines
---
 drivers/scsi/ufs/ufs-mediatek.c | 3 +++
 1 file changed, 3 insertions(+)
(quoted diff) +0 -0

b/drivers/scsi/ufs/ufs-mediatek.c

Quoted 15 lines

index a981f261b304..c62603ed3d33 100644

drivers/scsi/ufs/ufs-mediatek.c +3 -1
@@ -846,6 +846,9 @@ static int ufs_mtk_device_reset(struct ufs_hba *hba)
 {
 	struct arm_smccc_res res;
 
+	/* disable hba before device reset */
+	ufshcd_hba_stop(hba);
+
 	ufs_mtk_device_reset_ctrl(0, res);
 
 	/*
--

2.18.0