Repository navigation
clk: samsung: zumapro: Keep the PERIC0 GPIO bus clock on (Pixel 9a modem hang) - #172
Conversation
|
Thank you, @W4HO-ham. This is a lovely piece of detective work. The table makes the case well: ten sessions that all reset, two runs with the clock held by a module, then three runs with this commit, the longest 3759 link cycles with no reset. The register reads line up too: What I checked: the gate passes on today's Two things before it merges:
A small suggestion for the message, if you know it: say what stock does with this clock. If Google's pin controller never gates the GPIO bus clock, "keeping it on matches stock" is the strongest reason this is safe. If you don't know, leave it out. Once those are in and CI is green, I'll merge it. |
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>
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>
c36e4f4 to
52da429
Compare
|
Thanks, Derek. You were right about the sentence, and the reads back you up. The HSI2 gates. I read both on the palmtop, one register per read, as I did 0x20b8:
Both HSI2 gates are MANUAL with CG_VAL clear, the same state PERIC0's was in before the fix, and the clock summary shows them at enable count 0 between pin controller accesses. So the pin controller toggles them exactly as it toggled PERIC0's. No hang has been seen on those blocks, but their lines change rarely, and the PERIC0 hang followed the toggling rather than anything about that block. So I've marked them critical too, in a second commit: "clk: samsung: zumapro: Keep the HSI2 GPIO bus clocks on too". What stock does. Stock's zumapro device tree gives its pin controllers no clocks at all ( The message. "The only writable GPIO gate" is gone: it now says the PERIC0 gate is writable and in manual mode, and adds the stock note. Checks. Both commits are signed off now. W=1 builds of What hasn't run yet: a palmtop kernel with the HSI2 commit. The first commit is the one the GNSS sessions ran on. I'll boot the second with the next test kernel and add the clock summary here. |
|
The HSI2 commit has now run on the palmtop: a kernel with both commits from this PR ( On that boot the Wi-Fi (its PERST# and WL_REG_ON are on the HSI2 block) came up and came back after three rebinds, and UFS logged no errors. |
Base:
omamobile. One commit, one file. It still needs my sign-off before merge.What
CLK_GOUT_GPIO_PERIC0goes fromCLK_IGNORE_UNUSEDtoCLK_IS_CRITICAL, so the clock framework keeps the PERIC0 GPIO block's bus clock on.Why
This is the Pixel 9a hang that killed every GNSS session with the modem up (MODEM-PLAN G3-L1 on #202).
clk-zumapro.c. The APM and PERIC1 GPIO gates are read-only gates.CLK_CON_GAT0x20b8 reads0x100000between accesses: MANUAL set, CG_VAL clear, automatic gating off.Every session before this reset the palmtop by watchdog, after 37 to 1083 link cycles. The last kernel line moved from run to run: a config read, a doorbell, a DBI read, after the link had gone down. One run's pstore showed the SoC stalling piece by piece: Wi-Fi, then the APM's ACPM channel, then five CPUs in an RCU stall.
Testing
Pixel 9a,
7.3.0-rc6-omamobile-tegu-s2mpg15-m1, 600 s GNSS sessions with the CP ONLINE:After boot with this commit,
clk_enable_countis 1 and the gate register reads0x300000(CG_VAL set).tools/kernel-pr-check: checkpatch--strictclean, policy clean; only the sign-off is missing.