Skip to content

Commit 9cc4a4a

Browse files
petegriffinmartinkpetersen
authored andcommitted
scsi: ufs: exynos: Add gs101_ufs_drv_init() hook and enable WriteBooster
Factor out the common code into a new exynos_ufs_shareability() function and provide a dedicated gs101_drv_init() hook. This allows us to enable WriteBooster capability (UFSHCD_CAP_WB_EN) in a way that doesn't effect other SoCs supported in this driver. WriteBooster improves write speeds by enabling a pseudo SLC cache. Using the 'fio seqwrite' test we can achieve speeds of 945MB/s with this feature enabled (until the cache is exhausted) before dropping back to ~260MB/s (which are the speeds we see without the WriteBooster feature enabled). Assuming the UFSHCD_CAP_WB_EN capability is set by the host then WriteBooster can also be enabled and disabled via sysfs so it is possible for the system to only enable it when extra write performance is required. Signed-off-by: Peter Griffin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Tudor Ambarus <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent f8fe71a commit 9cc4a4a

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

drivers/ufs/host/ufs-exynos.c

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ static inline void exynos_ufs_ungate_clks(struct exynos_ufs *ufs)
198198
exynos_ufs_ctrl_clkstop(ufs, false);
199199
}
200200

201-
static int exynosauto_ufs_drv_init(struct exynos_ufs *ufs)
201+
static int exynos_ufs_shareability(struct exynos_ufs *ufs)
202202
{
203203
/* IO Coherency setting */
204204
if (ufs->sysreg) {
@@ -210,6 +210,21 @@ static int exynosauto_ufs_drv_init(struct exynos_ufs *ufs)
210210
return 0;
211211
}
212212

213+
static int gs101_ufs_drv_init(struct exynos_ufs *ufs)
214+
{
215+
struct ufs_hba *hba = ufs->hba;
216+
217+
/* Enable WriteBooster */
218+
hba->caps |= UFSHCD_CAP_WB_EN;
219+
220+
return exynos_ufs_shareability(ufs);
221+
}
222+
223+
static int exynosauto_ufs_drv_init(struct exynos_ufs *ufs)
224+
{
225+
return exynos_ufs_shareability(ufs);
226+
}
227+
213228
static int exynosauto_ufs_post_hce_enable(struct exynos_ufs *ufs)
214229
{
215230
struct ufs_hba *hba = ufs->hba;
@@ -2120,7 +2135,7 @@ static const struct exynos_ufs_drv_data gs101_ufs_drvs = {
21202135
.opts = EXYNOS_UFS_OPT_SKIP_CONFIG_PHY_ATTR |
21212136
EXYNOS_UFS_OPT_UFSPR_SECURE |
21222137
EXYNOS_UFS_OPT_TIMER_TICK_SELECT,
2123-
.drv_init = exynosauto_ufs_drv_init,
2138+
.drv_init = gs101_ufs_drv_init,
21242139
.pre_link = gs101_ufs_pre_link,
21252140
.post_link = gs101_ufs_post_link,
21262141
.pre_pwr_change = gs101_ufs_pre_pwr_change,

0 commit comments

Comments
 (0)