scsi: ufs-mediatek: Customize WriteBooster flush policy
authorStanley Chu <stanley.chu@mediatek.com>
Sat, 9 May 2020 09:37:16 +0000 (17:37 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 15 May 2020 01:02:22 +0000 (21:02 -0400)
Change the WriteBooster policy to keep VCC on during runtime suspend if
available WriteBooster buffer is less than 80%.

Link: https://lore.kernel.org/r/20200509093716.21010-5-stanley.chu@mediatek.com
Reviewed-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ufs/ufs-mediatek.c

index 74baba93f51ef94ed3a7c38c4cdf2bbd06b8f18a..d56ce8d97d4e8642ed666fd79c0515c138b5434b 100644 (file)
@@ -271,6 +271,7 @@ static int ufs_mtk_init(struct ufs_hba *hba)
 
        /* Enable WriteBooster */
        hba->caps |= UFSHCD_CAP_WB_EN;
+       hba->vps->wb_flush_threshold = UFS_WB_BUF_REMAIN_PERCENT(80);
 
        /*
         * ufshcd_vops_init() is invoked after