Repository navigation
PCI: apple: T6050: reset an unarmed N1 before firmware sleep - #2022
Merged
Merged
Conversation
On the J714s, a firmware sleep tears Wi-Fi and Bluetooth down without arming any radio wake, but leaves the N1 firmware running without its host. That firmware can then wake the system through the SMC's wifibt wake source long before the sleep's own wake time; in our runs it did so 16 to 28 s after the sleep's commit. Let the N1's driver request the DT-provided warm-reset sequence for this path. The host replays it in its noirq suspend, right after the link shuts down. This is a warm reset before the sleep; no reset signal is held asserted through the sleep. The existing reset and firmware reboot at the wake are unchanged. If the warm reset fails, refuse the sleep and restore the host before returning the error: the PM core does not run the noirq resume callback of the device whose noirq suspend failed. Recovery uses the existing link and DART restoration and its lost-port handling, so the children's noirq resume finds the port either up or marked unreachable. This covers only a sleep in which no radio wake is armed, which is every sleep with these drivers: they implement neither WoWLAN (magic packet or patterns) nor a paired Bluetooth device wake, and those remain unsupported. Signed-off-by: Diljit Singh <[email protected]>
This was referenced Nov 16, 2026
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.
On the J714s (MacBook Pro 14" M5 Pro), a deep sleep with Wi-Fi or Bluetooth up ends early: the SMC records the
wifibtwake source well before the RTC alarm, typically 16 to 28 s after the commit. The firmware-sleep path tears both radios' host drivers down and arms no wake, but leaves the N1 firmware running without its host.This makes the N1's driver ask the PCIe host, for that path, to replay the DT's warm-reset sequence for the N1 right after the link shuts down in the host's noirq suspend. If that reset fails, the host attempts to bring its port and DART back the way a wake does and returns the original error, so the sleep is refused. When that restoration succeeds, the radios are enumerated again as after an abandoned suspend; when it fails, the existing lost-port handling keeps the port's functions unreachable until a restart.
pcie-apple:apple_pcie_t6050_sleep_reset()for the endpoint's driver; the replay in the noirq suspend afterapple_pcie_t6050_sleep_down();apple_pcie_t6050_warm_reset()returns its error.centauriT6050: the request from both firmware-sleep branches of its suspend.macsmc: comments only (apple_smc_write_noirq()is now also called from a noirq suspend).J714s only: the host's T6050 sleep path is set up only on
apple,j714s, and only that board's DT has the warm-reset writes. Other boards and SoCs, the T8140 included, run none of the changed code.Does not change
Not in this PR: wake on WLAN and wake from a paired Bluetooth device. The drivers implement neither (
iw phy ... wowlan showreturnsEOPNOTSUPP), before and after this change; a configured radio wake needs a firmware sleep handover that does not exist yet.Testing
J714s, this head plus private test/board-data commits only (no other code), built natively; Wi-Fi associated and Bluetooth powered before every sleep; RTC alarm about 29 s after entry.
.enterrefusal (after the replay)endpoint warm reset replayed before sleep).hci0came back, NetworkManager reconnected, and the GPU, AOP, SIO and camera were back as before.Without this change, on the same board and test setup, the same kind of run ended on
wifibtin 5 of 6 sleeps in one run and 6 of 6 in another, up to 5.5 s before the alarm.Not run on hardware: the refusal path when the warm reset itself fails (no fault injection).
Checks
make ARCH=arm64 LLVM=1 Image modules) of this commit with the M5 kit's configuration: links (vmlinux, Image, 1771 modules), no warnings in the touched files.--strict): 0 errors, 1 warning (the author name against the sign-off's), 0 checks.🤖 Generated with Claude Code