Skip to contentSkip to conversation

scsi: ufs-mediatek: Disable HCI before HW reset

PATCH Applied Alice 3 participants 6 messages May 28, 2021 – Jun 8, 2021 SCSI

lore
Share & tools
lore

Alice

author
#0 lore raw

v2 cover scsi: ufs-mediatek: Disable HCI before HW reset

Hi,
This series changes the hw reset timing to avoid potential issues in MediaTek platform.

Change since v1:
- Fix the commit message of patch 2

Alice.Chao (2):
scsi: ufs: Export ufshcd_hba_stop
scsi: ufs-mediatek: Disable HCI before HW reset

 drivers/scsi/ufs/ufs-mediatek.c | 3 +++
 drivers/scsi/ufs/ufshcd.c       | 3 ++-
 drivers/scsi/ufs/ufshcd.h       | 1 +
 3 files changed, 6 insertions(+), 1 deletion(-)
Signature · 1 line
2.18.0
author
#1 lore raw

PATCH v2 1/2 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
#2 lore raw

PATCH v2 2/2 scsi: ufs-mediatek: Disable HCI before HW reset

In reply to Alice

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

MediaTek ufshci needs to be disabled before HW reset to avoid potential issues.

---
 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
Reviewed-by on the v2 series
#3 lore raw
In reply to Alice

Hi Alice,

Quoted 6 lines · Alice

Hi,
This series changes the hw reset timing to avoid potential issues in MediaTek platform.

Change since v1:
- Fix the commit message of patch 2

Quoted 9 lines

Alice.Chao (2):
scsi: ufs: Export ufshcd_hba_stop
scsi: ufs-mediatek: Disable HCI before HW reset

 drivers/scsi/ufs/ufs-mediatek.c | 3 +++
 drivers/scsi/ufs/ufshcd.c       | 3 ++-
 drivers/scsi/ufs/ufshcd.h       | 1 +
 3 files changed, 6 insertions(+), 1 deletion(-)

Thanks for these patches! For this series,

#4 lore raw
In reply to Alice

Alice,

Quoted 2 lines

This series changes the hw reset timing to avoid potential issues in MediaTek platform.

Applied to 5.14/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering
#5 lore raw
In reply to Alice
Quoted 10 lines · Alice

This series changes the hw reset timing to avoid potential issues in MediaTek platform.

Change since v1:
- Fix the commit message of patch 2

Alice.Chao (2):
scsi: ufs: Export ufshcd_hba_stop
scsi: ufs-mediatek: Disable HCI before HW reset

[...]

Applied to 5.14/scsi-queue, thanks!

[1/2] scsi: ufs: Export ufshcd_hba_stop

      https://git.kernel.org/mkp/scsi/c/3a95f5b39254
[2/2] scsi: ufs-mediatek: Disable HCI before HW reset
      https://git.kernel.org/mkp/scsi/c/f9c602f3bd9c
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering