* [PATCH v2 1/2] scsi: ufs: Export ufshcd_hba_stop
2021-05-28 3:36 [PATCH v2 0/2] scsi: ufs-mediatek: Disable HCI before HW reset Alice
@ 2021-05-28 3:36 ` Alice
2021-05-28 3:36 ` [PATCH v2 2/2] scsi: ufs-mediatek: Disable HCI before HW reset Alice
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Alice @ 2021-05-28 3:36 UTC (permalink / raw)
To: stanley.chu, linux-scsi, martin.petersen, avri.altman, alim.akhtar, jejb
Cc: wsd_upstream, peter.wang, chun-hung.wu, alice.chao, jonathan.hsu,
powen.kao, cc.chou, chaotian.jing, jiajie.hao
From: "Alice.Chao" <alice.chao@mediatek.com>
Export ufshcd_hba_stop to allow vendors to disable HCI in variant ops.
Signed-off-by: Alice.Chao <alice.chao@mediatek.com>
---
drivers/scsi/ufs/ufshcd.c | 3 ++-
drivers/scsi/ufs/ufshcd.h | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 3eb54937f1d8..986fab41bc42 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -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
diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h
index 5eb66a8debc7..708a0a9acff5 100644
--- a/drivers/scsi/ufs/ufshcd.h
+++ b/drivers/scsi/ufs/ufshcd.h
@@ -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)
{
--
2.18.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 2/2] scsi: ufs-mediatek: Disable HCI before HW reset
2021-05-28 3:36 [PATCH v2 0/2] scsi: ufs-mediatek: Disable HCI before HW reset Alice
2021-05-28 3:36 ` [PATCH v2 1/2] scsi: ufs: Export ufshcd_hba_stop Alice
@ 2021-05-28 3:36 ` Alice
2021-05-28 3:53 ` [PATCH v2 0/2] " Stanley Chu
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Alice @ 2021-05-28 3:36 UTC (permalink / raw)
To: stanley.chu, linux-scsi, martin.petersen, avri.altman, alim.akhtar, jejb
Cc: wsd_upstream, peter.wang, chun-hung.wu, alice.chao, jonathan.hsu,
powen.kao, cc.chou, chaotian.jing, jiajie.hao
From: "Alice.Chao" <alice.chao@mediatek.com>
MediaTek ufshci needs to be disabled before HW reset to avoid potential issues.
Signed-off-by: Alice.Chao <alice.chao@mediatek.com>
---
drivers/scsi/ufs/ufs-mediatek.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/scsi/ufs/ufs-mediatek.c b/drivers/scsi/ufs/ufs-mediatek.c
index a981f261b304..c62603ed3d33 100644
--- a/drivers/scsi/ufs/ufs-mediatek.c
+++ b/drivers/scsi/ufs/ufs-mediatek.c
@@ -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
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2 0/2] scsi: ufs-mediatek: Disable HCI before HW reset
2021-05-28 3:36 [PATCH v2 0/2] scsi: ufs-mediatek: Disable HCI before HW reset Alice
2021-05-28 3:36 ` [PATCH v2 1/2] scsi: ufs: Export ufshcd_hba_stop Alice
2021-05-28 3:36 ` [PATCH v2 2/2] scsi: ufs-mediatek: Disable HCI before HW reset Alice
@ 2021-05-28 3:53 ` Stanley Chu
2021-06-02 2:44 ` Martin K. Petersen
2021-06-08 3:05 ` Martin K. Petersen
4 siblings, 0 replies; 6+ messages in thread
From: Stanley Chu @ 2021-05-28 3:53 UTC (permalink / raw)
To: Alice
Cc: linux-scsi, martin.petersen, avri.altman, alim.akhtar, jejb,
wsd_upstream, peter.wang, chun-hung.wu, jonathan.hsu, powen.kao,
cc.chou, chaotian.jing, jiajie.hao
Hi Alice,
On Fri, 2021-05-28 at 11:36 +0800, Alice wrote:
> 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(-)
>
Thanks for these patches! For this series,
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 0/2] scsi: ufs-mediatek: Disable HCI before HW reset
2021-05-28 3:36 [PATCH v2 0/2] scsi: ufs-mediatek: Disable HCI before HW reset Alice
` (2 preceding siblings ...)
2021-05-28 3:53 ` [PATCH v2 0/2] " Stanley Chu
@ 2021-06-02 2:44 ` Martin K. Petersen
2021-06-08 3:05 ` Martin K. Petersen
4 siblings, 0 replies; 6+ messages in thread
From: Martin K. Petersen @ 2021-06-02 2:44 UTC (permalink / raw)
To: Alice
Cc: stanley.chu, linux-scsi, martin.petersen, avri.altman,
alim.akhtar, jejb, wsd_upstream, peter.wang, chun-hung.wu,
jonathan.hsu, powen.kao, cc.chou, chaotian.jing, jiajie.hao
Alice,
> This series changes the hw reset timing to avoid potential issues in
> MediaTek platform.
Applied to 5.14/scsi-staging, thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 0/2] scsi: ufs-mediatek: Disable HCI before HW reset
2021-05-28 3:36 [PATCH v2 0/2] scsi: ufs-mediatek: Disable HCI before HW reset Alice
` (3 preceding siblings ...)
2021-06-02 2:44 ` Martin K. Petersen
@ 2021-06-08 3:05 ` Martin K. Petersen
4 siblings, 0 replies; 6+ messages in thread
From: Martin K. Petersen @ 2021-06-08 3:05 UTC (permalink / raw)
To: alim.akhtar, stanley.chu, avri.altman, linux-scsi, Alice, jejb
Cc: Martin K . Petersen, jiajie.hao, peter.wang, wsd_upstream,
cc.chou, chaotian.jing, chun-hung.wu, powen.kao, jonathan.hsu
On Fri, 28 May 2021 11:36:20 +0800, Alice wrote:
> 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
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 6+ messages in thread