Repository navigation
PCI/ASPM: L1 PM Substates and Clock PM by default where the DT routes CLKREQ# (M3 Air Wi-Fi) - #2735
Conversation
… CLKREQ# On devicetree platforms the default ASPM policy enables L0s and L1 but leaves the L1 PM Substates and Clock PM off, because both need CLKREQ# between the two ports and the kernel cannot see whether it is routed. The devicetree can say so: "supports-clkreq" (pci-bus-common) states that CLKREQ# is routed from the root port to the downstream device. On links whose port node carries it, add the supported L1 PM Substates to the default ASPM states and enable Clock PM by default if both ends support it. Nothing changes for links without the property, "aspm-no-l1ss" and "aspm-no-l1" still win, and the policy knobs work as before. On an M3 MacBook Air (J615) the Wi-Fi/Bluetooth link then enters L1.1/L1.2 with Clock PM under the default policy, and s2idle draws 2.91 W instead of 3.09 W. Signed-off-by: Ryan Murray <[email protected]>
…uted The Wi-Fi/Bluetooth module's CLKREQ# is wired to the SoC on the M3 MacBook Airs: the ADT gives the Wi-Fi PCIe bridge a CLKREQ function, the pin is muxed to it, and both ends advertise L1 PM Substates and Clock PM. Add "supports-clkreq" to the port so the link uses L1.1/L1.2 and Clock PM by default. Signed-off-by: Ryan Murray <[email protected]>
|
Merge-train adversarial review (MERGETRAIN-LINUX2) at 7bc29a8: NO BLOCKERS. Code read only, nothing built here. Before the merge it still needs Dj's verdict at this head; the missing rows are listed below. Full review#2735 PCI/ASPM: L1 PM Substates and Clock PM by default where the DT routes CLKREQ# (M3 Air Wi-Fi) @7bc29a89VERDICT: NO BLOCKERS drivers/pci/pcie/aspm.c:931-932 adds Nits:
Missing rows: J613 (same dtsi) default-path boot with L1.2 on, Wi-Fi/BT traffic and s2idle. On J615: a longer soak than 50 pings (Wi-Fi throughput plus an idle/wake cycle over minutes, and BT A2DP audio with Clock PM on, since L1.2 exit latency affects BT isoc). Deep-sleep interaction does not apply on T8122 today. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Reviewed at live head 7bc29a898525203ffe2636f256f5a1ac9fe6be18 against all 6 sections of pre-pr-checklist.md.
0 code/policy/attribution blockers — holding only for missing §5 hardware verification rows on the affected boards before APPROVE.
Verified (§1–§4, §6, CI)
- §1–§2 Design & cross-SoC safety: Uses the standard DT property
supports-clkreqrather than chip/board gates or new cmdline/module parameters. Verified across the whole tree that existingsupports-clkrequsers (freescale/imx8*,imx9*,rockchip/rk3568/rk3588) place it on the PCIe host-controller node, not on the root-port (link->pdev) or endpoint (link->downstream) nodes inspected bypcie_link_has_aspm_override(), so no non-Apple boards or other Apple boards are inadvertently changed. - §3 ASPM & Clock PM ordering:
- In
pcie_aspm_override_default_link_state(),link->aspm_default |= link->aspm_support & PCIE_LINK_STATE_L1SSruns afteraspm-no-l1andaspm-no-l1ssstripaspm_support, so DT opt-outs still win. pcie_aspm_remove_cap()(used bypcie-apple.cfor T6050 adopted ports and USB4 tunnels) clears L1 support, andpcie_config_aspm_link()strips L1SS whenever L1 is absent;pcie_aspm=offstill returns early via!aspm_support_enabled.pcie_clkpm_override_default_link_state()runs afterpcie_clkpm_cap_init()and beforepcie_set_clkpm();clkpm_disablestill takes precedence inpcie_set_clkpm().
- In
- §4 Clean-room & attribution: Both commits (
b50908437311,7bc29a898525) have human author/committer (Ryan Murray <[email protected]>) and humanSigned-off-by:only (zero AI trailers); PR body includesAssisted-by:. - §6 Naming & CI: Clean;
dt-checksandhost-testsare both green on7bc29a898525.
Remaining §5 hardware rows needed to APPROVE
- 13-inch M3 MacBook Air (
J613):t8122-j613-j615.dtsienablessupports-clkreq;on&port00for bothJ613andJ615, but all ADT/hardware evidence in this PR isJ615-only. Please post aJ613default-path boot row confirming L1.1/L1.2 + Clock PM active, Wi-Fi/BT traffic, s2idle, and regression checks (0 SELinux denials,0 failed units,0 new kernel errors) — or scope&port00 { supports-clkreq; };tot8122-j615.dtsuntilJ613is verified. - 15-inch M3 MacBook Air (
J615): Please confirm0 SELinux denials(AVC) on the default-path row and add a longer Wi-Fi throughput + BT audio (isoc/A2DP) soak under Clock PM + L1.2 (beyond 50/20 pings) to verify L1.2 exit latency does not disturb BT audio or sustained Wi-Fi.
Non-blocking nits
drivers/pci/pcie/aspm.c:951(pcie_clkpm_override_default_link_state()): check|| link->clkpm_disablealongside!link->clkpm_capable || link->clkpm_default. On a blacklisted pre-1.1 link withsupports-clkreq,pcie_clkpm_cap_init()setsclkpm_disable = 1; without checking it here,clkpm_defaultis set to1andASPM: default Clock PM (supports-clkreq)is logged even thoughpcie_set_clkpm()immediately refuses to enable Clock PM.drivers/pci/pcie/aspm.c:957: considerpci_dbg()instead ofpci_info(), as the preceding"ASPM: default states..."line already reports L1SS activation.
Assisted-by: LLM (Gemini 4 Neon)
pcie_clkpm_cap_init() sets clkpm_disable on blacklisted (pre-1.1) links, and pcie_set_clkpm() then refuses Clock PM. The supports-clkreq default still set clkpm_default and logged that Clock PM was on. Skip such links, and log the default at debug level: the "ASPM: default states" line already reports the L1 PM Substates. Signed-off-by: Ryan Murray <[email protected]>
|
Pushed e873def (fast-forward), which fixes both nits:
New J615 rows at this head, on the current default (fleet81 + this PR, default ASPM policy and cmdline; DTB = the default plus only
Not covered: BT audio (A2DP/isoc). We have no Bluetooth audio sink in the lab. The J613 row is requested from the J613 owners. If you'd rather not wait for it, I can move Numbers and methodKernel 7.3.0-aurora-f81l1ss = fleet81 1b940c26 + b509084, 7bc29a8, e873def. One grub one-shot with a one-shot Stage 2 whose DTB differs from the default only by
|
|
Review at e873def: one blocker, in the DT commit; the ASPM code has none. Since 7bc29a8 there is one new commit: Code at this head:
Blocking:
Not blocking: BT audio (A2DP/isoc) under L1.2 is still unmeasured on the J615. The 300 s LE scan and the Wi-Fi A/B are good, but they do not exercise isoc latency; worth a row when a sink is available. Assisted-by: LLM (Claude:Opus 5.5) |
…3 is checked The supports-clkreq line for the Wi-Fi port sat in the shared J613/J615 dtsi, so it also told the J613's kernel that CLKREQ# is routed there. The CLKREQ# evidence (the ADT's CLKREQ function on the Wi-Fi bridge and the hardware rows) is from the J615 only, and the pin mux in t8122.dtsi says nothing about the board. Move the property to t8122-j615.dts. The J615 DTBs are unchanged; the J613 DTBs lose the property until a J613 row shows its link is fine with Clock PM and L1.2. Signed-off-by: Ryan Murray <[email protected]>
|
Pushed 2384bc5:
Assisted-by: LLM (Claude:Opus 5.5) |
|
Tested both Machine and build
Boot,
|
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
Resolve the end-of-file conflict in arch/arm64/boot/dts/apple/t8122-j615.dts so both &nvram_qspi and &port00 supports-clkreq are kept. Signed-off-by: Ryan Murray <[email protected]>
DjDeveloperr
left a comment
There was a problem hiding this comment.
Verdict: FINISH at cee358115c44
Blockers:
- CI at
cee358115c44:dt-checksandhost-testsare still in progress; wait for both to pass. - §5 exact-head hardware evidence:
cee358115c44mergedmainwith a conflict resolution in touched filearch/arm64/boot/dts/apple/t8122-j615.dts, so thee873def2J615 row is no longer at head. Post a J615 default-path row atcee358115c44(or a fleet candidate containingcee358115c44unchanged) with regression checks (0 SELinux denials,0 failed units,0 new kernel errors) plus a second-Mac regression check for shareddrivers/pci/pcie/aspm.c, and addTested:andRisk:lines to the PR body.
Checked: §1–§4 and §6 pass across the full diff (drivers/pci/pcie/aspm.c, arch/arm64/boot/dts/apple/t8122-j615.dts), all 5 commits, and the PR text; prior review nits and the J613 scope concern from 7bc29a898525 are resolved. §5 is pending CI completion and exact-head hardware evidence at cee358115c44.
Evidence
- Delta since
7bc29a898525:e873def277a7:drivers/pci/pcie/aspm.c:951-958now checkslink->clkpm_disableinpcie_clkpm_override_default_link_state()so blacklisted pre-1.1 links are skipped, and switches the Clock PM log topci_dbg().2384bc598077: moves&port00 { supports-clkreq; };out of sharedarch/arm64/boot/dts/apple/t8122-j613-j615.dtsiintoarch/arm64/boot/dts/apple/t8122-j615.dts, leaving J613 untouched until verified on hardware.cee358115c44: mergesmainand resolves the EOF conflict inarch/arm64/boot/dts/apple/t8122-j615.dtscleanly, preserving both&nvram_qspi { read-only; };and&port00 { supports-clkreq; };.
- §1–§3 PCIe ASPM L1SS & Clock PM safety:
drivers/pci/pcie/aspm.c:931-932: gated strictly on DTsupports-clkreq(no chip/board/firmware gates, no new cmdline/module parameters). Runs afteraspm_l1ss_init()(which checks both ends'PCI_L1SS_CAP_L1_PM_SS, per-substate capabilities, andchild->ltr_pathfor ASPM L1.2) and afteraspm-no-l1/aspm-no-l1ssstripaspm_support, so DT opt-outs still win.drivers/pci/pcie/aspm.c:949-959&1285-1286: runs afterpcie_clkpm_cap_init()(which verifiesPCI_EXP_LNKCAP_CLKPMacross all functions onlinkbus) and beforepcie_set_clkpm().pcie_config_aspm_link()andpcie_set_clkpm_nocheck()update saved PCIe/L1SS state for suspend/resume, andpcie_aspm_remove_cap()/apple_pcie_adopted_no_clkpm()/pcie_aspm=off/pcie_aspm.policy=performanceretain precedence.- Repo-wide check of
supports-clkreqconfirms all non-Apple DTs (freescale/imx8*,imx9*,rockchip/rk3568/rk3588) place it on the host-controller node rather than the root-port or endpoint nodes queried bypcie_link_has_aspm_override(). On Apple Silicon, onlyt8122-j615.dts(andt8122-j615-25g83.dtswhich includes it) carriessupports-clkreqon&port00(Wi-Fi/BT); NVMe, Ethernet, and Thunderbolt ports are unaffected.
- §4 & §6 Attribution and naming: All 5 commits (
b50908437311,7bc29a898525,e873def277a7,2384bc598077,cee358115c44) have human author/committer (Ryan Murray <[email protected]>) and humanSigned-off-by:only. Zero AI attribution in commits, PR title, or PR body. Naming clean. - §5 CI & hardware rows at
cee358115c44:pr-readinessandpr-textpassed;dt-checksandhost-testsareIN_PROGRESS. J615 results ate873def2(-232/-252 mW awake idle A/B/A/B, 10x128 MiB Wi-Fi each way, 300 s BT LE scan, 2/2 s2idle, 0 SELinux denials, 0 failed units, 0 new kernel errors) and the M1 Air J313 backport test comment are encouraging, but a fresh J615 row atcee358115c44plus a second-Mac regression check for the sharedaspm.cchange are needed before approval.
RyanTheTide
left a comment
There was a problem hiding this comment.
Verdict: FINISH, then merge, at cee358115c44 (no code blocker; it needs one J615 row at this head)
Blockers: none in the code
Checked: this is a re-check after the main forward merge. At head the PR diff is still exactly t8122-j615.dts +9 (&port00 { supports-clkreq; }) and drivers/pci/pcie/aspm.c +30/-2. The conflict in t8122-j615.dts was resolved by appending the block at the end of the file, and no other file is touched. The code findings of the earlier review at e873def2 still hold:
- The L1SS default is added after
aspm_l1ss_init()and after theaspm-no-l1/aspm-no-l1ssstripping, so the opt-outs win, and only supported substates are taken. - L1.2 still drops when
ltr_pathis not set. - The Clock PM default sits between
pcie_clkpm_cap_init()and the firstpcie_set_clkpm(), and skips links withclkpm_disable. pcie_link_has_aspm_override()checks only the root-port and endpoint nodes, so other in-treesupports-clkrequsers (on host-controller nodes) are unchanged.- No chip, board or parameter gates. CI is green:
dt-checks,host-tests,pr-text.
The J313 (T8103) row from @mmdisbrow above is a good second-Mac signal for the shared aspm.c. It shows ASPM: default states L1 ASPM-L1.1 ASPM-L1.2, s2idle and sustained Wi-Fi with a DT-added supports-clkreq. It ran on a 7.2.11 backport, not at this head.
Still needed before merge:
- A J615 default-path row at
cee358115c44, or a fleet build that contains it unchanged: L1.1/L1.2 + Clock PM on the Wi-Fi link, Wi-Fi + BT traffic, s2idle, 0 AVC / 0 failed units / 0 new kernel errors. The J615 rows ate873def2came from before themainmerge. - Owner of the PR text: add the
Tested:/Risk:lines that pr-readiness asks for.
Evidence
gh pr diff 2735atcee358115c44: 2 files, +39/-2.- Read
drivers/pci/pcie/aspm.cat head, lines 878-958 (pcie_link_has_aspm_override(),pcie_aspm_override_default_link_state(),pcie_clkpm_override_default_link_state()), line 808 (ltr_pathdrops L1.2) and lines 1026-1032 (the override runs afteraspm_l1ss_init()). - CI at head:
dt-checkspass,host-testspass,pr-textpass.
|
Exact-head verification row at
PR body updated with |
Resolve EOF context conflict in arch/arm64/boot/dts/apple/t8122-j615.dts with 0882c53 (M3 ANE enablement); drivers/pci/pcie/aspm.c and &port00 supports-clkreq diff are unchanged from cee3581. Signed-off-by: Ryan Murray <[email protected]>
The forward merge left the ANE node open before the port00 override. Close it so both J615 variants compile while retaining the ANE status and the CLKREQ property. Signed-off-by: Ryan Murray <[email protected]>
|
I fixed the DT build failure at The old head failed locally at the same line as the hosted DT job. Both the ordinary and 25G83 J615 DTBs now compile with arm64 LLVM and carry https://github.com/aurora-silicon/linux/actions/runs/45453948155/job/138658220162 |
RyanTheTide
left a comment
There was a problem hiding this comment.
Verdict: MERGE at 4845d063d903 once dt-checks is green (it is now: dt-checks, host-tests, readiness and pr-text all pass at this head). No code blocker remains. The hardware row is at cee35811; the reasoning for carrying it over is below.
Blockers: none at this head. At f3b76066 there was one: the forward merge appended the &port00 block inside the still-open &ane node, and dt-checks failed with t8122-j615.dts:204.1-8 syntax error, so the J615 and J615-25G83 DTBs did not build. 4845d063 restores the brace. I made the same one-line fix independently and got the same tree (git diff 4845d063 against my fix is empty).
Checked:
- At
4845d063, the PR againstmain(85d0453b) is still exactly 2 files, +39/-2:t8122-j615.dts+9 anddrivers/pci/pcie/aspm.c+30/-2. - I built
apple/t8122-j615.dtbandapple/t8122-j615-25g83.dtblocally (arm64 defconfig, dtc). Both build at the fixed head. Decompiled, the fixed-head J615 DTB differs frommain's by one line,supports-clkreq;on the Wi-Fi port (/soc/pcie@580000000/pci@0,0).&anekeepsstatus = "okay"frommain. aspm.cis unchanged fromcee35811, the head of the exact-head J615 row (issuecomment-7139881475), and the DT delta that row used (onesupports-clkreq;on the same node) is the same delta this DTB carries. My earlier code findings (review 6041820355) still hold: the opt-outs win, L1.2 drops withoutltr_path, the override is limited to root-port and endpoint nodes, and there are no chip, board or parameter gates.- The
Tested:/Risk:lines are now in the body.
For the merger: the readiness bot wants a row naming the head SHA. The kernel at 4845d063 differs from the tested cee35811 only by the main forward merge, and the J615-relevant result (ASPM/Clock PM defaults on the Wi-Fi link) depends only on aspm.c plus that DT property, both identical. Either accept the cee35811 row with this equivalence, or take a short J615 boot at 4845d063 (the ASPM: default states line plus lspci -vv ClockPM+) when a fleet cut picks it up.
Evidence
- Failed job at
f3b76066: https://github.com/aurora-silicon/linux/actions/runs/45453948155/job/138658220162 (Error: apple/t8122-j615.dts:204.1-8 syntax error, thent8140-j700.dtbmissing in ADT coverage as a knock-on) make ARCH=arm64 O=... apple/t8122-j615.dtb apple/t8122-j615-25g83.dtbat fixed head: both builtdtc -I dtb -O dtsbase vs fixed head,diff: only> supports-clkreq;git diff --stat 85d0453b 4845d063: 2 files, +39/-2
DjDeveloperr
left a comment
There was a problem hiding this comment.
Verdict: MERGE at 4845d063
Blockers: none
Checked: no Apple material, no chip or board gates (selection is via the supports-clkreq DT property), no new kernel parameters, J615 hardware verification on identical aspm.c at cee35811 with 4845d063 fixing only the DTS closing brace, CI green (dt-checks, host-tests, pr-text, readiness).
Problem
On devicetree platforms the default ASPM policy turns on L0s and L1 but leaves the L1 PM Substates (L1.1/L1.2) and Clock PM off, because both need CLKREQ# and the kernel can't tell whether it is wired. On Apple silicon Macs the Wi-Fi/Bluetooth link therefore never reaches L1.2. Arch and NixOS work around this in userspace with
powersupersave; Fedora doesn't, and neither should have to.Change
PCI/ASPM: on links whose port node hassupports-clkreq(the existing pci-bus-common property meaning "CLKREQ# is routed between root port and device"), add the supported L1 PM Substates to the default ASPM states and enable Clock PM by default. Links without the property don't change.aspm-no-l1ss/aspm-no-l1still win, and the policy knobs work as before.t8122-j615.dts:supports-clkreqon the Wi-Fi port (port00). It started in the shared J613/J615 dtsi; the last commit moves it to the J615 board file, because all the CLKREQ# evidence is from the J615. The J615 DTBs are byte-identical either way; the J613 gets the line back with its own row. The J615 ADT gives the Wi-Fi bridge a CLKREQ function, the pins are muxed to it, and both ends advertise L1SS + Clock PM.There are no chip or board checks and no new command-line or module parameters: the behaviour follows the DT property.
Testing (M3 MacBook Air 15, J615)
On the default policy (no knob), with this kernel change and the default J615 DTB plus only
supports-clkreqon port00 (one-shot boot, fleet cmdline):ASPM: default states L1 ASPM-L1.1 ASPM-L1.2 PCI-PM-L1.1(the Clock PM default logs at debug level); Wi-Fi (01:00.0) and BT (01:00.1) both show clkpm/L1.1/L1.2 on, still on after 3 resumes.Again at head e873def on the current J615 default (fleet81 + this PR, default policy, default cmdline, Stage 2 = default + only
supports-clkreq):Re-verified at exact head
cee358115c4446on J615 (default cmdline, Stage 2 = live J615 default + 1-linesupports-clkreq;onpci@0,0):ASPM: default states L1 ASPM-L1.1 ASPM-L1.2 PCI-PM-L1.1,ClockPM+; both01:00.0(Wi-Fi) and01:00.1(BT) reportclkpm=1 l1_aspm=1 l1_1_aspm=1 l1_2_aspm=1 l1_1_pcipm=1and keep them after traffic, scan, and 2/2 s2idle resumes.3.105 msavg), 5x 64 MiB TX242-257 Mbit/s/ RX156-173 Mbit/s; BT 60 s LE scan (46devices, 0hci0timeouts); same-boot A/B/A dark idle-188 mWtotal median (-145 mWSoC median); s2idle 2/2; 0 Oops/BUG/WARNING, 0 SELinux AVC denials, 0 new kernel errors.Tested: J615 (M3 Air 15", T8122) exact head
cee358115c4446default-path row (L1.1/L1.2/ClkPM on at probe, Wi-Fi 5x64 MiB, 60 s BT LE scan, A/B/A dark idle power delta, s2idle 2/2, 0 AVC/oops/new errors); plus J313 backport row (2nd Mac signal).Risk: Low — strictly opt-in via DT
supports-clkreq(currently only J615 Wi-Fi port); links without the property and ACPI platforms are unchanged, andaspm-no-l1ss/aspm-no-l1andpcie_aspm.policyoverrides continue to take precedence.Still to run
Reviewer detail
Why the property, not a policy change. Upstream enables L0s/L1 by default on DT platforms and deliberately leaves L1SS off because L1.2 without a routed CLKREQ# can hang a link.
supports-clkreqis the existing binding (dtschema pci-bus-common) for exactly that fact, so the default follows the hardware description: links without it are untouched,aspm-no-l1ss/aspm-no-l1still win (they stripaspm_supportfirst), and the sysfs/pcie_aspm.policyknobs behave as before. Clock PM is the same story (CLKREQ#-based), so it gets the same default.Where it hooks.
pcie_aspm_override_default_link_state()(DT branch) ORsaspm_support & PCIE_LINK_STATE_L1SSintoaspm_defaultwhen either end's node has the property; the "default states" info line now names the substates.pcie_clkpm_override_default_link_state()runs right afterpcie_clkpm_cap_init()and setsclkpm_defaultwhen the link is Clock PM capable. Both are no-ops without the property and on ACPI.J615 hardware basis. The J615 ADT gives the Wi-Fi bridge (
pci-bridge0) a CLKREQ function and an L1 PM-substate control for the link; the DT muxes the CLKREQ pins on the PCIe controller; both functions of the BCM4388 (01:00.0 Wi-Fi, 01:00.1 BT) exposel1_1_aspm/l1_2_aspm/clkpmin sysfs. The ADTs of the other Macs listed under "Still to run" carry the same CLKREQ function on their Wi-Fi bridge.Measurements (J615, fleet78, panel blanked, BAAC on force-discharge). Same boot, same USB-C topology, A/B/A/B with the policy knob (= the states this change makes default):
Absolute numbers include a live USB4 link to the lab tether; the deltas don't depend on it. Data:
traces/power/20261121-j615-f78-s2idle-floor(lab store).Default-path row (the change itself). Kernel = fleet78 + commit 1, Stage 2 = the J615 default with only
supports-clkreq;added onpci@0,0(dtc diff 1 line), policy left atdefault: s2idle 2916 / 2911 / 2911 mW, awake 3131 mW;lspciL1SubCtl1PCI-PM_L1.2- PCI-PM_L1.1+ ASPM_L1.2+ ASPM_L1.1+, T_PwrOn 6 us. The kernel messages are the AER-enabled notice and the known 10xhci0: Failed to read codec capabilities (-22)that the stock kernel prints too. Data:traces/power/20261122-j615-l1ss-default.Checks.
make W=1 drivers/pci/pcie/aspm.oclean, checkpatch clean,CHECK_DTBS=y apple/t8122-j613.dtb apple/t8122-j615.dtb: no new warnings (one existingapple,macaudiodai-link warning).