Repository navigation
PCI: apple: t8140: bring the radios back after a sleep off resume_noirq - #1717
Merged
Merged
Conversation
On a DRAM-kept wake the J700's PCIe host trains the radio link and runs the bootstrap inside its resume_noirq: 110 ms, mostly the 100 ms after PERST# before a config request. The whole noirq phase waits for it. resume_noirq now restores the root port, releases nothing else and queues a work item for the link, the bootstrap and the functions' config. Its supplier, the bootstrap, waits for that work in its resume. The host is the supplier's consumer and the radios are below the host, so none of them resumes before the link is back, while the rest of the system resumes in parallel. Both devices resume asynchronously for that. The PCI core's resume_noirq of the functions would restore their config with the link still down and retry every BAR for 10 ms. Their saved state is set aside until the work restores it, and until then the host answers their PM control register with D0, as a function out of reset is, so that the core neither logs them inaccessible nor marks them D3cold. Signed-off-by: Diljit Singh <hey@djdev.me>
… path Only a T8140 host with the Neo sleep path set up queues the radio work, so only that host needs to resume asynchronously. Enable it once the PM notifier is registered, and let resume_early cope with a host that has no driver data. Signed-off-by: Diljit Singh <hey@djdev.me>
Contributor
Author
Booted at this PR's exact head (03b6aa3), 2026-11-12Kit built from 03b6aa3 itself (integration 3766943 + e0ea9f4 + 03b6aa3), aura main Stage 2, installed and rebooted over SSH. The running vmlinuz matched the kit's Image (aa12744d).
dmesg audit
|
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 a DRAM-kept wake, the Neo (J700) brings its radio link back inside the PCIe host's
resume_noirq: 110 ms, mostly the 100 ms the spec requires between PERST# and the first config request. The whole noirq phase, and everything after it, waited for that. This moves the radio bring-up into a work item, and only the radios wait for it.e0ea9f47PCI: apple: t8140: bring the radios back after a sleep off resume_noirqresume_noirqrestores the root port, as before, then queues the link-up, the bootstrap and the restore of the functions' config..resume. The radios sit below the host, so neither the host nor the radios resume before the link is back; the rest of the system resumes in parallel. The host and the bootstrap now resume asynchronously so that this wait blocks nothing else.resume_noirqof the two functions still runs while their link is down:resume_earlybefore it touches the functions, so the PCI core's noirq pass over them has finished first.03b6aa37PCI: apple: t8140: resume the host asynchronously only with its sleep pathresume_earlycopes with a host that has no driver data.Other Apple PCIe hosts are unchanged
pcie-apple.cruns only for the T8140 radio port. The sleep path (neo_cold, the radio work,neo_noirq_done,device_enable_async_suspend()) is set up inapple_pcie_neo_sleep_probe(), which runs only with a bootstrap supplier.apple_piodma_bootstrap_get()returns -ENODEV for any host that isn'tapple,t8140-pcie.apple_pcie_resume_early()is in the shared PM ops but does nothing withoutneo_cold.neo_radio_wakingis set. Only the T8140 path'sresume_noirqsets that flag, behindneo_sleep_armed, which only the T8140 PM notifier sets. Any other read goes straight topci_generic_config_read(), after the sameapple_pcie_lookup()that writes already do.apple,t8140-pcie-bootstrap) exists only on the J700.Measured on the Neo (J700), 2026-11-12
Kit: this commit on #1715 (both on
cae47c00, together with #1700 and #1682's debug line), aura main Stage 2. One boot. Before = the same kit without this commit (#1715's measurements).dpm_resume_noirq(kprobes)dpm_resume_noirq(power trace, median of 3)dpm_resume(power trace, median of 3)8 DRAM-kept wakes, medians in seconds after the PMU RTC alarm:
Before, the wakes split into two groups about 45 ms apart. In the slow group the SPMI USB-C port controller's resume (
sn201202x 1-0a, synchronous) took 28–51 ms instead of 4 ms, holding up every later synchronous device, DCP among them. With the resume phase starting about 110 ms earlier, it took 0.8 ms in every trace, and the 8 wakes form one group.Soak, same boot (52 sleeps in all):
dwc3_0unbound: all deep, radios up after each. Then 2 sleeps after the rebind: both DRAM-kept.03b6aa37moves one call and adds a NULL check. It's behaviour-identical on the J700 and was build-checked only.🤖 Generated with Claude Code