]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
ufs: Clear UECPA once due to LINERESET has happened during LINK_STARTUP
authorBhupesh Sharma <bhupesh.linux@gmail.com>
Mon, 30 Sep 2024 12:44:30 +0000 (14:44 +0200)
committerNeil Armstrong <neil.armstrong@linaro.org>
Mon, 14 Oct 2024 06:55:28 +0000 (08:55 +0200)
Clear UECPA once in u-boot UFS driver due to LINERESET has happened
during LINK_STARTUP. This makes the u-boot ufs driver behavior related
to UECPA similar to Linux UFS driver.

Ported from Linux kernel commit:
2355b66ed20c ("scsi: ufs: Handle LINERESET indication in err handler")

Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Tested-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Tested-by: Julius Lehmann <lehmanju@devpi.de>
Link: https://lore.kernel.org/r/20240930-topic-ufs-enhancements-v3-8-58234f84ab89@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
drivers/ufs/ufs.c

index d99dcdef7d0cae057914cbe7b54342f77c19a804..565a6af1404897e1c4ec4474da8372e74b29b11c 100644 (file)
@@ -504,6 +504,8 @@ link_startup:
        if (ret)
                goto out;
 
+       /* Clear UECPA once due to LINERESET has happened during LINK_STARTUP */
+       ufshcd_readl(hba, REG_UIC_ERROR_CODE_PHY_ADAPTER_LAYER);
        ret = ufshcd_make_hba_operational(hba);
 out:
        if (ret)