summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlice Chao <alice.chao@mediatek.com>2025-09-03 10:44:44 +0800
committerMartin K. Petersen <martin.petersen@oracle.com>2025-09-09 22:46:23 -0400
commitd73836cb8535b3078e4d2a57913f301baec58a33 (patch)
treeadf1257ba993f80a75b5522177737c35f2635808
parentf29ec85ac4fdd72469c0c5898f47301c7c95ead8 (diff)
scsi: ufs: host: mediatek: Fix adapt issue after PA_Init
Address the issue where the host does not send adapt to the device after PA_Init success. Ensure the adapt process is correctly initiated for devices with IP version MT6899 and above, resolving communication issues between the host and device. Signed-off-by: Alice Chao <alice.chao@mediatek.com> Reviewed-by: Peter Wang <peter.wang@mediatek.com> Signed-off-by: Peter Wang <peter.wang@mediatek.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r--drivers/ufs/host/ufs-mediatek.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/ufs/host/ufs-mediatek.c b/drivers/ufs/host/ufs-mediatek.c
index 0780dcc8505e..ea939e51eafb 100644
--- a/drivers/ufs/host/ufs-mediatek.c
+++ b/drivers/ufs/host/ufs-mediatek.c
@@ -1551,8 +1551,19 @@ static int ufs_mtk_pre_link(struct ufs_hba *hba)
return ret;
}
+
static void ufs_mtk_post_link(struct ufs_hba *hba)
{
+ struct ufs_mtk_host *host = ufshcd_get_variant(hba);
+ u32 tmp;
+
+ /* fix device PA_INIT no adapt */
+ if (host->ip_ver >= IP_VER_MT6899) {
+ ufshcd_dme_get(hba, UIC_ARG_MIB(VS_DEBUGOMC), &tmp);
+ tmp |= 0x100;
+ ufshcd_dme_set(hba, UIC_ARG_MIB(VS_DEBUGOMC), tmp);
+ }
+
/* enable unipro clock gating feature */
ufs_mtk_cfg_unipro_cg(hba, true);
}