Repository navigation
scsi: ufs: exynos: re-apply the UFS pin state when resuming with the link down (Pixel 9a) - #224
Conversation
|
Thank you, @W4HO-ham. Tracking a one-in-a-hundred dead wake down to two pads reading What I checked: the gate passes on today's The UFS fix is close. Two things before it merges:
Two wording points. The condition is The
For the root cause, one pointer. On gs101 and gs201, C2 runs with exynos-pmu's CPU PM hook ( So: the UFS commit (split in two) plus the boot on the tip, and this can merge. |
0fc569e to
3c67d3c
Compare
|
Thank you for the close reading, and for the The UFS fix is now two commits, as asked:
Same code as before apart from the comment, same sign-off, gate clean ( |
|
Thank you, @W4HO-ham, for turning this around so quickly. The split is I re-ran the checks on the new head: it merges cleanly onto today's One thing remains, the run on the published kernel, and one request about Two small things that don't block: the driver message's 300 cycles were on Once the run is in, this can merge. |
…link down On the Pixel 9a (zumapro) the UFS pads, gph5-0 (the device's reference clock) and gph5-1 (its reset), came back from a system suspend as plain inputs (CON 0) on about one wake in a hundred. The device then gets no clock and no reset, the host reports no device present through every link startup (HCS 0x8, no DP), and the resume fails with the root filesystem read-only until a reboot reprograms the pads. No host-side retry reaches a device whose pads are disconnected: a host reset, a longer reset pulse, a PHY power cycle, waits of up to 1.6 s between tries and a real VCC power cycle were each tried and each failed the same way. pinctrl-samsung's own save and restore of the bank is not enough here: its restore wrote the pads' CON back as 0x22 at every wake, and on the failing wakes the pads still read as inputs afterwards, so whatever takes their function away does it after that restore. Select the UFS node's pin state again in the resume callback whenever the link is down (hibern8 included, so at rpm_lvl 3 every runtime resume does it too), once the host's clocks are on. The node needs a "sleep" pin state for this, selected in the suspend callback, because pinctrl_select_state() is a no-op for an unchanged state; the zumapro device tree gets it in the next commit. With this change 300 RTC-woken s2idle cycles completed on a Pixel 9a, on the integration tree with the cores kept out of C2 for the sleep, with no storage failure (2026-11-07/08); before it one wake in 15 to 215 lost the storage. Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
The UFS host re-applies its pin state when it resumes with the link down, so that the pads come back as the UFS function after a system suspend (on the Pixel 9a they read as plain inputs on about one wake in a hundred). pinctrl_select_state() does nothing for an unchanged state, so the node needs a second state to switch away to: the "sleep" state names the same pin groups as the default. Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
3c67d3c to
73016ba
Compare
|
The published-tip run ran into something else first, worth knowing before the rebuild on today's tip goes on the palmtop. On |
|
Your read-only check, run on the palmtop (the owner's kernel #100, C2 states with the old On the published-tip run: with the main PMIC's interrupt added to the published tree (three small commits, coming as their own PR once signed off) the alarm works, and a first series gave 21 RTC wakes with no UFS line and then a 22nd sleep that never woke. I don't trust that boot as a published install, though: the kit pushed the Image and DTB only, so no module was loaded (no Wi-Fi, no GPU, no session, 16 failed units), and without a ramoops node it left no console. The rerun is going on the palmtop now, the same kernel ( |
|
The published-tip run, done properly this time: 36 of 36.
The series: 36 Two honest gaps. Wi-Fi was not up in this run: the shared config doesn't build the zuma PCIe PHY until omarchy-mobile#274 merges (now unblocked, since #187 is in), so |
|
Thank you, @W4HO-ham, for all of this in one afternoon, and for reporting it I re-ran the checks on this head: it merges cleanly onto today's And thank you for the counters across one sleep. 19.9 to 57.1 s of On the run. The missing PMIC interrupt is a real find: without it the The 22nd sleep is the part I need answered before this merges. Twenty-one
Please keep the first run of each of those kernels attended, as the sleep |
|
Run 4, with Wi-Fi, as you asked: 36 of 36 again. The same sources ( 36 |
|
The Power-key wake, attended (2026-11-09, 19:23 MST): one One difference from runs 3 and 4 to name: this boot was That completes what you listed for the re-run: 36 of 36 with modules and ramoops, 36 of 36 with Wi-Fi up, the UFS grep empty after every wake, and the Power-key wake. The no-wake of the first run hasn't come back in 73 sleeps on this tree, so I have no console for it; if it does, the comparison run without these two commits is the next step, as you said. |
|
One thing you should know before merging, though it isn't against this PR: an overnight series on the tip (2f890a5) with this, #236 and #237 on top woke 212 times and hung at the 213th sleep. The console survived, and it is a different failure from the one this PR fixes: storage never came into it, the kernel stayed alive, and CPU 7 stopped answering just after the device suspend (an RCU stall on it every 63 s until the reset). The lines and what I'm doing next are on omarchy-mobile#409. None of the 212 wakes, nor the Power-key wake before them, logged a UFS line. |
|
Thank you, @W4HO-ham. Run 4 with Wi-Fi up, the Power-key wake, and then 212 I re-ran the checks on this head against today's Last time I said this merges once the no-wake is gone or shown not to be
Two things would settle it without waiting for a lucky stack:
Please keep the first run of any new build attended, as the sleep rule asks; As soon as one console places that core outside the UFS suspend and the pin |
|
Thank you, that is a fair bar and a cheap one. Your reading of the Tonight's series runs with If the console puts that core inside |
|
Thank you, @W4HO-ham. Nothing has changed in the commits, so only where I re-ran the checks on this head against today's This waits for tonight's console and nothing else. Two things so that it
Good luck tonight. |
|
The no-wake came back tonight, on the 94th sleep of the boot, and the palmtop did not reboot by itself, so there is no console yet. What ran: the published tip plus these two commits with the function tracer built in ( The owner resets it by the buttons in the morning. The ramoops console survived that reset on 11-10, so I expect the PM debug lines of the last sleep to be there, and I'll post the lines around |
|
A correction to my comment above: there was no no-wake last night. I read a silent USB link as a hang, and it was a sleep with no alarm. What the journal of that boot shows (palmtop clock, MST): The series' third sleep woke on its alarm. Seven seconds later the shell's auto-sleep, which is on on this palmtop, took the dark resume back to sleep, as it is meant to: the screen was off behind the lock, no SSH session was open at that moment, and the series had released its keep-awake inhibitor at its first cycle. Nothing had armed an alarm for that sleep, so it lasted 9 hours 33 minutes, until the owner pressed the Power key in the morning, and it woke at once with no UFS line. In the first run the lock wasn't secure yet (the owner was at the palmtop), and in the two cycles before this one an SSH poll happened to be open ("not sleeping: an SSH session is open"). So on this build ( This is the trap of 11-10's 27-minute first sleep again, and it's mine: the series left the palmtop to the auto-sleep between its cycles. The series script now holds its own block inhibitor for the whole run and sleeps past it ( For your count: 93 alarm wakes with the PM switches on so far, and the long one. The next series runs tonight toward the 400; its script is changed, so its first run is attended. |
|
Thank you for the correction, and for making it as clearly as the first report: the journal lines with what asked for each sleep leave no doubt that the long one was the auto-sleep with no alarm, not a hang. I'd much rather read "I was wrong last night" at breakfast than find it out in a week. The fix for the series is on omarchy-mobile#659, and I've reviewed it there. Where this stands: the two commits are unchanged, and I re-ran the checks on this head against today's So the count is what's left, as I wrote last time. The hang hasn't come back, so it's the second branch: about 400 alarm wakes with the PM switches on, and I'll merge on those plus the 307. You have 93. Three requests for the rest:
If a hang does come back, the PM debug lines around |
|
The count is in: 406 alarm wakes with the PM switches on, no hang. Today's series, with the fixes you asked for on omarchy-mobile#659 in the script and the 60 s alarm (palmtop clock, MST, 2026-11-11):
Kernel With last night's 93 (90 of them 10 s alarms, as you noted) that is 406 with the switches on, 313 of them 60 s sleeps like the earlier series'. Not counted: 90 more this morning with a 35 s alarm on the script's first form, all woken by the alarm with no UFS line (they are in the note on #659). Who was there: nobody at the palmtop for the first cycles at 08:38; the owner saw it cycling at several points through the day and watched a few cycles at about 11:25. #659 has that as it was. The 9.5-hour sleep that woke at the first key press with no UFS line is in the SLEEP-PLAN note for this PR's record, as you asked. |
|
Thank you, @W4HO-ham. That is the count I asked for, and a clear one: 313 sleeps of 60 s on one boot with the PM switches on, every one woken by the alarm, I re-ran the checks on this head against today's So this merges as it is, both commits. Two things for the record, neither against the commits:
The no-wake with CPU 7 silent is still open, and it's the next thing I'd like to understand on this phone; the console from 11-10 and the tracing build are the right tools for it. |
One fix for suspend on the Pixel 9a (zumapro), the result of a long series on the palmtop, in two commits (the driver, then the zumapro device tree).
Dead storage after a wake. On about one wake in a hundred the UFS pads, gph5-0 (the device's reference clock) and gph5-1 (its reset), came back from a system suspend as plain inputs (
CON 0x0instead of the UFS function0x2, read from the13060000.pinctrldebugfs with the palmtop alive in that state). The device then gets no clock and no reset edge, the host reports no device present (HCS 0x8) through every link startup, the resume fails and the root filesystem goes read-only until a reboot reprograms the pads. Nothing on the host side reaches a device whose pads are disconnected: a host reset, a 1 ms reset pulse, a PHY power cycle, waits of up to 1.6 s between tries and a real VCC power cycle were each tried (kernels #90 to #94 indevice/tegu/SLEEP-PLAN.md) and each failed the same way. The first commit re-applies the UFS node's pin state inexynos_ufs_resume()for a link-off resume, with a "sleep" pinctrl state on the node so the default is really written again.The silent no-wake (every core in C2 during s2idle, the second failure of the series) is not in this PR any more: the
google,no-s2idleidle-state property it carried doesn't do what its message said (withenter_s2idlecleared,do_idle()still takes C2 through the ordinary entry), the property had no binding, and the published zumapro tree has no idle states. The fix will be a sleep hook inomamobile-device-teguthat disablescpuidle/state1for the sleep.Evidence (
device/tegu/SLEEP-PLAN.mdon omarchy-mobile#409, logs underlogs/tegu-linkwait-20261107/), all on the palmtop, kernel7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty(the integration tree) with the UFS fix (and the cores kept out of C2 for the sleep):systemctl suspendcycles, WFI-only (2026-11-07/08);Before the changes: one dead-storage wake in 15 to 215, and a silent no-wake after 6 to 135 cycles with C2.
Checks:
W=1on the touched objects andzumapro-tegu.dtb, 0 warnings;checkpatch --strictclean;tools/kernel-pr-checkpasses. What the series has not covered yet: this exact branch booted on the published tip (the runs were on the integration tree), and sleep with the modem on; both are on the plan. The watchdog-through-suspend diagnostic, the retry waits and the readback logging that found these are not part of this PR.