Repository navigation
Conversation
v27_lifecycle is taken by apple_dart_v27_claim() and stays held for as long as the sleep lease lasts. The claim runs in the suspend's async work and the lease is finished by the resume, from another task. A mutex has to be released by the task that took it. With lock checking on, the first T6050 deep sleep reports both ends: BUG: workqueue leaked atomic, lock or RCU: kworker/u73:1[211] locks held by kworker/u73:1/211: #0: (&dart->v27_lifecycle), at: apple_dart_v27_claim+0xf4/0xb80 WARNING: bad unlock balance detected! mutex_unlock apple_dart_v27_finish dcp_v27_late_disarm and lockdep turns itself off for the rest of the boot. A lock that changes hands is a semaphore. Make it one; no change to who waits for what. Signed-off-by: Jens Axboe <axboe@kernel.dk>
On a SoC with early_context the whole entry runs as cpu_suspend()'s finisher. cpu_suspend() calls the finisher after ct_cpuidle_enter(), with RCU not watching, which fits a finisher that only powers the core down. This one first checks the RTC alarm over SPMI under the controller's lock, stops the coprocessors, looks at work items and logs. With lock checking on, the first T6050 deep sleep reports each of them: RCU not watching for tracepoint WARNING: include/trace/events/lock.h:47 at lock_acquire _mutex_trylock_nest_lock apple_spmi_fifo_trylock t6050_sleep_pmu_xfer t6050_sleep_check_alarm apple_sleep_enter_saved cpu_suspend WARNING: suspicious RCU usage work_busy apple_nvme_m5_last_check apple_sleep_enter_saved Leave the idle state for the preparation and enter it again before the commit, which is the part that never returns. Signed-off-by: Jens Axboe <axboe@kernel.dk>
8 tasks done
|
Merge readiness at
Areas: Updated by pr-readiness on every push, edit and review, and every 30 minutes. Rules: merge policy · labels. |
DjDeveloperr
approved these changes
Nov 24, 2026
DjDeveloperr
left a comment
There was a problem hiding this comment.
Verdict: MERGE at 7d64087e
Blockers: none
Checked:
drivers/iommu/apple-dart.canddrivers/iommu/apple-dart-v27-late.inc: verified everyv27_lifecyclesite (sema_init(..., 1)inapple_dart_probe,down_trylock/uppolarity inapple_dart_v27_claim,apple_dart_v27_finish, andapple_dart_shutdown, plusDEFINE_GUARDdown/upinapple_dart_remove). Cross-task lease handoff from async suspend work to resume no longer trips mutex ownership/workqueue-leak lockdep checks, and thelost:pinning path inapple_dart_v27_finish()still holds the semaphore across shutdown without blockingapple_dart_shutdown().drivers/soc/apple/sleep.candarch/arm64/kernel/suspend.c: verifiedct_cpuidle_exit()/ct_cpuidle_enter()pairing inapple_sleep_enter_saved()againstcpu_suspend()on both the error-return and resume paths.apple_sleep_enter_prepare()runs with RCU watching and hardirqs masked,t6050_sleep_after_ans()setsr->spmi_masked = truebeforect_cpuidle_enter(), andapple_sleep_commit(0)/t6050_sleep_post_timer()perform raw MMIO/timer/WFI without locks, logging, or RCU. Non-early_contextSoCs (t8140,t8132,t8142) are untouched.- Pre-PR checklist (§1–§6): no model gating, no workarounds or new cmdline/module params, clean-room diff, human author/committer/Signed-off-by only (
208894259f59,7d64087e37aa), all 9 CI checks passing on7d64087e37aa, and exact-head T6050/K116s hardware evidence withCONFIG_PROVE_LOCKING=y(debug_locks: 1across 4 deep sleeps) and off. - Minor non-blocking note: the comment at
drivers/iommu/apple-dart-v27-late.inc:490still readsLifetime mutex/...(now a semaphore). J714s/J716c confirmation can follow on fleet merge as noted in the PR.
Evidence
- Head verified:
7d64087e37aa9f17d7e2c1504ff6efb8a6300f28(state: OPEN,mergeable: MERGEABLE, 2 commits:208894259f59,7d64087e37aa) - CI at
7d64087e37aa:host-tests,kunit,source,rust-build,DWC3/ATC builtin-no-atc,DWC3/ATC modular-no-atc,DWC3/ATC builtin-modular-atc,pr-text / pr-text,readiness / readiness— allcompleted / success - Hardware evidence in PR body at
7d64087e37aa: K116s (T6050, M5 Pro, fw 27.2),CONFIG_PROVE_LOCKING=y(4 consecutive deep sleeps, 0 lockdep reports,debug_locks: 1) and lock checking off, 3 deep sleeps resumed on same boot with panel and Wi-Fi back, 0 SELinux denials, 0 failed units, 0 new kernel errors
7 of 8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
With
CONFIG_PROVE_LOCKING=ythe first deep sleep on a T6050 trips two reports in the sleep code, and lockdep turns itself off for the rest of the boot (debug_locks: 0). Nothing after that first entry is lock-checked. Seen on a K116s (T6050, M5 Pro), firmware 27.2.Change
Two commits, both in code every T6050 sleep runs (J714s, J716c, and the K116s with #2201).
v27_lifecycleis taken byapple_dart_v27_claim()in the suspend's async work and released byapple_dart_v27_finish()at resume, from another task. A mutex has to be released by the task that took it; a lock that changes hands is a semaphore. Who waits for what is unchanged.early_contextthe whole entry iscpu_suspend()'s finisher, which is called afterct_cpuidle_enter(). Before the commit step this finisher takes the SPMI controller's lock for the alarm check, stops coprocessors, looks at work items and logs. The preparation now runs betweenct_cpuidle_exit()andct_cpuidle_enter(); the commit, the part that never returns, is as before.Testing
Tested: K116s (T6050, M5 Pro), firmware 27.2, with and without lock checking; rows below. Host tests 503/503 at the head.
Risk: two-way · T6050 machines with the firmware-driven sleep (J714s, J716c; K116s with #2201).
7d64087e37aaT6050 / K116s (M5 Pro), firmware 27.2: booted on a stack that contains these two commits unchanged (main974efa5 + drm/apple: J716c external displays and display sleep on firmware 27.2 #2187 + T6050: firmware-driven deep sleep on the K116s (16-inch M5 Pro, firmware 27.2) #2201 v10 + spmi: apple: recover every generation 4 controller from a failed exchange #2309 + wifi: apple: centauri: t6050: harden keep-alive sleep fallback, PME gating, and 27.2 TLV 280 #2877 + the lock fixes + my other K116s commits,7.3.0-m5pro-ge3fa7f0044df); 3 deep sleeps resumed on the same boot (rawrtcwake -m memwith Wi-Fi associated, logind suspend with an RTC alarm, rawrtcwake -m memwith Wi-Fi disconnected), panel and Wi-Fi back each time; 0 SELinux denials (not installed on this Debian), 0 failed units, 0 error-level kernel lines at boot, 0 new kernel errors at the wakes.The K116s does not sleep on
mainalone, so the rows are on a stack that contains these two commits unchanged:main+ #2187 + #2201 + #2309 + #2877 + #2206 + my other K116s commits. The command line is not the default (idle=nopamong others).debug_locks: 0afterwardsdebug_locks: 1at the endStill to run
J714s and J716c: not run here, I have neither. Both run this code on every sleep.
Standalone on
main: builds, host tests pass; no sleep row, see above.Clean-room: no Apple code, strings, firmware, RE output or tuning values
No chip/board/firmware-version gate where a hardware property can decide
Works on the default kernel command line; no hacks, delays or lab-only paths
Safety limits come from the machine, not from constants in code
Hardware safety rules followed for every test boot
Third-party commits unchanged; reporters and testers credited
Commits: human Signed-off-by only; no AI attribution in commits or PR text
Tested on the affected hardware; no regression