Skip to content

Commit 6aff357

Browse files
petegriffinkrzk
authored andcommitted
clk: samsung: gs101: make all ufs related clocks critical
Enabling UFSHCD_CAP_HIBERN8_WITH_CLK_GATING in the UFS driver means all UFS clocks are gated/ungated, which leads to the UFS IP getting into a bad state and being completely non functional. Downstream these clocks are all left in Automatic Clock Gate (ACG) mode, and are not exposed to the UFS driver in DT. Enabling ACG is ultimately what we need to do in the upstream Samsung clock driver as well. However until ACG is enabled upstream, we mark these clocks as critical to avoid them being disabled. This then allow us to enable UFSHCD_CAP_HIBERN8_WITH_CLK_GATING and have UFS hibern8. Whilst this may seem at first glance a strange thing to do, the clocks between UFS host and UFS device are still gated after this change, and enabling UFS hibern8 leads to substantially cooler device when running the upstream kernel on a Pixel 6 phone. This change only effects the clocks from the CMU to the UFS IP. Signed-off-by: Peter Griffin <peter.griffin@linaro.org> Link: https://lore.kernel.org/r/20241018130215.487425-1-peter.griffin@linaro.org Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
1 parent 5e830d3 commit 6aff357

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/clk/samsung/clk-gs101.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2775,11 +2775,11 @@ static const struct samsung_gate_clock hsi2_gate_clks[] __initconst = {
27752775
GATE(CLK_GOUT_HSI2_QE_UFS_EMBD_HSI2_ACLK,
27762776
"gout_hsi2_qe_ufs_embd_hsi2_aclk", "mout_hsi2_bus_user",
27772777
CLK_CON_GAT_GOUT_BLK_HSI2_UID_QE_UFS_EMBD_HSI2_IPCLKPORT_ACLK,
2778-
21, 0, 0),
2778+
21, CLK_IS_CRITICAL, 0),
27792779
GATE(CLK_GOUT_HSI2_QE_UFS_EMBD_HSI2_PCLK,
27802780
"gout_hsi2_qe_ufs_embd_hsi2_pclk", "mout_hsi2_bus_user",
27812781
CLK_CON_GAT_GOUT_BLK_HSI2_UID_QE_UFS_EMBD_HSI2_IPCLKPORT_PCLK,
2782-
21, 0, 0),
2782+
21, CLK_IS_CRITICAL, 0),
27832783
GATE(CLK_GOUT_HSI2_CLK_HSI2_BUS_CLK,
27842784
"gout_hsi2_clk_hsi2_bus_clk", "mout_hsi2_bus_user",
27852785
CLK_CON_GAT_GOUT_BLK_HSI2_UID_RSTNSYNC_CLK_HSI2_BUS_IPCLKPORT_CLK,
@@ -2806,7 +2806,7 @@ static const struct samsung_gate_clock hsi2_gate_clks[] __initconst = {
28062806
GATE(CLK_GOUT_HSI2_SYSREG_HSI2_PCLK,
28072807
"gout_hsi2_sysreg_hsi2_pclk", "mout_hsi2_bus_user",
28082808
CLK_CON_GAT_GOUT_BLK_HSI2_UID_SYSREG_HSI2_IPCLKPORT_PCLK,
2809-
21, 0, 0),
2809+
21, CLK_IS_CRITICAL, 0),
28102810
GATE(CLK_GOUT_HSI2_UASC_PCIE_GEN4A_DBI_1_ACLK,
28112811
"gout_hsi2_uasc_pcie_gen4a_dbi_1_aclk", "mout_hsi2_bus_user",
28122812
CLK_CON_GAT_GOUT_BLK_HSI2_UID_UASC_PCIE_GEN4A_DBI_1_IPCLKPORT_ACLK,
@@ -2842,15 +2842,15 @@ static const struct samsung_gate_clock hsi2_gate_clks[] __initconst = {
28422842
GATE(CLK_GOUT_HSI2_UFS_EMBD_I_ACLK,
28432843
"gout_hsi2_ufs_embd_i_aclk", "mout_hsi2_bus_user",
28442844
CLK_CON_GAT_GOUT_BLK_HSI2_UID_UFS_EMBD_IPCLKPORT_I_ACLK,
2845-
21, 0, 0),
2845+
21, CLK_IS_CRITICAL, 0),
28462846
GATE(CLK_GOUT_HSI2_UFS_EMBD_I_CLK_UNIPRO,
28472847
"gout_hsi2_ufs_embd_i_clk_unipro", "mout_hsi2_ufs_embd_user",
28482848
CLK_CON_GAT_GOUT_BLK_HSI2_UID_UFS_EMBD_IPCLKPORT_I_CLK_UNIPRO,
28492849
21, CLK_IS_CRITICAL, 0),
28502850
GATE(CLK_GOUT_HSI2_UFS_EMBD_I_FMP_CLK,
28512851
"gout_hsi2_ufs_embd_i_fmp_clk", "mout_hsi2_bus_user",
28522852
CLK_CON_GAT_GOUT_BLK_HSI2_UID_UFS_EMBD_IPCLKPORT_I_FMP_CLK,
2853-
21, 0, 0),
2853+
21, CLK_IS_CRITICAL, 0),
28542854
/* TODO: should have a driver for this */
28552855
GATE(CLK_GOUT_HSI2_XIU_D_HSI2_ACLK,
28562856
"gout_hsi2_xiu_d_hsi2_aclk", "mout_hsi2_bus_user",

0 commit comments

Comments
 (0)