scsi: ufs: Introduce skipping manual flush for Write Booster
authorKiwoong Kim <kwmad.kim@samsung.com>
Tue, 25 Aug 2020 01:43:15 +0000 (10:43 +0900)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 1 Sep 2020 02:10:43 +0000 (22:10 -0400)
We have two knobs to control flush for write booster,
fWriteBoosterBufferFlushDuringHibernate and fWriteBoosterBufferFlushEn.

Some vendors use only fWriteBoosterBufferFlushDuringHibernate because this
can reportedly cover most scenarios. Also, there have been some reports
that flush by fWriteBoosterBufferFlushEn could lead to increased power
consumption thanks to unexpected internal operations. Consequently, we need
a way to enable or disable fWriteBoosterEn operations. Add quirk to bypass
manual flush.

Link: https://lore.kernel.org/r/ffdb0eda30515809f0ad9ee936b26917ee9b4593.1598319701.git.kwmad.kim@samsung.com
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Kiwoong Kim <kwmad.kim@samsung.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ufs/ufshcd.c
drivers/scsi/ufs/ufshcd.h

index 06e2439..3d91def 100644 (file)
@@ -5306,6 +5306,9 @@ static int ufshcd_wb_toggle_flush_during_h8(struct ufs_hba *hba, bool set)
 
 static inline void ufshcd_wb_toggle_flush(struct ufs_hba *hba, bool enable)
 {
+       if (hba->quirks & UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL)
+               return;
+
        if (enable)
                ufshcd_wb_buf_flush_enable(hba);
        else
index 618b253..a88dfac 100644 (file)
@@ -530,6 +530,11 @@ enum ufshcd_quirks {
         * OCS FATAL ERROR with device error through sense data
         */
        UFSHCD_QUIRK_BROKEN_OCS_FATAL_ERROR             = 1 << 10,
+
+       /*
+        * This quirk needs to disable manual flush for write booster
+        */
+       UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL          = 1 << 11,
 };
 
 enum ufshcd_caps {