Repository navigation
PCI: apple: T6050: follow the boot loader's link speed, so the J775D's 10 Gb Ethernet keeps 16 GT/s - #2759
Conversation
…5D's 10 Gb Ethernet keeps 16 GT/s apple_pcie_adopt_link() refuses a boot-trained link faster than 8 GT/s (-ENOLINK). The boot loader sets each GP port's Target Link Speed from the port's ADT bridge: "maximum-link-speed" 3 (8 GT/s) on the N1 and the USB-A controller, and nothing on the J775D's port 2, whose RTL8127A supports 16 GT/s. Once the boot loader trains that port at 16 GT/s, the fixed ceiling would refuse the J775D's only wired network. Use the root port's own Target Link Speed (LNKCTL2) as the ceiling, so a link is adopted at up to the speed the boot loader asked for. A link does not train above its root port's target, so every link adopted today (8 GT/s or less) still is. Reach: the T6050 hosts with adopt_link. Only the check changes, and nothing new is written. A link above 8 GT/s that was refused before is now adopted wherever the boot loader left the target higher; today that is only a boot loader with "pcie_t6050: train each GP port at the speed its ADT bridge allows". Tested on the J775D (Mac Studio, M5 Ultra), with the boot loader setting the target from the ADT (aura: "pcie_t6050: train each GP port at the speed its ADT bridge allows"), on two boots: port 2 was adopted at 16 GT/s x1, and ports 0 and 3 at 8 GT/s x1 as before. Signed-off-by: Jeff Queisser <funkzy@users.noreply.github.com>
…trained link targets the speed the ADT gives it
apple_pcie_t6050_port_configure() writes Target Link Speed 8 GT/s
whenever Linux trains a T6050 port itself: the N1's root-port reset, a
port the boot loader left down (the J714c's N1, the J714s and K116s SD
reader), and the laptops' resume. The boot loader trains its ports at
the speed the port's ADT bridge gives, so the two could differ: the SD
reader's bridge gives 5 GT/s ("maximum-link-speed" 1, its child's
"expected-link-speed" 2), and Linux targeted 8 GT/s.
Take the target from the root port node's "max-link-speed", which the
boot loader fills in from the ADT (aura: "pcie_t6050: publish each GP
port's link speed as max-link-speed"), as the T8140 path already does
with of_pci_get_max_link_speed(). Without the property the target stays
8 GT/s, so nothing changes until the tree carries it. A speed above the
root port's fastest is lowered to it, as the boot loader lowers its own
target, so a hand-written property cannot stop a retrain.
What each port gets with both changes: the N1 3 (8 GT/s, as before),
the J775D's 10 Gb Ethernet 4, the USB-A controller 3, the SD reader 2
(5 GT/s, where it was 8). The reader's link speed is not expected to
change: the GL9755 supports at most 5 GT/s, and on the J775D, with
aura#163 bringing the port up, it linked at 5 GT/s x1 under an 8 GT/s
target.
Tested on the J775D (Mac Studio, M5 Ultra): the N1's root-port reset
trains it again at the published 8 GT/s x1.
Signed-off-by: Jeff Queisser <funkzy@users.noreply.github.com>
|
Reviewed together with aura#444. The two sides agree: Aura sets each root port's Target Link Speed from the ADT bridge and publishes the same value as
No changes requested. The remaining rows are the owner rows you list: the J714s/K116s SD reader trained by Linux at 5 GT/s, and the N1 at 8 GT/s on J714s/J716c/J714c. Assisted-by: LLM (Claude:Opus 5.5) |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Adversarial review at 408f43b0240c against the pre-PR checklist.
0 code/policy/attribution/CI blockers. Holding only for the remaining §5 hardware test rows on other T6050 machines before approval.
Verified
- §1 (No model gating & chicken-and-egg): Zero board/chip/port gates. Speeds derive purely from root-port capability/control registers and the standard DT
max-link-speedproperty, with an 8 GT/s fallback when absent so this PR lands safely ahead ofaura#444with zero behavior change under older Aura. - §2–§3 (Code correctness & safety):
ef2eb6b7aa59:PCI_EXP_LNKSTA_CLSandPCI_EXP_LNKCTL2_TLSshare encoding;tls == 0fails closed (-ENOLINK), an all-1s read fails on NLW/LT, and T6050 RP (0x100c106b) always has PCIe cap v2.408f43b0240c:of_pci_get_max_link_speed()returning< 0or0safely falls back toPCI_EXP_LNKCTL2_TLS_8_0GT; maskingLNKCAP2withPCI_EXP_LNKCAP2_SLS(0xfe) boundstop = __fls(sls)to1..=7, so clampingspeed > topguaranteesBIT(speed)has no shift UB and fits cleanly insidePCI_EXP_LNKCTL2_TLS;RC_T6050_DBI_RO_WR_ENis still cleared on error paths.
- §4 (Clean-room & attribution): Clean. Both commits carry human author/committer (
Jeff Queisser) +Signed-off-by:only, zero AI trailers in commits,Assisted-by:in PR body. - §6 (Naming) & CI: Clean;
host-testsandkunitboth passed on408f43b0240c. J775D baseline / PR-alone / PR+aura#444matrix and regression comparison are thorough.
Remaining §5 hardware rows needed for approval
J775D exercises commit 1's 16 GT/s adoption path, but its apple_pcie_t6050_port_configure() retrain (N1, port 0) only exercises max-link-speed = 3 (8 GT/s). Before merge/approval, please collect the remaining T6050 owner rows already listed in the PR:
- J714s / K116s (port 1 SD reader): verify Linux-trained
port_configure()targets and links at 5 GT/s x1 (max-link-speed = 2) with both PRs, and is unchanged with this PR alone (this exercises the non-8-GT/s path of commit 2). - J714s / J716c / J714c (port 0 N1): verify N1 continues to adopt/train at 8 GT/s x1.
Assisted-by: LLM (Gemini 4 Neon)
|
@DjDeveloperr (J714s) and @erikwb (J716c), could you run the two rows this PR still needs on your machines? We only have the J775D. One boot at this head each is enough:
Assisted-by: LLM (Claude:Opus 5.5) |
Problem
The T6050 host fixes every link at 8 GT/s in two places:
apple_pcie_adopt_link()refuses a boot-trained link faster than 8 GT/s (-ENOLINK). The J775D's port 2 bridge sets nomaximum-link-speed, and its RTL8127A supports 16 GT/s. Once the boot loader trains that port at 16 GT/s (aura#444), the Mac Studio would lose its only wired network.apple_pcie_t6050_port_configure()writes 8 GT/s whenever Linux trains a port itself: the N1's root-port reset, a port the boot loader left down (the J714c's N1, the J714s and K116s SD reader), and the laptops' resume. The SD reader's ADT bridge gives 5 GT/s, so Linux and the boot loader target different speeds there.Why this shape
Before this series the link-speed policy lived in three places that could disagree: Aura's fixed 8 GT/s target, Linux's fixed 8 GT/s ceiling on adoption, and Linux's fixed 8 GT/s in
apple_pcie_t6050_port_configure(). Raising those constants, or adding an exception for the J775D or for port 2, would fix this NIC and leave the next port with a different speed wrong in a new way: the SD reader, which the ADT gives 5 GT/s.Instead, the machine's own description, the ADT, is the one source. Aura applies it and publishes it as the standard
max-link-speedon each root port node. Linux trains by that property, as the driver already does for the T8140, and on adoption accepts what the boot loader set. The change adds no board, port or chip check: the speed comes from the ADT and the root port's capability registers. Ports whose ADT gives 8 GT/s stay at 8 GT/s, port 2 gets 16 GT/s, and port 1 would get 5 GT/s.The two sides depend on each other in one direction. This PR keeps today's behaviour under an older boot loader. An aura#444 boot loader under a kernel without this PR's first commit loses the J775D's wired network: the kernel refuses port 2's 16 GT/s link. So this PR lands first, and the aura#444 release waits until the shipped kernel has it.
Change
max-link-speed.port_configure()takes the target from the root port node's standardmax-link-speed, as the T8140 path already does withof_pci_get_max_link_speed(). Without the property it stays at 8 GT/s, so nothing changes until the tree carries one. The boot loader fills the property in from the ADT (aura#444, its second commit). A speed above the root port's fastest is lowered to it, as the boot loader lowers its own target, so a hand-written property can't stop a retrain.Both commits are safe with today's boot loader: it targets 8 GT/s and writes no
max-link-speed, so behaviour is unchanged until the aura PR lands.Testing
J775D (Mac Studio, M5 Ultra), on this PR's base (integration/aurora b8c5bb0) plus these two commits only. Three one-shot boots on 2026-11-21:
max-link-speed, all three ports are adopted, the N1's root-port reset retrains it at 8 GT/s x1, and r8169 linked at 1000/full with 0 errors and 20/20 pings. It has no kernel line the baseline lacks.max-link-speed3, 4 and 3 on ports 0, 2 and 3. The N1's root-port reset, which goes throughport_configure(), retrained it at the published 8 GT/s x1 (target 8 GT/s).usb 3-1: device not accepting address 2, error -108, from the Type-C xHCIs' start-up teardown, which comes and goes between boots. The same two units failed on all three boots:systemd-networkd-persistent-storage.service(the test boots use a read-only root) andiwd.service. None has a desktop, because the J775D's GPU support (arm64: dts: apple: t6050-j775d: Give the Mac Studio (M5 Ultra) a working GPU, and its M and P core capacities (754/1024) to the scheduler #1973) isn't in this base yet. ALARM has no SELinux, so there are no AVC lines to report.apple_pcie_suspend_noirq returns -16). After each, port 2 was still at 16 GT/s x1, with AER at 0 and 10/10 pings.checkpatch.pl --strict: clean on both commits. The kit built with 0 warnings.Extra evidence from our daily test kit (not this PR's row)
On integration/aurora cc14570 plus about 20 open PRs, including #2488 and #2557, which change this file's s2idle handling, and an earlier revision of these commits (the same speed logic):
usb 5-1: device descriptor read/all, error -108on one boot, andusb 5-1: device not accepting address 2, error -108plus twousb 3-1: device descriptor read/64, error -110on the other. They come from the Type-C xHCIs being torn down and re-added in the first seconds, and the same lines are in 2 of the 7 soak boots of that kit without this change.Still to run
lspci -vvlink status and target link speed of the reader's root port,cat /proc/device-tree/.../pci@1,0/max-link-speed | od -tu4 --endian=big, anddmesg | grep -iE 'aer|pcie'.Assisted-by: LLM (Claude:Opus 5.5)