Repository navigation
Conversation
07c5c5e to
f23657c
Compare
Commit 53c1f63 ("wifi: apple: centauri: retain ownership across failed suspend") releases no DMA memory until each function's Command register reads back with bus mastering off. After a deep sleep on a K116s (T6050, firmware 27.2), the host has reset the endpoint before the port came up, and functions 1 and 2 read all-ones from configuration space until they are enumerated again. The read-back can never pass, the recovery is refused, and Wi-Fi and Bluetooth stay gone until a reboot: pci 0000:01:00.1: Unable to change power state from unknown to D0, device inaccessible btcentauri_t6050 0000:01:00.2: Unable to change power state from unknown to D0, device inaccessible pcieport 0000:00:00.0: N1 recovery refused: DMA resources retained (-16, original 0) A function that reads all-ones after the host has reset the endpoint for this wake is not a bus master. Accept it as stopped in both checks. Any other state is judged as before. The Bluetooth host test models the new check and covers both outcomes. Fixes: 53c1f63 ("wifi: apple: centauri: retain ownership across failed suspend") Signed-off-by: Jens Axboe <axboe@kernel.dk>
f23657c to
b292418
Compare
|
Review now that #2144 has landed (integration/aurora 67e6c99; the Centauri files haven't changed since): #2144 should cover the K116s case you hit, which makes this PR redundant on top of it. Why:
Rebase status. The rebase onto #2144 is clean: GitHub reports it mergeable, and the only change from the 11-17 version is the Retest, please. Build a K116s kernel from integration/aurora at or after 67e6c99 with #2201, but without this PR. #2201's head 965c1b5 doesn't contain 67e6c99 yet, so it needs a rebase or merge first. Do one real deep sleep and check that Wi-Fi and BT come back, with no
🤖 Generated with Claude Code |
|
Note 🤖 Claude Opus 5.5 responding on behalf of erikwb Tested on a J716c (16" M5 Max, T6050, 27.2 stub), base integration/aurora b3445d7 plus a few unrelated trial commits. That base predates #2144. All runs were 30 s RTC deep sleeps (
So on the J716c, #2144 covers this, as @DjDeveloperr expected. This PR isn't needed on top of it. (Edited: the first version of this comment compared against a base without #2144.) |
|
Retested on the K116s (firmware 27.2) without this PR: One deep sleep by the lid, woken by the lid. The endpoint is reset as before ( #2144 covers it here as well. Closing; thanks DjDeveloperr and Erik. |
#2113 (53c1f63) breaks Wi-Fi and Bluetooth after a real deep sleep. Seen on a K116s (16" M5 Pro, T6050, firmware 27.2); the wake itself is fine, the N1 never comes back until a reboot:
Cause. The new fence frees nothing until each function's Command register reads back with bus mastering off. After a deep sleep the host has reset the endpoint before the port came up, and functions 1 and 2 read all-ones from configuration space until they are enumerated again (an instrumented run printed
Command 0xfffffor both). The read-back can never pass.pm_test=devicescycles do not show this, since the endpoint is never reset there.Fix. In
centauri_t6050_stop_dma()andcen_dma_stopped(): a function that reads all-ones, on an endpoint the host has reset for this wake (apple_pcie_t6050_warm_reset_done()), counts as stopped. Any other state is judged as before. One commit, 11 lines added.Tested on the K116s, on integration/aurora dcce0e7 plus the K116s sleep series from #2075:
Not tested: J714s or any other board; a suspend that fails part-way (the case #2113 was written for); s2idle.
One thing for review:
t6050_warm_donestays set from the wake until the nextPM_SUSPEND_PREPARE, so the exception is open for that long, though only for a function that does not answer at all. If you would rather have it tied to the recovery work itself, say so and I will rework it.