Skip to content

Commit d73836c

Browse files
Alice Chaomartinkpetersen
authored andcommitted
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>
1 parent f29ec85 commit d73836c

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

drivers/ufs/host/ufs-mediatek.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1551,8 +1551,19 @@ static int ufs_mtk_pre_link(struct ufs_hba *hba)
15511551

15521552
return ret;
15531553
}
1554+
15541555
static void ufs_mtk_post_link(struct ufs_hba *hba)
15551556
{
1557+
struct ufs_mtk_host *host = ufshcd_get_variant(hba);
1558+
u32 tmp;
1559+
1560+
/* fix device PA_INIT no adapt */
1561+
if (host->ip_ver >= IP_VER_MT6899) {
1562+
ufshcd_dme_get(hba, UIC_ARG_MIB(VS_DEBUGOMC), &tmp);
1563+
tmp |= 0x100;
1564+
ufshcd_dme_set(hba, UIC_ARG_MIB(VS_DEBUGOMC), tmp);
1565+
}
1566+
15561567
/* enable unipro clock gating feature */
15571568
ufs_mtk_cfg_unipro_cg(hba, true);
15581569
}

0 commit comments

Comments
 (0)