Repository navigation
wifi: centauri: recover after DMA was released before physical reset - #2144
Conversation
Successful firmware suspend releases Control IPC, firmware and descriptor backing and the Bluetooth arena before the host resets N1. The old Alpha and Beta PCI objects can survive that reset while their config space is hidden. Deferred recovery then fences them again despite owning no DMA, refuses with -EBUSY and leaves Wi-Fi absent after an otherwise successful RTC wake. Fence each bound or independent owner while any authoritative DMA tuple remains. Keep producer shutdown, identity checks, leases and refusal when backing is retained; do not treat reset as proof that live DMA is safe. Add production-function extraction tests covering physical-reset recovery, retained allocations, failed quiesce/release, identity changes and retry. Both guard reversions and six tuple omissions must compile and fail a runtime assertion. Extend the existing recovery mock with its arena field. GCC and Clang focused host checks pass. Native kernel compilation and physical validation of this follow-up remain pending the storage gate.
|
This looks like the failure I hit on the K116s (T6050, firmware 27.2) and sent #2141 for a few hours earlier: after a real deep sleep the wake's recovery ends in The two PRs take different routes:
#2141 is tested on hardware: three RTC deep-sleep cycles plus four ordinary sleeps on the K116s, Wi-Fi and Bluetooth back each time. Two things I can't tell from here:
I can run this branch on the K116s once it is out of draft, so we know whether one of the two is enough or they should be combined. |
|
J714s (14-inch M5 Pro) hardware result: this fixes it. The commit is cherry-picked unchanged (1e56c6f) onto 0abc2f3 plus my carried PRs. Without it (the same base with #2441 on top; one deep sleep, woken by its RTC alarm after about 20 s): Wi-Fi and Bluetooth stayed gone, and every later s2idle was refused ( With it: five deep sleeps in one boot. Two woke within seconds (a key, then the SMC's No Not tested: sleeps longer than 30 s, a suspend given up half way, and the case where the wake's reset write fails. |
|
Merged as Hardware evidence comes from @Isaac-Duarte's J714s run above: five deep sleeps, with Wi-Fi and BT back every time and no Review (independent, code only): no blocking issue.
Local checks: The local object compile is queued behind a host I/O stall. Isaac's kernel built this exact code: the touched files are identical between his base Nits for later:
@axboe: #2141 can now be checked against this on the K116s. Update 00:45: the local object compile has now passed. All touched objects built with the M5 asahi config at W=1 with no compiler warnings, on integration |
After a J714s RTC sleep returned successfully, N1 recovery refused with
DMA resources retained (-16, original 0)and Wi-Fi stayed absent. Successful suspend had already freed the DMA allocations; deferred removal tried to fence the old Alpha/Beta PCI objects again after hardware reset hid their config space.Fence bound and independent teardown only while an authoritative IPC, firmware, descriptor or Bluetooth arena allocation remains. Producer shutdown, identity checks, domain leases and refusal with retained backing are preserved. Reset is not used as proof that live DMA is safe.
Add extraction tests for 15 production functions covering reset-hidden PCI objects, individually retained tuples, pending-transaction retry, producer/release failure and identity changes. Both guard reversions and six tuple omissions must compile and fail runtime assertions. The legacy recovery mock gains its existing arena field.
Validation:
1e56c6f890df49178daad301f700d9564d676898.3f1a7fb18168f4635ab759d3f730a0eb38c98ce3, release7.3.0-m5-n1r4, with 1,774 modules and 1,950 boot DTBs. Full config unchanged; independent guard passed and cleanup/lock release verified. Unrelated working HPM edits stayed untouched; a pinned private compiler view supplied the committed HPM input.The recovered failing RTC row reports AP76 only, GFX0 and zero MBSW8, with approximately 41.6 seconds physical sleep; that original row remains failed due to N1 recovery. Original intg9/default and display layout were restored and released. Packaging and fresh R4 returning/physical recovery validation are next. Ordinary suspend remains masked.
Draft pending coordinated hardware recovery validation; no long-hold or flawless-deep-sleep claim.