Skip to content

Commit cabc453

Browse files
petegriffinmartinkpetersen
authored andcommitted
scsi: ufs: exynos: gs101: Enable clock gating with hibern8
Enable clock gating and hibern8 capabilities for gs101. This leads to a significantly cooler phone when running the upstream kernel. The exynos_ufs_post_hibern8() hook is also updated to remove the UIC_CMD_DME_HIBER_EXIT code path as this causes a hang on gs101. The code path is removed rather than re-factored as no other SoC in ufs-exynos driver sets UFSHCD_CAP_HIBERN8_WITH_CLK_GATING capability. Additionally until the previous commit the hibern8 callbacks were broken anyway as they expected a bool. 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 ceef938 commit cabc453

File tree

1 file changed

+4
-20
lines changed

1 file changed

+4
-20
lines changed

drivers/ufs/host/ufs-exynos.c

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,9 @@ static int gs101_ufs_drv_init(struct exynos_ufs *ufs)
224224
/* Enable WriteBooster */
225225
hba->caps |= UFSHCD_CAP_WB_EN;
226226

227+
/* Enable clock gating and hibern8 */
228+
hba->caps |= UFSHCD_CAP_CLK_GATING | UFSHCD_CAP_HIBERN8_WITH_CLK_GATING;
229+
227230
/* set ACG to be controlled by UFS_ACG_DISABLE */
228231
reg = hci_readl(ufs, HCI_IOP_ACG_DISABLE);
229232
hci_writel(ufs, reg & (~HCI_IOP_ACG_DISABLE_EN), HCI_IOP_ACG_DISABLE);
@@ -1563,26 +1566,7 @@ static void exynos_ufs_post_hibern8(struct ufs_hba *hba, enum uic_cmd_dme cmd)
15631566
{
15641567
struct exynos_ufs *ufs = ufshcd_get_variant(hba);
15651568

1566-
if (cmd == UIC_CMD_DME_HIBER_EXIT) {
1567-
u32 cur_mode = 0;
1568-
u32 pwrmode;
1569-
1570-
if (ufshcd_is_hs_mode(&ufs->dev_req_params))
1571-
pwrmode = FAST_MODE;
1572-
else
1573-
pwrmode = SLOW_MODE;
1574-
1575-
ufshcd_dme_get(hba, UIC_ARG_MIB(PA_PWRMODE), &cur_mode);
1576-
if (cur_mode != (pwrmode << 4 | pwrmode)) {
1577-
dev_warn(hba->dev, "%s: power mode change\n", __func__);
1578-
hba->pwr_info.pwr_rx = (cur_mode >> 4) & 0xf;
1579-
hba->pwr_info.pwr_tx = cur_mode & 0xf;
1580-
ufshcd_config_pwr_mode(hba, &hba->max_pwr_info.info);
1581-
}
1582-
1583-
if (!(ufs->opts & EXYNOS_UFS_OPT_SKIP_CONNECTION_ESTAB))
1584-
exynos_ufs_establish_connt(ufs);
1585-
} else if (cmd == UIC_CMD_DME_HIBER_ENTER) {
1569+
if (cmd == UIC_CMD_DME_HIBER_ENTER) {
15861570
ufs->entry_hibern8_t = ktime_get();
15871571
exynos_ufs_gate_clks(ufs);
15881572
if (ufs->opts & EXYNOS_UFS_OPT_BROKEN_AUTO_CLK_CTRL)

0 commit comments

Comments
 (0)