From 31e0a8a87d12a8609e7ef0e13d869049f08cc363 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Sat, 31 Oct 2026 21:40:53 -0647 Subject: [PATCH 1/2] clk: samsung: zumapro: Keep the PERIC0 GPIO bus clock on The PERIC0 GPIO gate is writable and in manual mode (CLK_CON_GAT 0x20b8 reads 0x100000: MANUAL set, automatic clock gating off). The Samsung pin controller enables its pclk around every register access and disables it afterwards, so each GPIO write on the block turns the gate on and off. Stock never does this: its device tree gives zumapro's pin controllers no clocks, so Google's pin controller never switches the GPIO bus clocks off. On the Pixel 9a the modem's AP2CP control lines are on this block and toggle on every PCIe link power cycle, about twice a second during a GNSS session. With the gate toggling, the SoC hung within 37 to 1083 link cycles in every session, at varying points, with no kernel error and a watchdog reset. With the clock held on (a bring-up module taking a reference) two 600 s sessions ran 1325 and 1326 link cycles each with no hang, and the same result followed with this change in the kernel. Mark the gate critical so the clock framework keeps it enabled. Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com> --- drivers/clk/samsung/clk-zumapro.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/clk/samsung/clk-zumapro.c b/drivers/clk/samsung/clk-zumapro.c index 2db80e4f45..a2811b7fd0 100644 --- a/drivers/clk/samsung/clk-zumapro.c +++ b/drivers/clk/samsung/clk-zumapro.c @@ -759,9 +759,15 @@ static const struct samsung_div_clock peric0_dividers[] __initconst = { "zumapro_mout_peric0_usi6_user", 0x1824, 0, 4, 0, CLK_DIVIDER_READ_ONLY), }; +/* + * The GPIO block's bus clock stays on. The gate is in manual mode (no + * automatic clock gating on this CMU here), and the pin controller turns + * it off after every register access; with the modem's AP2CP lines on + * this block toggling twice a second, the SoC hung within minutes. + */ static const struct samsung_gate_clock peric0_gates[] __initconst = { GATE(CLK_GOUT_GPIO_PERIC0, "zumapro_gpio_peric0", "zumapro_peric0_noc_user", - 0x20b8, 21, CLK_IGNORE_UNUSED, 0), + 0x20b8, 21, CLK_IS_CRITICAL, 0), }; static const struct samsung_gate_clock peric0_ro_gates[] __initconst = { From 52da429eb3cc9e30b522c27fb8fa549c6cd3abdd Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Mon, 2 Nov 2026 08:50:50 -0647 Subject: [PATCH 2/2] clk: samsung: zumapro: Keep the HSI2 GPIO bus clocks on too CMU_HSI2's two GPIO gates, for pinctrl_hsi2ufs (0x2008) and pinctrl_hsi2 (0x2060), are writable and in the same manual mode as PERIC0's: on the Pixel 9a both CLK_CON_GAT registers read 0x100000 (MANUAL set, CG_VAL clear), and the clock summary shows them at enable count 0 between pin controller accesses. So the pin controller turns them on and off around every access, as it did PERIC0's. No hang has been seen on these blocks: their lines (the Wi-Fi's PERST# and WL_REG_ON on gph3, the UFS pins) change rarely. But the PERIC0 hang followed the gate toggling, not anything specific to that block, and stock's pin controllers name no clocks, so Google's kernel never gates any GPIO bus clock. Mark both gates critical as well. Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com> --- drivers/clk/samsung/clk-zumapro.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/clk/samsung/clk-zumapro.c b/drivers/clk/samsung/clk-zumapro.c index a2811b7fd0..4e47c45c12 100644 --- a/drivers/clk/samsung/clk-zumapro.c +++ b/drivers/clk/samsung/clk-zumapro.c @@ -287,10 +287,11 @@ static const struct samsung_gate_clock hsi2_gates[] __initconst = { 0x20d0, 21, CLK_IGNORE_UNUSED, 0), GATE(CLK_GOUT_SYSREG_HSI2, "zumapro_sysreg_hsi2", "zumapro_hsi2_noc_user", 0x20e8, 21, CLK_IGNORE_UNUSED, 0), + /* GPIO bus clocks stay on, as for PERIC0's below */ GATE(CLK_GOUT_GPIO_HSI2UFS, "zumapro_gpio_hsi2ufs", "zumapro_hsi2_noc_user", - 0x2008, 21, CLK_IGNORE_UNUSED, 0), + 0x2008, 21, CLK_IS_CRITICAL, 0), GATE(CLK_GOUT_GPIO_HSI2, "zumapro_gpio_hsi2", "zumapro_hsi2_noc_user", - 0x2060, 21, CLK_IGNORE_UNUSED, 0), + 0x2060, 21, CLK_IS_CRITICAL, 0), GATE(CLK_GOUT_PCIE1_CTL_APB, "zumapro_pcie1_ctl_apb", "zumapro_hsi2_noc_user", 0x2094, 21, CLK_IGNORE_UNUSED, 0), GATE(CLK_GOUT_PCIE1_DBI_ACLK, "zumapro_pcie1_dbi_aclk",