Skip to content

Commit 3f10f49

Browse files
AngeloGioacchino Del Regnobebarino
authored andcommitted
clk: mediatek: mt8195-infra_ao: Set pwrmcu clocks as critical
The pwrmcu is responsible for power management and idle states in SSPM: on older SoCs this was managed in Linux drivers like sspm/mcupm/eemgpu but, at least on MT8195, this functionality was transferred to the ATF firmware. For this reason, turning off the pwrmcu related clocks from the kernel will lead to unability to resume the platform after suspend and other currently unknown PM related side-effects. Set the PWRMCU and PWRMCU_BUS_H clocks as critical to prevent the kernel from turning them off, fixing the aforementioned issue. Fixes: e2edf59 ("clk: mediatek: Add MT8195 infrastructure clock support") Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20220719093316.37253-1-angelogioacchino.delregno@collabora.com Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent c39da7d commit 3f10f49

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

drivers/clk/mediatek/clk-mt8195-infra_ao.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,12 @@ static const struct mtk_gate_regs infra_ao4_cg_regs = {
5555
#define GATE_INFRA_AO1(_id, _name, _parent, _shift) \
5656
GATE_INFRA_AO1_FLAGS(_id, _name, _parent, _shift, 0)
5757

58+
#define GATE_INFRA_AO2_FLAGS(_id, _name, _parent, _shift, _flag) \
59+
GATE_MTK_FLAGS(_id, _name, _parent, &infra_ao2_cg_regs, _shift, \
60+
&mtk_clk_gate_ops_setclr, _flag)
61+
5862
#define GATE_INFRA_AO2(_id, _name, _parent, _shift) \
59-
GATE_MTK(_id, _name, _parent, &infra_ao2_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
63+
GATE_INFRA_AO2_FLAGS(_id, _name, _parent, _shift, 0)
6064

6165
#define GATE_INFRA_AO3_FLAGS(_id, _name, _parent, _shift, _flag) \
6266
GATE_MTK_FLAGS(_id, _name, _parent, &infra_ao3_cg_regs, _shift, \
@@ -136,8 +140,11 @@ static const struct mtk_gate infra_ao_clks[] = {
136140
GATE_INFRA_AO2(CLK_INFRA_AO_UNIPRO_SYS, "infra_ao_unipro_sys", "top_ufs", 11),
137141
GATE_INFRA_AO2(CLK_INFRA_AO_UNIPRO_TICK, "infra_ao_unipro_tick", "top_ufs_tick1us", 12),
138142
GATE_INFRA_AO2(CLK_INFRA_AO_UFS_MP_SAP_B, "infra_ao_ufs_mp_sap_b", "top_ufs_mp_sap_cfg", 13),
139-
GATE_INFRA_AO2(CLK_INFRA_AO_PWRMCU, "infra_ao_pwrmcu", "top_pwrmcu", 15),
140-
GATE_INFRA_AO2(CLK_INFRA_AO_PWRMCU_BUS_H, "infra_ao_pwrmcu_bus_h", "top_axi", 17),
143+
/* pwrmcu is used by ATF for platform PM: clocks must never be disabled by the kernel */
144+
GATE_INFRA_AO2_FLAGS(CLK_INFRA_AO_PWRMCU, "infra_ao_pwrmcu", "top_pwrmcu", 15,
145+
CLK_IS_CRITICAL),
146+
GATE_INFRA_AO2_FLAGS(CLK_INFRA_AO_PWRMCU_BUS_H, "infra_ao_pwrmcu_bus_h", "top_axi", 17,
147+
CLK_IS_CRITICAL),
141148
GATE_INFRA_AO2(CLK_INFRA_AO_APDMA_B, "infra_ao_apdma_b", "top_axi", 18),
142149
GATE_INFRA_AO2(CLK_INFRA_AO_SPI4, "infra_ao_spi4", "top_spi", 25),
143150
GATE_INFRA_AO2(CLK_INFRA_AO_SPI5, "infra_ao_spi5", "top_spi", 26),

0 commit comments

Comments
 (0)