Repository navigation
soc: apple: sleep: T6050: a sleep with no RTC alarm armed is not refused - #2698
Conversation
The T6050 entry refuses a sleep unless the PMU's RTC alarm is armed and
unmasked ("SoC check: -16"), so a lid close with no alarm set never
sleeps. The alarm is one wake source among several: the SMC wakes the
machine for the lid and the keyboard without it.
Accept a sleep with no alarm armed. The alarm is then not held against
the sleep timer in the final check and not rearmed after the commit.
With an alarm armed nothing changes.
Tested on a K116s: deep sleep with no alarm, woken by the lid.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
Looks right. Requiring an armed RTC alarm was stricter than the wake sources need, since the SMC wakes for the lid and keys without it, and with an alarm armed the path is unchanged. The commit rearm is already skipped without a valid alarm, so a lid-only sleep has nothing left to rearm. The J714s 67 s and 2 h 28 min lid sleeps, plus the K116s history, cover the case this enables. The remaining gap you list, an RTC-alarm sleep on the J714s with this commit, is worth one run before merge, since that's the path a scheduled wake (and the lab's dead-man) depends on. Assisted-by: LLM (Claude:Opus 5.5) |
|
Ryan, for the alarm path with the commit, the K116s side from today: one 30 s RTC-alarm deep sleep on |
J714s (M5 Pro, T6050) Hardware Row —
|
DjDeveloperr
left a comment
There was a problem hiding this comment.
Reviewed head 26bf5f527f1e67bb6807fbc2490d0b0a6b8fc0b7 against pre-pr-checklist.md.
Verdict: Approve (no blockers)
Code & correctness (drivers/soc/apple/sleep-t6050.h, +5/-1)
t6050_sleep_check_alarm()clearsr->alarm_valid = falseon entry, still fails closed on any SPMI/PMU read error, and returns0when the RTC alarm is neither armed nor unmasked (!(control & T6050_RTC_CTL_ARMED) || (mask & BIT(0))), leavingr->alarm_valid = false.t6050_sleep_final_check()re-runst6050_sleep_check_alarm()before the irreversible enclave/commit boundary and returns0when!r->alarm_valid, avoiding stalealarm_comparechecks if an alarm is disarmed between.checkand.final_check.- Armed-alarm sleeps preserve the full
T6050_RTC_COMPARE/T6050_RTC_COUNTERproximity check (-ETIME) and post-timer rearm path unchanged. - Non-T6050 SoCs are untouched, and there is no semantic conflict with current
integration/aurora(t6050_sleep_pmu_wakedoes not depend onalarm_valid).
Non-blocking nit
drivers/soc/apple/sleep-t6050.h:692-695(t6050_sleep_post_timer):if (!r->alarm_valid || !r->alarm_rearm_valid) { r->pmu_errors++; return; }still incrementsr->pmu_errorswhen no alarm is armed. Sincer->pmu_errorsis only reported indev_dbg()int6050_sleep_finish(), this has no functional effect, but a clean no-alarm sleep will logPMU 1/0under dynamic debug; returning early on!r->alarm_validwithout bumpingpmu_errorswould be cleaner in a follow-up.
Checklist & evidence
- No model/board/firmware gating, default cmdline, safety, clean-room: Pass. Gates purely on PMU RTC register state.
- Attribution: Pass. Single commit
26bf5f527f1ecarries human identity andSigned-off-by: Jens Axboe <axboe@kernel.dk>only (no agent trailers). - CI: 7/7 checks green (
host-tests,source,rust-build,kunit, and all threeDWC3/ATCbuilds); mergeable/clean. - Hardware evidence: Both paths are covered across two T6050 boards:
- J714s (M5 Pro, T6050): exact-head 3/3 RTC-alarm
deepsleeps PASS with full subsystem and regression check (0 DART faults, 0 oops/WARN, 0 SELinux AVCs, 0 new failed units) in #issuecomment-7068612666, plus 2/2 no-alarm lid-closedeepsleeps PASS (67 s and 2 h 28 min, vs pre-patchSoC check: -16refusal) in #2201#issuecomment-7046639840. - K116s (T6050): 4 no-alarm lid sleeps and 1 RTC-alarm 30 s deep sleep on the same boot (#issuecomment-7066031200).
- (Note: #issuecomment-7068612666 verified the RTC-alarm regression path on exact head
26bf5f527f1e; the J714s no-alarm lid-close proof is carried from Isaac's 2/2 row on the same 5-line commit in #2201.)
- J714s (M5 Pro, T6050): exact-head 3/3 RTC-alarm
Assisted-by: LLM (Google:Gemini 4 Neon)
97868a7
into
aurora-silicon:integration/aurora
Split out of #2201 at Isaac's request (#2201 (comment), his J714s row): it is the one commit a J714s needs from that series for a lid close to deep-sleep, and it depends on nothing else there.
Problem. The T6050 entry refuses a sleep unless the PMU's RTC alarm is armed and unmasked:
So
rtcwake -m memsleeps and a lid close does not; logind retries about every 30 s while the lid stays shut. The alarm is one wake source among several: the SMC wakes the machine for the lid and the keys without it.Fix.
t6050_sleep_check_alarm()returns 0 with no alarm armed, andt6050_sleep_final_check()then has nothing to hold against the sleep timer. The rearm after the commit is already skipped without a valid alarm. With an alarm armed nothing changes. One commit, 5 lines added.Tested
integration/aurora0abc2f3 plus his carried PRs: refused before, 2 of 2 lid sleeps with it (67 s and 2 h 28 min), woken by the lid.Not tested: an RTC-alarm sleep on the J714s with the commit (Isaac ran those without it); any other T6050 board.
#2201 drops its copy when this is in.