@@ -122,4 +122,10 @@ struct ufs_dev_fix {
*/
#define UFS_DEVICE_QUIRK_SWAP_L2P_ENTRY_FOR_HPB_READ (1 << 12)
+/*
+ * Some SAMSUNG UFS devices require keep on Write Booster for prevent
+ * performance drop. Enable this quirk to keep on Write Booster
+ */
+#define UFS_DEVICE_QUIRK_KEEP_ON_WB (1 << 13)
+
#endif /* UFS_QUIRKS_H_ */
@@ -1250,10 +1250,15 @@ static int ufshcd_devfreq_scale(struct ufs_hba *hba, bool scale_up)
}
}
- /* Enable Write Booster if we have scaled up else disable it */
- downgrade_write(&hba->clk_scaling_lock);
- is_writelock = false;
- ufshcd_wb_toggle(hba, scale_up);
+ /*
+ * if no need UFS_DEVICE_QUIRK_KEEP_ON_WB, Enable Write
+ * Booster if we have scaled up else disable it
+ */
+ if (!(hba->dev_quirks & UFS_DEVICE_QUIRK_KEEP_ON_WB)) {
+ downgrade_write(&hba->clk_scaling_lock);
+ is_writelock = false;
+ ufshcd_wb_ctrl(hba, scale_up);
+ }
out_unprepare:
ufshcd_clock_scaling_unprepare(hba, is_writelock);