Skip to content

Commit 6904d7e

Browse files
Sam ProtsenkoSylwester Nawrocki
authored andcommitted
clk: samsung: exynos850: Keep some crucial clocks running
Some clocks shouldn't be automatically disabled in clk_disable_unused(), otherwise kernel hangs. Mark those clocks with: - CLK_IS_CRITICAL flag, when there won't be any consumers for that clock, but system can't function when it's gated - CLK_IGNORE_UNUSED flag, when consumer driver will be probably added later That makes it possible to run the kernel without passing the "clk_ignore_unused" param. Next clocks were modified: - "gout_dpu_cmu_dpu_pclk": CLK_IGNORE_UNUSED Will be enabled later in DSIM driver (Display Serial Interface Master). - "gout_gpio_peri_pclk": CLK_IGNORE_UNUSED "gout_gpio_cmgp_pclk": CLK_IGNORE_UNUSED "gout_gpio_hsi_pclk": CLK_IGNORE_UNUSED Should be probably enabled in corresponding GPIO driver later, or made CLK_IS_CRITICAL. "gout_gpio_peri_clk" is actually used by LEDs on Exynos850-based dev board, so kernel hangs if this clock is not running. Other clocks were marked as "ignore unused" to prevent similar issues for other use cases or boards that might be added later. - "gout_cci_aclk": CLK_IS_CRITICAL CCI (Cache Coherent Interconnect): obviously is critical. - "gout_gic_clk": CLK_IS_CRITICAL GIC (Generic Interrupt Controller): obviously is critical. Signed-off-by: Sam Protsenko <[email protected]> Signed-off-by: Sylwester Nawrocki <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 62782ba commit 6904d7e

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

drivers/clk/samsung/clk-exynos850.c

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -559,9 +559,10 @@ static const struct samsung_gate_clock cmgp_gate_clks[] __initconst = {
559559
GATE(CLK_GOUT_CMGP_ADC_S1_PCLK, "gout_adc_s1_pclk",
560560
"gout_clkcmu_cmgp_bus",
561561
CLK_CON_GAT_GOUT_CMGP_ADC_PCLK_S1, 21, 0, 0),
562+
/* TODO: Should be enabled in GPIO driver (or made CLK_IS_CRITICAL) */
562563
GATE(CLK_GOUT_CMGP_GPIO_PCLK, "gout_gpio_cmgp_pclk",
563564
"gout_clkcmu_cmgp_bus",
564-
CLK_CON_GAT_GOUT_CMGP_GPIO_PCLK, 21, 0, 0),
565+
CLK_CON_GAT_GOUT_CMGP_GPIO_PCLK, 21, CLK_IGNORE_UNUSED, 0),
565566
GATE(CLK_GOUT_CMGP_USI0_IPCLK, "gout_cmgp_usi0_ipclk", "dout_cmgp_usi0",
566567
CLK_CON_GAT_GOUT_CMGP_USI_CMGP0_IPCLK, 21, 0, 0),
567568
GATE(CLK_GOUT_CMGP_USI0_PCLK, "gout_cmgp_usi0_pclk",
@@ -648,8 +649,9 @@ static const struct samsung_gate_clock hsi_gate_clks[] __initconst = {
648649
CLK_CON_GAT_HSI_USB20DRD_TOP_I_REF_CLK_50, 21, 0, 0),
649650
GATE(CLK_GOUT_USB_PHY_REF_CLK, "gout_usb_phy_ref", "oscclk",
650651
CLK_CON_GAT_HSI_USB20DRD_TOP_I_PHY_REFCLK_26, 21, 0, 0),
652+
/* TODO: Should be enabled in GPIO driver (or made CLK_IS_CRITICAL) */
651653
GATE(CLK_GOUT_GPIO_HSI_PCLK, "gout_gpio_hsi_pclk", "mout_hsi_bus_user",
652-
CLK_CON_GAT_GOUT_HSI_GPIO_HSI_PCLK, 21, 0, 0),
654+
CLK_CON_GAT_GOUT_HSI_GPIO_HSI_PCLK, 21, CLK_IGNORE_UNUSED, 0),
653655
GATE(CLK_GOUT_MMC_CARD_ACLK, "gout_mmc_card_aclk", "mout_hsi_bus_user",
654656
CLK_CON_GAT_GOUT_HSI_MMC_CARD_I_ACLK, 21, 0, 0),
655657
GATE(CLK_GOUT_MMC_CARD_SDCLKIN, "gout_mmc_card_sdclkin",
@@ -832,9 +834,10 @@ static const struct samsung_gate_clock peri_gate_clks[] __initconst = {
832834
CLK_CON_GAT_GOUT_PERI_WDT_0_PCLK, 21, 0, 0),
833835
GATE(CLK_GOUT_WDT1_PCLK, "gout_wdt1_pclk", "mout_peri_bus_user",
834836
CLK_CON_GAT_GOUT_PERI_WDT_1_PCLK, 21, 0, 0),
837+
/* TODO: Should be enabled in GPIO driver (or made CLK_IS_CRITICAL) */
835838
GATE(CLK_GOUT_GPIO_PERI_PCLK, "gout_gpio_peri_pclk",
836839
"mout_peri_bus_user",
837-
CLK_CON_GAT_GOUT_PERI_GPIO_PERI_PCLK, 21, 0, 0),
840+
CLK_CON_GAT_GOUT_PERI_GPIO_PERI_PCLK, 21, CLK_IGNORE_UNUSED, 0),
838841
};
839842

