提交 618b4d07 编写于 作者: S Stanley Chu 提交者: Martin K. Petersen

scsi: ufs: ufs-mediatek: fix TX LCC disabling timing

MediaTek UFS host requires TX LCC to be disabled on both host and device
sides. This can be done by disabling host's local TX LCC before link
startup. Correct TX LCC disabling timing in MediaTek UFS driver.

Link: https://lore.kernel.org/r/20200207070357.17169-2-stanley.chu@mediatek.comReviewed-by: NAvri Altman <avri.altman@wdc.com>
Signed-off-by: NStanley Chu <stanley.chu@mediatek.com>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
上级 145e5a8a
...@@ -313,6 +313,15 @@ static int ufs_mtk_pre_link(struct ufs_hba *hba) ...@@ -313,6 +313,15 @@ static int ufs_mtk_pre_link(struct ufs_hba *hba)
ufs_mtk_unipro_powerdown(hba, 0); ufs_mtk_unipro_powerdown(hba, 0);
/*
* Setting PA_Local_TX_LCC_Enable to 0 before link startup
* to make sure that both host and device TX LCC are disabled
* once link startup is completed.
*/
ret = ufshcd_dme_set(hba, UIC_ARG_MIB(PA_LOCAL_TX_LCC_ENABLE), 0);
if (ret)
return ret;
/* disable deep stall */ /* disable deep stall */
ret = ufshcd_dme_get(hba, UIC_ARG_MIB(VS_SAVEPOWERCONTROL), &tmp); ret = ufshcd_dme_get(hba, UIC_ARG_MIB(VS_SAVEPOWERCONTROL), &tmp);
if (ret) if (ret)
...@@ -344,9 +353,6 @@ static void ufs_mtk_setup_clk_gating(struct ufs_hba *hba) ...@@ -344,9 +353,6 @@ static void ufs_mtk_setup_clk_gating(struct ufs_hba *hba)
static int ufs_mtk_post_link(struct ufs_hba *hba) static int ufs_mtk_post_link(struct ufs_hba *hba)
{ {
/* disable device LCC */
ufshcd_dme_set(hba, UIC_ARG_MIB(PA_LOCAL_TX_LCC_ENABLE), 0);
/* enable unipro clock gating feature */ /* enable unipro clock gating feature */
ufs_mtk_cfg_unipro_cg(hba, true); ufs_mtk_cfg_unipro_cg(hba, true);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册