Skip to content
Permalink
Browse files
scsi:ufs:add quirk to keep write booster on
Some samsung devices have performance issue when the
remaining space is low, and the write booster needs
to be always on.

Therefore, add quirk option UFS_DEVICE_QUIRK_KEEP_ON_WB

Signed-off-by: tanghuan <tanghuan@vivo.com>
  • Loading branch information
tanghuan authored and intel-lab-lkp committed Nov 11, 2021
1 parent 375622e commit d62a8caeaf6fc77b0e717c94db58080d3f1edb68
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
@@ -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);

0 comments on commit d62a8ca

Please sign in to comment.