scsi: ufs-mediatek: fix ufs power down specs violation
As per specs, e.g, JESD220E chapter 7.2, while powering off the ufs device, RST_N signal should be between VSS(Ground) and VCCQ/VCCQ2. The power down sequence after fixing as below:
Power down:
1. Assert RST_N low
2. Turn-off VCC
3. Turn-off VCCQ/VCCQ2
drivers/scsi/ufs/ufs-mediatek.c | 4 ++++ 1 file changed, 4 insertions(+)
PATCH 1/1 scsi: ufs-mediatek: fix ufs power down specs violation
From: Peter Wang <[email protected]>
As per specs, e.g, JESD220E chapter 7.2, while powering off the ufs device, RST_N signal should be between VSS(Ground) and VCCQ/VCCQ2. The power down sequence after fixing as below:
Power down:
1. Assert RST_N low
2. Turn-off VCC
3. Turn-off VCCQ/VCCQ2
--- drivers/scsi/ufs/ufs-mediatek.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/scsi/ufs/ufs-mediatek.c +4 -0
@@ -922,6 +922,7 @@ static void ufs_mtk_vreg_set_lpm(struct ufs_hba *hba, bool lpm)static int ufs_mtk_suspend (struct ufs_hba *hba,enum ufs_pm_op pm_op) {int err; +struct arm_smccc_res res;if (ufshcd_is_link_hibern8 (hba)) { err =ufs_mtk_link_set_lpm (hba);
@@ -941,6 +942,9 @@ static int ufs_mtk_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op) goto fail; } +if (ufshcd_is_link_off (hba)) +ufs_mtk_device_reset_ctrl (0 , res); +return 0 ; fail:/*
Signature · 1 line
1.7.9.5
Hi Peter,
Thanks for posting this fix.
Quoted 6 lines · On Wed, 2021-05-12 at 16:39 +0800, [email protected] wrote:
From: Peter Wang <[email protected]>
As per specs, e.g, JESD220E chapter 7.2, while powering off the ufs device,
RST_Nsignal should be between VSS(Ground) and VCCQ/VCCQ2. The power down sequence after fixing as below:
Quoted 6 lines
Power down:
1. AssertRST_Nlow
2. Turn-off VCC
3. Turn-off VCCQ/VCCQ2Change-Id: I297e9afe3c22bb1a5fc5e7acce9b5ecfd20181ed
Please drop Change-Id line.
Quoted 18 lines
Signed-off-by Peter Wang <[email protected]>--- drivers/scsi/ufs/ufs-mediatek.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/scsi/ufs/ufs-mediatek.c +1
-0@@ -922,6 +922,7 @@ static void ufs_mtk_vreg_set_lpm(struct ufs_hba *hba, bool lpm)static int ufs_mtk_suspend (struct ufs_hba *hba,enum ufs_pm_op pm_op) {int err; +struct arm_smccc_res res;if (ufshcd_is_link_hibern8 (hba)) { err =ufs_mtk_link_set_lpm (hba);
drivers/scsi/ufs/ufs-mediatek.c static int ufs_mtk_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op) · line 947
Quoted 6 lines
drivers/scsi/ufs/ufs-mediatek.c +3
-0@@ -941,6 +942,9 @@ static int ufs_mtk_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op) goto fail; } +if (ufshcd_is_link_off (hba)) +ufs_mtk_device_reset_ctrl (0 , res); +
Please also consider the case: Linkoff during suspend. In this case, HW reset pin shall be released during resume flow.
Thanks,
Stanley Chu