Repository navigation
J713: docked deep sleep by default; brcmfmac reset after a sleep - #1855
Merged
Merged
Conversation
While deep sleep is the J713 default, a USB4/Thunderbolt device in a port makes the PHY refuse every system sleep: DWC3 stops its host at PM_SUSPEND_PREPARE, the PHY keeps its CIO mode, and with this parameter off nothing hands the link to the NHI. Turn the PCIe-C side of that handoff on by default. cio_s2r=0 still selects the old behaviour. With the handoff on, the port's suspend keeps its link for an s2idle and refuses one if the link can't be kept, instead of stopping the port as it did before. A DART that an older device tree gives no sleep path no longer has to fail the port's probe. The port then keeps the stock resume ordering and the NHI refuses a docked deep sleep, as with the parameter off. Signed-off-by: Erik Bourget <erik@ebourget.net>
…y default While deep sleep is the J713 default, a dock in a port blocks every system sleep unless the NHI owns the host router through it. Make that the default. The NHI still refuses a deep sleep it can't take over: one without a PCIe-C tunnel, with XDomain rings open, or with the cable state changing. cio_s2r=0 still refuses a docked deep sleep as before. Signed-off-by: Erik Bourget <erik@ebourget.net>
While the platform owns the radio for a system sleep, reset work is blocked: a pending reset is cancelled when the lease starts, a new one is not queued, and brcmf_pcie_reset() refuses. Nothing asked for the reset again when the lease ended, so firmware that died during the sleep stayed dead until the driver was reloaded. Note a reset the firmware death handler asked for and clear the note when a reset runs. When the lease ends, queue the reset again if it is still wanted. The recovery limit still applies, because only a death under that limit asks for a reset. Signed-off-by: Erik Bourget <erik@ebourget.net>
DjDeveloperr
approved these changes
Nov 13, 2026
DjDeveloperr
left a comment
Contributor
There was a problem hiding this comment.
Reviewed 324fb8579a02; approving. Thanks, Erik.
cio_s2rdefault on. Both uses stay behind the T8132 ACIO/PCIe-C hardware andapple,j713, so other machines takeapple_pcie_tunnel_add_link()as before. On the J713, an older DT whose DART has no sleep path now keeps the tunnel with a warning instead of failing the PCIe-C probe.- An undocked J713 sleep is unaffected. The NHI exists only between
apple_cio_start()andapple_cio_stop(), so with nothing plugged in its prepare never runs. A USB4 device without a PCIe tunnel is still refused, as before. - brcmfmac.
reset_wantedis set only after the recovery-limit check, so the limit still holds.- A reset that runs clears it.
- It is replayed only from
brcmf_pcie_sleep_finish(), the J713 radio lease's end. Elsewhere it is a flag that is set and cleared with no other effect.
- CI. host-tests passed on the merge with
ccc5a9d41de7. Since thenintegration/auroragained onlyasm/mmu_context.h(#1509) andg17/sleep.rs(#1839). Neither is near these files, and the merge with the current tip is clean. - J713 evidence: the docked deep sleep in the description. A follow-up we'd welcome: several docked sleeps on one boot, and a wake source other than the RTC.
Contributor
|
Merged as |
This was referenced Nov 13, 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.
Follow-ups to #1314 for the J713's deep sleep.
pcie_apple.cio_s2randthunderbolt_apple.cio_s2rnow default to on.PM_SUSPEND_PREPARE, the PHY keeps its CIO mode, and nothing hands the link to the NHI.apple,j713with the T8132 ACIO and PCIe-C), so other machines are unaffected.cio_s2r=0on either module restores the old behaviour.brcmf_pcie_reset()refuses. Nothing asked for the reset again when the lease ended, so firmware that died during the sleep stayed dead until the driver was reloaded.brcmfmac-sleep-lifetime-testswith a mutation that drops it. The recovery test checks the flag per reset and past the limit, with two new mutations.Validation on this branch:
cio_s2roption on the command line; both parameters readY.Not covered:
freezewhile deep is the default: it is still refused at the PHY, because DWC3 stops its host and the NHI handoff only runs for a deep sleep.These changes were developed and tested by Claude (Anthropic), working with me on the J713.