Repository navigation
Conversation
|
@techmore the change reads correctly and the KUnit case covers both paths. Two things before merge: the commit needs your Signed-off-by, and #1678 edits the line right after your hunk in atcphy_typec_target_mode(), so one of the two will need a rebase. Optional: the "serving its USB2 only" message prints on every USB4/TBT attach of such a port; dev_info would be enough. |
4f9b5df to
a4683bd
Compare
|
Thanks, Ryan. I rebased this onto current Testing caveat: for the new head I have only compiled the changed file ( |
1c5b1d4 to
0430675
Compare
|
Hardware test, Mac mini M4 (J773g), 2026-11-14: PASS at this PR's head Kernel: This result comes from a second boot (2026-11-14 03:09 UTC) of that same kernel image (Image SHA-256 Device: Apple Magic Keyboard with Touch ID and Numeric Keypad (
Not covered: hot-plug, USB 3 SuperSpeed and USB4/Thunderbolt docks on the rear ports. |
|
Blockers: 1. The PHY change is sound.
Nit: HW row: J773g, kernel built from this head, default command line (no Assisted-by: LLM (Claude:Opus 5.5) |
|
This still applies cleanly to the current integration/aurora tip 110861f, and the USB4/TBT-to-USB2 fallback for ports without CIO calibration is not on the tip yet. The PHY change was reviewed as sound on 11-21. One small item is left from that review: the hunk in quiesce.py adds a second identical dev_info stub, because the file already has one, so it can be dropped. After that, the J773g row from the review is needed on a kernel built from this head (USB4 partner on a rear port, USB2 device enumerating, 3 replug cycles), plus one J713 or J715 boot showing USB4/TBT still selected on a calibrated port. Build check of 110861f plus this change (arm64, LLVM=1, Image, dtbs and every directory it touches, Fedora config plus asahi.config): builds, no warnings in the files it touches. Host tests (tools/asahi/run-host-tests.py --only) on 110861f plus this change: apple-dcp passes (1/1); atc-usb3-tests passes (2/2). |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Pre-PR checklist review at 0430675d5a04 (checked against integration/aurora 70a00e583b03): 3 blockers (§4 attribution, §2 diff cleanliness, §5 exact-head hardware/regression evidence).
Code, DT, and Safety Audit (§1–§3, §6)
- Core PHY logic is sound:
drivers/phy/apple/atc.cgates the USB4/TBT-to-USB2 fallback onatcphy_mode_is_cio(target_mode) && !atcphy->cio_tunables(the port's DT calibration capability, not board/model gating) before the DisplayPort fallback sousb_modestarts fromAPPLE_ATCPHY_MODE_USB2. Ports with CIO calibration remain unchanged, andatcphy_test_target_mode_t8132_ciocovers both paths. Not superseded onintegration/aurora. - Live CI:
host-testsis green on0430675d5a04.
Blockers
- §4 commit trailers: Both commits carry AI trailers in their git commit messages (
5550520f2edf:Assisted-by: LLM checkpatch;0430675d5a04:Assisted-by: LLM). Per §4, commit messages must carry human author/committer identity and humanSigned-off-by:only (zeroAssisted-by:or AI trailers in commits; disclosure belongs in the PR description only). - §2 duplicate macro (
tools/testing/selftests/drivers/gpu/apple-dcp/quiesce.py:33-34): Commit0430675d5a04adds a second identical#define dev_info(...) ((void)0)directly beneath the one already present inquiesce.py. Please drop that hunk. - §5 exact-head hardware & regression evidence: The 2026-11-14 boot on
0430675d5a04only exercised a cold-plug USB2 keyboard (explicitly excluding USB4/TBT partners and hot-plug), and the 2026-11-19 test was on a different tree without replug or §5 regression counts. On the updated head with the default kernel command line (nosn201202xtest parameters), please provide a J773g run with a USB4/TBT partner on a rear port showing the USB2 fallback log, mux returning 0, no Type-C configuration errors, USB2 device enumeration, 3 unplug/replug cycles, and §5 regression counts (0 SELinux denials, 0 failed units, 0 new kernel errors), plus a J713 or J715 calibrated-port check confirming USB4/TBT stays selected (or request a test run on calibrated hardware if unavailable).
Assisted-by: LLM (Gemini 4 Neon)
…tion The SN201202x port controllers of the Mac mini (J773g) enter USB4 by themselves with a USB4 dock or another Mac, and Thunderbolt 3 alt mode with a Thunderbolt 3 dock. atcphy_typec_target_mode() maps those states to the USB4 and TBT PHY modes, which atcphy_mux_check() refuses with -ENODEV on a T8132 PHY without the CIO calibration. The J773g device tree has none. The failed mux update makes cd321x_update_work() retry before it sets the USB role, so the port ends up with sn201202x 1-08: failed to configure Type-C connection: -19 sn201202x 1-08: cable revalidation failed after 3 attempts and its dwc3 controller never starts an xHCI. USB 2.0 on D+/D- does not depend on the USB4 or Thunderbolt link. As is already done for the DisplayPort pin assignments this PHY cannot carry, serve the partner's USB2 instead of refusing the mode. The CIO fallback has to come before the DisplayPort fallback picks its USB mode: that one compares its result with target_mode, and started from the USB4 mode it would put USB4 back. Ports with the CIO calibration are unchanged. A KUnit case covers both. Signed-off-by: Sean Dolbec <sdolbec1@gmail.com>
The ATC USB3 host test and the apple-dcp phy, pm, quiesce and dwc3 host tests compile functions taken from drivers/phy/apple/atc.c. Define dev_info() as a no-op beside their existing logging shims so the generated host C keeps compiling when one of those functions prints an informational message. Signed-off-by: Sean Dolbec <sdolbec1@gmail.com>
0430675 to
bcdc519
Compare
|
Updated to |
On a T8132 port without the CIO calibration, serve the partner's USB2 when the port controller enters USB4 or Thunderbolt 3, instead of refusing the mux state. The J773g (Mac mini M4) is such a machine: its device tree has no
apple,tunable-cio-*properties.What the hardware runs below show is that the mux update now succeeds. In USB4, the port's xHCI then starts. In Thunderbolt 3 it also needs the companion tipd patch. They do not show a USB2 device enumerating during a USB4 or Thunderbolt link: the one dock I have showed nothing on D+/D- while in USB4.
Why. The J773g's SN201202x port controllers enter USB4 by themselves with a USB4 dock or another Mac, and Thunderbolt 3 alt mode with a Thunderbolt 3 dock.
atcphy_typec_target_mode()maps those states to the USB4 and TBT PHY modes, andatcphy_mux_check()refuses both with-ENODEVwhen the CIO calibration is missing. The failed mux update makescd321x_update_work()retry before it sets the USB role, so the port ends withfailed to configure Type-C connection: -19andcable revalidation failed after 3 attempts, and its dwc3 never starts an xHCI. USB 2.0 on D+/D- does not depend on the USB4 or Thunderbolt link.The change. In
atcphy_typec_target_mode(), on T8132 without CIO calibration, map USB4 and TBT to USB2. This works the same way as the existing fallback for DisplayPort pin assignments that the PHY cannot carry. The new fallback has to run before the DisplayPort fallback picks itsusb_mode. That fallback compares its result withtarget_mode, so if it started from USB4 it would put USB4 back. Ports with the CIO calibration (the J713/J715 device trees carry it) are unchanged. A KUnit case covers both cases.Tested on one J773g, natively, with kernels based on #1192 plus local J773g test commits, not on integration/aurora. In those kernels, the
atcphy_typec_target_mode()change is behaviour-identical to this patch. They also had a TEST-ONLY log line for each mux request, which is dropped here. The patch on this base has not been booted.-19three times, thencable revalidation failed after 3 attempts, and no rear xHCI came up.usb_modewas taken. The DisplayPort fallback put USB4 back and the ports failed with-19as before. That is why the fallback now runs first.USB4/Thunderbolt is not available on this port: serving its USB2 only, the mux update returned 0 with the PHY in USB2, and the rear xHCI (41a280000.usb) registered. The dock enumerated nothing on that xHCI while it was in USB4. The Mac on Back Left (we are the UFP there, in USB4) took the same fallback and the mux update returned 0. A keyboard plugged into Back Right later enumerated on the rear xHCI.state mode 2 alt 0x8087 -> PHY mode 1: 0). No rear xHCI came up because the port controller driver sets no USB role in TBT3. That is fixed separately in "usb: typec: tipd: Set a USB role for TBT3 on T8132 ports without a router". The Mac on Back Left: USB4 to USB2 again, mux 0.Runs 56 and 57 also had two TEST-ONLY
sn201202xmodule parameters on the command line, which are not part of this PR. They change which mode the port controller picks for the dock (no USB4 host capability in the DFP VDO, Thunderbolt mode disabled). They do not touch the PHY.Checks on this branch:
scripts/checkpatch.pl --strictreported only the missingSigned-off-by, which the commit now carries. arm64W=1build ofdrivers/phy/apple/with GCC 15.2.0 / binutils 2.46, also withCONFIG_KUNIT=yandCONFIG_PHY_APPLE_ATC_KUNIT_TEST=y: no new warnings. The existing-Wparenthesesinatc-j700-dp.hand the kernel-doc warnings onstruct apple_atcphyare unrelated. I ran thephy-apple-atc-muxKUnit suite under UML (x86_64,CONFIG_COMPILE_TEST): the newatcphy_test_target_mode_t8132_cioand the otheratcphy_test_target_mode*cases pass. Ten other cases fail the same way on the base, because UML'slogic_iomemdoes not back their test registers. I did not run KUnit on arm64.Not tested: this exact branch on hardware. Other T8132 boards. A TBT3 or USB4 dock that drives USB2 on D+/D- during the link (the one I have did not). J713/J715, where the path is unchanged.
No dependency: this applies to integration/aurora as is. The companion tipd PR, "usb: typec: tipd: Set a USB role for TBT3 on T8132 ports without a router", needs this one to have any effect on the J773g.
Hardware, 2026-11-19 (J773g, 27.2 stub; this PR's two commits on our display+Ethernet test tree, not this PR's own head; loader with the T8132 USB3 calibration copied, aurora-silicon/aura#113 at
53be8212; rear port, Thunderbolt 4 cable to a MacBook Pro; two boots, the second with one moredwc3-apple.ccommit that did not take effect):phy-apple-atc 40aa90000.phy: USB4/Thunderbolt is not available on this port: serving its USB2 only40a280000.usb mode=device, a gadget binds and stays configured at high speed, and the MacBook lists it at 480 Mb/sfailed to configure Type-C connection, nocable revalidation failedThe same cable on the same tree without these two commits:
sn201202x 1-0a: failed to configure Type-C connection: -19three times, thencable revalidation failed after 3 attempts, and no USB device.Not run: a Thunderbolt dock, host role against a USB4/TBT partner, replug.
Current review update
Rebased onto
integration/auroraat5746ef8a5, removed both AI commit trailers, and dropped the duplicatedev_infodefinition inquiesce.py. The fallback still runs before DisplayPort selects its USB mode.On
bcdc5193a, the targeted native ARM64 ATC object built and all 38 existing ATC host cases passed on Linux. The hardware runs above are historical. An exact-head J773g run with a rear USB4/TBT partner, USB2 enumeration, and three replug cycles, plus a calibrated J713/J715 run, remain outstanding.The original contribution disclosed LLM assistance without naming a model.
Assisted-by: LLM (OpenAI:Codex)