840843
static const struct samsung_cmu_info peri_cmu_info __initconst = {
@@ -908,10 +911,12 @@ static const struct samsung_div_clock core_div_clks[] __initconst = {
908911
};
909912

910913
static const struct samsung_gate_clock core_gate_clks[] __initconst = {
914+
/* CCI (interconnect) clock must be always running */
911915
GATE(CLK_GOUT_CCI_ACLK, "gout_cci_aclk", "mout_core_cci_user",
912-
CLK_CON_GAT_GOUT_CORE_CCI_550_ACLK, 21, 0, 0),
916+
CLK_CON_GAT_GOUT_CORE_CCI_550_ACLK, 21, CLK_IS_CRITICAL, 0),
917+
/* GIC (interrupt controller) clock must be always running */
913918
GATE(CLK_GOUT_GIC_CLK, "gout_gic_clk", "mout_core_gic",
914-
CLK_CON_GAT_GOUT_CORE_GIC_CLK, 21, 0, 0),
919+
CLK_CON_GAT_GOUT_CORE_GIC_CLK, 21, CLK_IS_CRITICAL, 0),
915920
GATE(CLK_GOUT_MMC_EMBD_ACLK, "gout_mmc_embd_aclk", "dout_core_busp",
916921
CLK_CON_GAT_GOUT_CORE_MMC_EMBD_I_ACLK, 21, 0, 0),
917922
GATE(CLK_GOUT_MMC_EMBD_SDCLKIN, "gout_mmc_embd_sdclkin",
@@ -977,8 +982,10 @@ static const struct samsung_div_clock dpu_div_clks[] __initconst = {
977982
};
978983

979984
static const struct samsung_gate_clock dpu_gate_clks[] __initconst = {
985+
/* TODO: Should be enabled in DSIM driver */
980986
GATE(CLK_GOUT_DPU_CMU_DPU_PCLK, "gout_dpu_cmu_dpu_pclk",
981-
"dout_dpu_busp", CLK_CON_GAT_CLK_DPU_CMU_DPU_PCLK, 21, 0, 0),
987+
"dout_dpu_busp",
988+
CLK_CON_GAT_CLK_DPU_CMU_DPU_PCLK, 21, CLK_IGNORE_UNUSED, 0),
982989
GATE(CLK_GOUT_DPU_DECON0_ACLK, "gout_dpu_decon0_aclk", "mout_dpu_user",
983990
CLK_CON_GAT_GOUT_DPU_ACLK_DECON0, 21, 0, 0),
984991
GATE(CLK_GOUT_DPU_DMA_ACLK, "gout_dpu_dma_aclk", "mout_dpu_user",

0 commit comments

Comments
 (0)