Skip to content

Commit 0370395

Browse files
Michal Wilczynskipdp7
authored andcommitted
clk: thead: Mark essential bus clocks as CLK_IGNORE_UNUSED
Probing peripherals in the AON and PERI domains, such as the PVT thermal sensor and the PWM controller, can lead to boot hangs or unresponsive devices on the LPi4A board. The root cause is that their parent bus clocks ('CLK_CPU2AON_X2H' and the 'CLK_PERISYS_APB' clocks) are automatically gated by the kernel's power-saving mechanisms when the bus is perceived as idle. Alternative solutions were investigated, including modeling the parent bus in the Device Tree with 'simple-pm-bus' or refactoring the clock driver's parentage. The 'simple-pm-bus' approach is not viable due to the lack of defined bus address ranges in the hardware manual and its creation of improper dependencies on the 'pm_runtime' API for consumer drivers. Therefore, applying the'`CLK_IGNORE_UNUSED' flag directly to the essential bus clocks is the most direct and targeted fix. This prevents the kernel from auto-gating these buses and ensures peripherals remain accessible. This change fixes the boot hang associated with the PVT sensor and resolves the functional issues with the PWM controller. Link: https://lore.kernel.org/all/[email protected]/ [1] Reviewed-by: Drew Fustini <[email protected]> Acked-by: Stephen Boyd <[email protected]> Signed-off-by: Michal Wilczynski <[email protected]> Signed-off-by: Drew Fustini <[email protected]>
1 parent 19272b3 commit 0370395

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/clk/thead/clk-th1520-ap.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -792,11 +792,12 @@ static CCU_GATE(CLK_AON2CPU_A2X, aon2cpu_a2x_clk, "aon2cpu-a2x", axi4_cpusys2_ac
792792
0x134, BIT(8), 0);
793793
static CCU_GATE(CLK_X2X_CPUSYS, x2x_cpusys_clk, "x2x-cpusys", axi4_cpusys2_aclk_pd,
794794
0x134, BIT(7), 0);
795-
static CCU_GATE(CLK_CPU2AON_X2H, cpu2aon_x2h_clk, "cpu2aon-x2h", axi_aclk_pd, 0x138, BIT(8), 0);
795+
static CCU_GATE(CLK_CPU2AON_X2H, cpu2aon_x2h_clk, "cpu2aon-x2h", axi_aclk_pd,
796+
0x138, BIT(8), CLK_IGNORE_UNUSED);
796797
static CCU_GATE(CLK_CPU2PERI_X2H, cpu2peri_x2h_clk, "cpu2peri-x2h", axi4_cpusys2_aclk_pd,
797798
0x140, BIT(9), CLK_IGNORE_UNUSED);
798799
static CCU_GATE(CLK_PERISYS_APB1_HCLK, perisys_apb1_hclk, "perisys-apb1-hclk", perisys_ahb_hclk_pd,
799-
0x150, BIT(9), 0);
800+
0x150, BIT(9), CLK_IGNORE_UNUSED);
800801
static CCU_GATE(CLK_PERISYS_APB2_HCLK, perisys_apb2_hclk, "perisys-apb2-hclk", perisys_ahb_hclk_pd,
801802
0x150, BIT(10), CLK_IGNORE_UNUSED);
802803
static CCU_GATE(CLK_PERISYS_APB3_HCLK, perisys_apb3_hclk, "perisys-apb3-hclk", perisys_ahb_hclk_pd,

0 commit comments

Comments
 (0)