Repository navigation
Conversation
|
Tested on a J313 (M1 Air): fixes the fpwm1 restore on resume. No regression attributable to this PR so far.
The s2idle cycle here was One omarchy-m-test check failed on this boot: How this was tested
|
f2208ce to
72d49ac
Compare
|
Follow-up: second automated run and a hands-on real sleep.
How this was tested
|
|
Correction to my earlier follow-up: the |
820c3fe to
11603a9
Compare
On this J313 (t8103), s2idle resumes log: apple-pmgr-pwrstate power-controller@1e0: PS fpwm1: Failed to reach power state 0xf (requested 0xf, now: 0xa4f) fpwm1 is the keyboard-backlight PWM. genpd turns it off in suspend_noirq and back on in resume_noirq. The write of target 0xf has already landed. 0xa4f is that target, actual state clock-gate (0x4), WAS_CLKGATED, and BUSY. The 100 us poll expires while the state machine is still moving. genpd ignores the error in noirq and records the domain on, and the system_sleep path deliberately leaves the target latched. pwm-leds then writes the duty cycle from its resume callback, which runs only after every resume_early. A write into a block that is still clock-gated does not restore the backlight. The Apple ADT export lists no parent for fpwm1, and the same register later reads actual 0xf with no second request, so this is the state machine finishing late rather than a missing power-domains link. pms_fpwm1 stays clock-gated the whole time and is not that parent. Defer this one in-progress failure out of the noirq poll. resume_early runs after every noirq callback and before the LED resume write, and waits the 10 ms m1n1 already allows for a PS transition. Any other failure still reports at 100 us. The retry keeps the power_on auto-PM choice, so an apple,no-auto-pm domain is not switched to automatic PM. Signed-off-by: Lucas Goossen <lucas.goossen@hey.com>
11603a9 to
1e57136
Compare
On the MacBook Air M1 2020 (J313, t8103), s2idle resume powers fpwm1 (the keyboard backlight) back on in noirq, but the state machine is still clock-gated and BUSY (0xa4f) when the 100 us poll ends. genpd records the domain on anyway, then pwm-leds writes the duty cycle into a clock-gated block and the keys stay dark.
Defer that one in-progress power-on and finish it from resume_early, with the 10 ms poll m1n1 already uses, after noirq and before the LED resume write. Any other timeout still reports at 100 us.
The original patch did not apply onto 19f4965; this is the same restore ported onto the current driver, including apple,no-auto-pm.
Session build, Monday 26 Oct 2026 05:02 PM -03: linux-aurora 7.2.11-6-2-ARCH (package 7.2.11.aurora6-2), branch local/j313-test at 7638df0. makepkg exited 0. rustc 1.85.0, LLVM/clang 18.1.8. This machine is running that kernel. The stacked commit compiled in was 1d61113. This pull request's head is 72d49ac, which is not the commit that was built.
Two real s2idle cycles on this kernel showed no fpwm1 error. malik-na's real lid sleep showed the keyboard backlight on after resume.