]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
scsi: ufs: host: mediatek: Change reset sequence for improved stability
authorPeter Wang <peter.wang@mediatek.com>
Mon, 11 Aug 2025 13:11:25 +0000 (21:11 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Nov 2025 20:34:12 +0000 (15:34 -0500)
[ Upstream commit 878ed88c50bfb14d972dd3b86a1c8188c58de4e5 ]

Modify the reset sequence to ensure that the device reset pin is set low
before the host is disabled. This change enhances the stability of the
reset process by ensuring the correct order of operations.

Signed-off-by: Peter Wang <peter.wang@mediatek.com>
Link: https://lore.kernel.org/r/20250811131423.3444014-10-peter.wang@mediatek.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/ufs/host/ufs-mediatek.c

index 191db60b393d9c1423db2b959f1e4039e970e408..c0106fb3792d41399ada656e64e8294ff69c340f 100644 (file)
@@ -1340,11 +1340,11 @@ 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);
 
+       /* disable hba in middle of device reset */
+       ufshcd_hba_stop(hba);
+
        /*
         * The reset signal is active low. UFS devices shall detect
         * more than or equal to 1us of positive or negative RST_n