Skip to content

thunderbolt, phy, drm/apple: support T8103 USB4 dock and DCPEXT deep sleep - #3178

Merged
RyanTheTide merged 8 commits into
mainfrom
fix/t8103-usb4-s2r
Nov 27, 2026
Merged

RyanTheTide merged 8 commits into
mainfrom
fix/t8103-usb4-s2r

Conversation

@erikwb

@erikwb erikwb commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

What: Enable deep sleep (suspend-to-RAM) and clean reboot on T8103 (M1) with a USB4/Thunderbolt dock and external display attached, on top of #3172 (merged). Fixes DCPEXT DART register-window mapping and S2R stop/restart, ACIO host router sleep before domain power-off and on reboot (a router that does not sleep keeps its domain powered and refuses the system sleep), ATC PHY + dummy PIPE restoration after ps_atc*_common power-off, PCIe-C igc orderly removal, non-locking PCIe-C DART tunables save/restore, and dwc3-apple softdep on xhci_plat_hcd.
Tested: J313 M1 Air at ff817bf9845c (merged with #3171 for GPU S2R, as before), default cmdline, CalDigit TS5 dock (4K120 DSC card1-DP-2, 2.5GbE enP1p3s0, USB2 + USB3 hubs, USB audio): 2/2 consecutive real S2R cycles (rtcwake -d /dev/rtc1 -m mem -s 12) with live Hyprland preserved + clean systemctl reboot to the default kernel; a forced router-sleep failure (test-only module, not in this PR) refused deep sleep with the port, display and 2.5GbE kept up and no reset; no new kernel error classes against the default kernel's S2R; tools/asahi/pciec-policy-tests.py passed. J716c (T6050, M5 Max) at ff817bf9845c merged into main 40e5e29cc915, default cmdline, same CalDigit TS5 (40 Gb/s x2, 2.5GbE enP3p3s0, two DP monitors, USB2 + USB3 hubs): 2/2 real deep sleeps resumed with dock, displays, Ethernet and USB back, 0 failed units beyond the pre-existing one, and the same kernel error lines as one deep sleep on the Mac's default kernel.
Risk: two-way door · M1 (T8103), plus shared apple-dart / pcie-apple / dwc3-apple paths (all Macs)
Not yet: Other T8103 boards (J274/J293/J456/J457), s2idle/freeze regression pass with TS5 attached, a run of the igc orderly-removal path on another Mac whose ports power off for deep sleep (T8122 or T8142, not in the lab).

Details

Builds on #3172 (merged), which adds T8103 S2R and dcp_power DT definitions. Eight focused commits:

  1. bcdc74861256 drm/apple: dcp: support T8103 DCPEXT DART register mapping and S2R
    Adds apple,t8103-dcpext with map_reg_dart, s2r_ext, s2r_disp_dart_with_dcp, and DISPEXT0 power words (0x378/0x368), plus apple,display-power = <&dcp_power> on dcpext in t8103.dtsi. Without map_reg_dart, firmware 27.2 faults on stream 0 writing 0x23b3d0000 on external display power-down and crashes DCPEXT. Generalizes s2r_ext helpers to key on hw.s2r_layout/hw.s2r_ext, restores disp_dart streams on s2r_ext_start(), and gates firmware 27.0 opt-in on hw.s2r_untested so T8142 behavior is unchanged while T8103 runs on the default command line.
  2. 834e5defedc6 thunderbolt: apple: tear down T8103 ACIO routers for deep sleep
    Enables sleep_removes_domains, restart_on_wake, and phy_shared_with_dwc3 on apple_cio_t8103_hw so mem_sleep=deep tears down an attached router ahead of dwc3-apple's PM notifier and requests fresh cable state on wake, leaving s2idle and freeze unchanged. Extends tools/asahi/pciec-policy-tests.py to cover T8103 alongside T8122.
  3. 3e72a0ce5a9b PCI: apple: allow orderly removal of igc behind a tunneled PCIe-C port
    Allows igc (such as Intel I225-LMvP inside a CalDigit TS5) to unbind cleanly during PM_SUSPEND_PREPARE when deep sleep powers down the tunneled PCIe-C port.
  4. e1924d043f38 iommu/apple-dart: allow PCIe-C tunnel state save/restore with non-locking tunables
    Checks whether any apple,tunable entry actually sets DART_T8020_CONFIG_LOCK instead of rejecting any non-NULL dart->tunables in apple_dart_save_tunnel_state() / apple_dart_restore_tunnel_state(), and reapplies dart->tunables after apple_dart_hw_reset() on restore.
  5. aefd301d304e usb: dwc3: apple: declare pre-load softdep on xhci_plat_hcd
    Declares MODULE_SOFTDEP("pre: xhci_plat_hcd") so synchronous xhci-hcd binding in dwc3_apple_host_start() does not race ahead of xhci-plat-hcd loading (-517) when CONFIG_USB_XHCI_PLATFORM=m.
  6. bbd215282cce thunderbolt: apple: sleep T8103 ACIO router before power-off and on reboot
    Adds sleep_router_on_stop and enables sleep_router_on_stop, psd_power_cycle, and stop_at_reboot on apple_cio_t8103_hw. On T8103, dropping ps_atc*_cio while the ACIO host router firmware is active (M3_STAT=0x01000000) immediately resets the SoC, and rebooting with a live router panics in apple_dpin_irq_dispatch(). Putting the host router into ACIO sleep (M3_STAT=0x02000000) before NHI removal, detaching the RTKit mailbox via apple_rtkit_mailbox_off(), releasing/suspending ACIO power domains in reverse order, and stopping the router on reboot resolves both.
  7. dbb7b44b3d99 phy: apple: atc: restore T8103 PHY and dummy PIPE state after deep sleep
    T8103 deep sleep lowers ps_atc*_common behind genpd's back, wiping PHY registers and clearing PIPEHANDLER_DUMMY_PHY_EN. Adds sleep_drops_common and sets park_dummy_phy, restore_after_pd_off, and sleep_drops_common on atcphy_hw_t8103 so wake restores the tracked PHY mode before ACIO restarts (preventing a post-wake SoC reset) and re-enables the dummy PIPE on park (preventing Failed to lock pipehandler and usb2-port1: Cannot enable on tunneled USB3).
  8. ff817bf9845c thunderbolt: apple: keep the T8103 CIO domain up when the router does not sleep
    apple_cio_sleep_router_for_stop() now returns its error, and every apple_cio_stop() caller says what happens to a router that stays awake. System sleep and cable changes keep the port up as it was (NHI, co-processor and domains stay, PCIe-C admission reopens and a requested tunnel is restored), and the suspend notifier refuses the sleep with the error. Reboot and power-off remove the children but keep the co-processor and domains powered until the reset. A failed start's unwind and driver removal still power off, because the co-processor is freed and removal detaches the domains. A started port whose NHI is gone counts as a failed sleep (-ENODEV). pciec-policy-tests.py gains a host test of the stop paths with four negative controls.
Evidence

Hardware tested: J313 M1 MacBook Air (T8103, firmware 27.2) with CalDigit TS5 USB4 dock on front port (501ac0000.cio / 502280000.usb / 503000000.phy) carrying 3840x2160@120Hz DSC DisplayPort monitor (card1-DP-2), Intel I225-LMvP 2.5GbE (enP1p3s0), TS5 USB2/USB3 hubs, AirPods Max USB Audio, and AC power.

Build: 7.3.0-j313usb4s2r #199 built from dbb7b44b3d99 merged with #3171 (feat/t8103-gpu-27-2-s2r at 3577ce0e4885 for live Hyprland GPU S2R) plus patched t8103-j313.dtb (apple,display-power = <&dcp_power> on dcp@271c00000), default kernel command line.

Commands & results:

  • Host unit tests (python3 tools/asahi/pciec-policy-tests.py): all positive tests and negative controls passed (including t8103-drop-sleep-removes-domains, t8122-drop-sleep-removes-domains, t8122-drop-phy-shared).
  • Real physical S2R Cycle 1 & Cycle 2 (rtcwake -d /dev/rtc1 -m mem -s 12):
    • boot_id: unchanged across both cycles (695ad617-5a2d-469d-9ad9-31e0a15f6624).
    • /sys/power/suspend_stats/success: 0 -> 1 -> 2 (apple-sleep: back from sleep, boot object resumes 0 -> 1 -> 2, wake source NUB.SPMI0Sw3IRQ).
    • Live Hyprland PID 4838 preserved across Cycle 2.
    • USB4/TB: 0-1 (CalDigit, Inc. TS5) restored at 20.0 Gb/s x 2 lanes.
    • Display: card1-DP-2: connected (3840x2160@120 Hz DSC via 271c00000.dcp), card1-eDP-1: connected.
    • Network: enP1p3s0 UP (2500 Mbps Full Duplex), wlan0 UP.
    • USB: 1-1 (2188:5806 TS5 USB 2 Hub), 1-1.4 (2188:0617 TS5 USB 2 Hub), 1-1.4.2 (05ac:1117 AirPods Max USB Audio), 1-1.5 (2188:ace1 TS5 Billboard), 2-1 (8087:5787 USB3 HUB), 2-1.4 (2188:0629 TS5 USB 3 Hub) all re-enumerated cleanly.
    • Power: macsmc-ac/online=1, macsmc-battery/status=Full.
    • Zero Failed to lock pipehandler, zero usb2-port1: Cannot enable, zero DART faults, zero DCPEXT crashes, zero CIO or GPU errors.
  • Clean reboot (sudo systemctl reboot with TS5 attached): shut down cleanly without apple_dpin_irq_dispatch panic and booted back into default kernel.

Router-sleep error path (head ff817bf9845c): 7.3.0-j313usb4b1, built from ff817bf9845c merged with #3171 (3577ce0e4885), same DTB and default command line as #199.

  • Forced failure: a test-only thunderbolt_apple.ko (not in this PR) failed apple_nhi_cio_router_sleep() once before anything was sent. rtcwake -m mem returned write error, suspend_stats/fail went 0 -> 1, boot_id unchanged. The log shows the PCIe-C hierarchy removed in order, CIO host router did not go to sleep: -5, the port stays up with its domains powered, refusing system sleep: the port cannot be powered off (-5), PM: suspend exit, then PCIe-C hierarchy restored after tunnel activation and igc relinking at 2500 Mb/s. TS5 stayed at 20 Gb/s, card1-DP-2 stayed connected/enabled, and Hyprland kept the same PID. A real S2R on the same boot then succeeded (success 0 -> 1).
  • Clean module (sha256 f3e33928cdb4a32c..., no test parameter), new boot: 2/2 consecutive real S2R cycles, success 0 -> 1 -> 2, same boot_id, CIO controller sleep state 0x2000000: 0 before each power-off and restarting port after system sleep after each wake. After both cycles: TS5 at 20.0 Gb/s x 2, card1-DP-2 + card1-eDP-1 connected, enP1p3s0 up at 2500 Mb/s, Hyprland on the same PID, USB 1-1, 1-1.4, 1-1.4.2 (AirPods Max USB Audio), 1-1.5, 2-1, 2-1.4 present, 0 failed units, no DART faults, pipehandler or USB-enable errors, DCPEXT crashes, panics or SErrors.
  • Kernel errors: the same classes as one S2R on the default 7.3.0-j313usb4s2r #199 (of_irq_parse_pci on PCIe-C re-enumeration, brcmfmac/hci_bcm4377 D3hot after the wake, PS fpwm1, DCPDP2X admission, DCP init props). None from thunderbolt, ACIO or PCIe-C.
  • Clean systemctl reboot from the trial kernel with TS5 attached: normal systemd-shutdown, no apple_dpin_irq_dispatch panic, booted the default j313-usb4s2r.

Second generation: J716c (T6050 / M5 Max), head ff817bf9845c: 7.3.0-ewb325+, built from main 40e5e29cc915 with ff817bf9845c merged (clean merge), with the config of the Mac's default 7.3.0-ewb317+. Booted once through the Mac's one-shot boot marker with the default boot arguments; the default boot was not changed. CalDigit TS5 (USB4 0-1 at 40.0 Gb/s x 2), Intel I225-LMvP (igc, enP3p3s0), two DP monitors through the dock (card3-DP-1, card3-DP-4) plus card3-eDP-1, TS5 USB2/USB3 hubs, on AC.

  • 2/2 real deep sleeps (mem_sleep deep, rtcwake -m mem -s 30): suspend_stats/success 0 -> 1 -> 2, fail 0, apple-sleep: back from sleep, boot object resumes 0 -> 1 -> 2. Wake sources: SMC.OutboxNotEmpty (cycle 1, AC traffic) and NUB.SPMI0Sw3IRQ ... rtc (cycle 2). Both times: T6050 sleep: router asleep in place, tunnels kept, router woken in 429-431 ms (dock back), CIO PCIe-C link and DMA restored, igc ... NIC Link is Up 2500 Mbps.
  • After each wake: TS5 at 40.0 Gb/s x 2, card3-DP-1, card3-DP-4, card3-eDP-1 connected and enabled (DPMS on), enP3p3s0 up and passing traffic (3/3 to the gateway through the dock, 0.22-0.27 ms; the build host reaches both of its addresses), USB 1-1, 1-1.4, 1-1.5, 2-1, 2-1.4 present, Wi-Fi up. No WARNING, BUG, Oops or DART faults. Failed units: only aurora-peripherals.service, failed on the default kernel before the run too.
  • A/B against one deep sleep on the default 7.3.0-ewb317+, same dock, after restoring the default: the same kernel error lines on both (dwc3-apple ... genpd_prepare returns -11 at entry, Centauri country update failed: -125, transient 01:00.1/01:00.2 device inaccessible on wake, DCP undeclared provider clock index 0). None is new with this PR.
  • What this row covers on T6050: the merged apple-dart, pcie-apple, dwc3-apple, thunderbolt and atc code builds, boots and survives docked deep sleep with no regression. The three shared changes are not reached there: the DART tunnel save/restore only runs on DART_T8020 DARTs (in this tree only apple,t8103-dart/apple,t8103-usb4-dart; T6050's are apple,t8110-dart, so it returns -EOPNOTSUPP before and after the change), apple_pcie_tunnel_remove_orderly() runs only on ports that power off for deep sleep (sleep_removes_domains: T8103, T8122, T8142; the J716c router sleeps in place and keeps its tunnels), and xhci-plat-hcd is built in (CONFIG_USB_XHCI_PLATFORM=y), so the softdep has nothing to load. On T8103 the J313 rows above run all three.

Add an apple,t8103-dcpext match entry with map_reg_dart, s2r_ext, s2r_disp_dart_with_dcp, and DISPEXT0 power words (0x378/0x368), and add apple,display-power on t8103's dcpext node.

Without map_reg_dart, firmware 27.2 faults on stream 0 writing disp-4 (0x23b3d0000) during its first external display power-down and crashes DCPEXT. Generalize the s2r_ext domain/power-word helpers to key on hw.s2r_layout and hw.s2r_ext instead of a SoC compatible check, restore disp_dart streams on s2r_ext_start when s2r_disp_dart_with_dcp is set, and gate firmware 27.0 s2r_ext on hw.s2r_untested so T8142 keeps its existing opt-in while T8103 works with the default command line.

Signed-off-by: Erik Bourget <[email protected]>
Like T8122, T8103 deep sleep cuts power to the CIO/ATC domains and shares the ATC PHY with DWC3. Set sleep_removes_domains, restart_on_wake, and phy_shared_with_dwc3 on apple_cio_t8103_hw so mem_sleep=deep tears down an attached router ahead of DWC3's PM notifier and requests fresh cable state on wake, while s2idle and freeze leave the port up unchanged.

Update tools/asahi/pciec-policy-tests.py to cover T8103 alongside T8122.

Signed-off-by: Erik Bourget <[email protected]>
igc_remove() unregisters its netdev and disables the PCI device without touching the PM notifier chain, so it is safe to remove during PM_SUSPEND_PREPARE when deep sleep powers down a USB4/Thunderbolt router (such as a CalDigit TS5 dock carrying an Intel I225-LMvP NIC).

Signed-off-by: Erik Bourget <[email protected]>
…king tunables

T8103 USB4 PCIe-C DARTs receive apple,tunable entries from the bootloader that do not set DART_T8020_CONFIG_LOCK. Check whether any tunable entry actually sets the lock bit instead of rejecting any non-NULL dart->tunables in apple_dart_save_tunnel_state() and apple_dart_restore_tunnel_state(), and reapply dart->tunables after apple_dart_hw_reset() on restore.

Signed-off-by: Erik Bourget <[email protected]>
dwc3_apple_host_start() binds xhci-hcd synchronously under appledwc->lock and returns -EPROBE_DEFER if no driver binds it before platform_device_add()/device_attach() returns. When CONFIG_USB_XHCI_PLATFORM=m, the first USB host plug-in after boot raced ahead of udev loading xhci-plat-hcd and failed with -517. Declare MODULE_SOFTDEP("pre: xhci_plat_hcd") so xhci-plat-hcd is loaded before dwc3-apple.

Signed-off-by: Erik Bourget <[email protected]>
…eboot

On T8103, powering off ps_atc*_cio while the ACIO host router firmware
is still active (M3_STAT=0x01000000) triggers an immediate SoC reset.
Similarly, rebooting with a started router leaves the router running
while PCIe-C and DART shutdown callbacks tear down its devices, causing
a panic in apple_dpin_irq_dispatch().

Add a sleep_router_on_stop hardware flag and enable it along with
psd_power_cycle and stop_at_reboot on apple_cio_t8103_hw:

- Put the host router into ACIO sleep via apple_nhi_cio_router_sleep()
  (M3_STAT=0x02000000) before removing NHI children.
- Detach and flush the RTKit mailbox via apple_rtkit_mailbox_off()
  before freeing the RTKit instance.
- Release and synchronously suspend ACIO power domains in reverse order.
- Register the reboot notifier so a started router is stopped cleanly
  before reboot.

Signed-off-by: Erik Bourget <[email protected]>
T8103 deep sleep powers off ps_atc*_common behind genpd's back, wiping
the ATC PHY register state and clearing PIPEHANDLER_DUMMY_PHY_EN in
PIPEHANDLER_NONSELECTED_OVERRIDE. Without restoring the tracked PHY mode
on wake, restarting the ACIO router on an unconfigured PHY resets the
SoC; without re-enabling the dummy PIPE backend when parking the PIPE,
the subsequent USB4 PIPE handoff fails to lock and tunneled USB3 fails
to enable.

Add a sleep_drops_common flag to atcphy_hw and enable park_dummy_phy,
restore_after_pd_off, and sleep_drops_common on atcphy_hw_t8103 so
resume marks pd_was_off, re-enables the dummy PIPE when parking, and
restores the tracked PHY mode before consumers restart.

Signed-off-by: Erik Bourget <[email protected]>
@erikwb
erikwb requested review from a team and DjDeveloperr as code owners November 26, 2026 00:30
@github-actions github-actions Bot added area:display Area from CODEOWNERS (bot) area:gpu Area from CODEOWNERS (bot) area:platform Area from CODEOWNERS (bot) area:usb Area from CODEOWNERS (bot) blast:all Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 26, 2026
@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Merge readiness at ff817bf9: not ready yet

Check Detail
CI at head no failing: pr-text / pr-text, pr-text / pr-text
Review ok approved by DjDeveloperr
Requested changes ok none
Hardware row at head ok in the PR body at ff817bf9
Conflicts ok none
PR text ok Risk: two-way · M1 (T8103), plus shared apple-dart / pcie-apple / dwc3-apple paths (all Macs)

Areas: area:display, area:gpu, area:platform, area:usb

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: FINISH, then merge at dbb7b44b3d99

Blockers:

  1. drivers/thunderbolt/apple.c:3241: A router sleep error is logged and discarded. It can happen before the sleep request is sent, yet apple_cio_stop() still drops the power domains at line 3487. The new comment at line 3266 describes a T8103 SoC reset if the router is still active. Keep the domain powered until sleep succeeds or a safe fallback takes over. Return the error to the existing suspend notifier and unwind any tunnel state already changed.
  2. The J313 dock run covers T8103. The shared DART, PCIe, and DWC3 paths still need a dock suspend and resume result on a second generation.

Checked: The successful path orders router sleep before NHI removal and power-off. The DART change retains the lock check and reapplies tunables before restoring streams.

@github-actions github-actions Bot added the changes-requested A reviewer requested changes (bot) label Nov 26, 2026
… not sleep

On T8103 the ACIO host router must be in ACIO sleep before ps_atc*_cio
is powered off: dropping the domain with the router firmware still
active resets the SoC. apple_cio_sleep_router_for_stop() logged a
failed sleep request and apple_cio_stop() went on to remove the NHI and
release the domains anyway. The request can fail before anything is
sent to the router (no VSE capability, a failed config read or write)
or after it (the controller never reports the sleep state).

Return the sleep error and let each caller of apple_cio_stop() say what
happens to a router that stays awake:

- System sleep and cable changes keep the port up as it was: the NHI,
  the co-processor and the domains stay, PCIe-C admission reopens and
  a PCIe tunnel that was requested is restored, as after a tunnel
  teardown. The suspend notifier gets the error and refuses the sleep;
  the peer state recorded for the restart is committed only once the
  port is off. A refused unplug is retried on the next cable change.
- A reboot or power-off removes the children but keeps the
  co-processor and the domains powered until the platform reset.
- The unwind of a failed start and driver removal still power off:
  the start frees the co-processor, and removal detaches the domains
  with the device.

A started port whose NHI is gone cannot send the request either, so
that is reported as -ENODEV instead of being treated as asleep.

Add a host test of apple_cio_stop() and apple_cio_remove_children()
for each case, with negative controls, to pciec-policy-tests.py.

Signed-off-by: Erik Bourget <[email protected]>
@erikwb

erikwb commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Note

🤖 Claude Opus 5.5 responding on behalf of erikwb

@DjDeveloperr Blocker 1 is fixed in ff817bf9845c (thunderbolt: apple: keep the T8103 CIO domain up when the router does not sleep). Blocker 2 is handled separately.

  • apple_cio_sleep_router_for_stop() now returns the error (drivers/thunderbolt/apple.c:3252), and apple_cio_remove_children() / apple_cio_stop() take what to do with a router that stays awake:
    • System sleep and cable changes (apple_cio_sleep_teardown(), apple_cio_tbt_switch_set()): nothing is removed and the NHI, co-processor and ps_atc*_cio stay up. apple_cio_reopen_pcie_tunnel() reopens PCIe-C admission and restores a requested tunnel through the existing apple_pcie_tunnel_restore() path. The error goes back to the suspend notifier, which refuses the sleep. The peer state for the post-sleep restart is committed only after the port is off.
    • Reboot and power-off: the children go, but the co-processor and domains stay powered until the reset.
    • A failed start's unwind and driver removal: still power off. The start frees the co-processor, and removal detaches the domains with the device, so they cannot be held past it.
  • A started port whose NHI is gone now reports -ENODEV instead of counting as asleep.
  • tools/asahi/pciec-policy-tests.py has a host test of each case, with four negative controls.

Tested on the J313 at ff817bf9845c with the TS5 (details in the PR body under Evidence):

  • A test-only module that fails the sleep request before anything is sent made rtcwake -m mem fail with refusing system sleep: the port cannot be powered off (-5). There was no reset, the TS5, card1-DP-2 and 2.5GbE stayed up, the PCIe-C hierarchy was restored, and a real S2R on the same boot then succeeded.
  • With the clean module: 2/2 consecutive real S2R cycles and a clean reboot.

@github-actions github-actions Bot added the ci-failing A check failed at the PR head (bot) label Nov 26, 2026
@erikwb

erikwb commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Note

🤖 Claude Opus 5.5 responding on behalf of erikwb

Blocker 2: second-generation dock row added at head ff817bf9845c, on J716c (T6050 / M5 Max) with the same CalDigit TS5. 2/2 real deep sleeps resumed with no regression against the Mac's default kernel. Details are in the PR body's Evidence section.

  • Build: main 40e5e29cc915 with ff817bf9845c merged, using the default kernel's config. Default boot arguments, one-shot boot, default boot left unchanged.
  • Result: suspend_stats/success went 0 -> 1 -> 2 (fail 0). After each wake the TS5 came back at 40 Gb/s x 2, igc (enP3p3s0) was up at 2.5 Gb/s and passing traffic, both DP monitors and eDP were enabled, and the TS5 USB2/USB3 hubs were present. No WARN, BUG or DART faults. The only failed unit was one that already fails on the default kernel.
  • A/B: one deep sleep on the default 7.3.0-ewb317+ logs the same error lines, so none of them comes from this PR.

The three shared changes cannot run on T6050 or T8132, so this row shows no regression on a second generation but does not run them:

  • apple-dart: apple_dart_{save,restore}_tunnel_state() return -EOPNOTSUPP unless hw->type == DART_T8020. In this tree only apple,t8103-dart and apple,t8103-usb4-dart map to that type. T6050 and T8132 use apple,t8110-dart, so they return -EOPNOTSUPP both before and after the change.
  • pcie-apple: apple_pcie_tunnel_remove_orderly() is only called for ports that power off for deep sleep: sleep_removes_domains (T8103, T8122, T8142), or a T6050 port whose in-place router sleep failed to set up. On the J716c the router sleeps in place and keeps its tunnels (T6050 sleep: router asleep in place, tunnels kept), so igc stays bound.
  • dwc3-apple: the softdep only matters with CONFIG_USB_XHCI_PLATFORM=m. The T6050 config builds it in.

All three run on T8103, which the J313 rows in the PR body cover. A row that runs the igc path on a second generation needs a T8122 or T8142 Mac. There is none in the lab, so the PR body lists it under Not yet.

@DjDeveloperr
DjDeveloperr dismissed their stale review November 26, 2026 23:21

Superseded by the review at ff817bf

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: approve at ff817bf9845c. Both blockers from my earlier review are resolved, so I'm dismissing it.

Blocker 1 (router sleep error ignored): fixed in ff817bf9845c.

  • apple_cio_sleep_router_for_stop() now returns the error. A started port with no NHI is reported as -ENODEV, not as asleep.
  • apple_cio_stop()/apple_cio_remove_children() take an explicit choice of what to do with a router that stays awake:
    • System sleep and cable changes (KEEP): nothing is removed. PCIe-C admission reopens and a requested tunnel is restored. apple_cio_sleep_teardown() returns the error, so the sleep is refused. The peer state is committed only after the port is off.
    • Reboot and power-off (HOLD): the children go, but the co-processor and the domains stay powered until the reset.
    • Start unwind and driver removal (FORCE): these still power off, and the reason is written down in the comments.
  • The J313 run with an injected sleep failure shows the refusal path in practice: refusing system sleep ... (-5), no reset, and the dock, DP and 2.5GbE stayed up. A real S2R on the same boot then succeeded. The new pciec-policy-tests.py cases cover each mode, with negative controls.

Blocker 2 (second-generation row): covered.

  • Your J716c (T6050) dock row at this head shows 2/2 deep sleeps with no regression against the default kernel.
  • As you note, the shared DART change applies only to DART_T8020, which in this tree means T8103. The DWC3 softdep is a no-op with the T6050 config.
  • Not blocking: the one shared change that also runs outside T8103 is igc joining the orderly-removal allow-list in pcie-apple.c. It applies to the ports that power off for sleep on T8122/T8142. That path is untested until a T8122/T8142 dock row exists, so keep it under "Not yet" as the PR body does.

Checked

  • ff817bf9845c is a single commit on top of the reviewed head.
  • CI is green at this head (28 checks), and every commit is signed off.

Merging is left to the PR Merge Lane.

@github-actions github-actions Bot removed changes-requested A reviewer requested changes (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 26, 2026
erikwb added a commit that referenced this pull request Nov 27, 2026
T8103's apple_dcp_hw_t8103_dcpext (.s2r_ext = true) lives in #3178 rather
than feat/dcp-v27-ext-idle-off, leaving the dcp_s2r_domains_off() and
dcp_s2r_ext_start() hunks unreachable on this stack. Narrow this PR to the
T8020 display DART dark-save fix and dcp_s2r_warm_restart() wake-order fix,
which apply directly to T8103 disp0 on this branch.

Signed-off-by: Erik Bourget <[email protected]>
@RyanTheTide
RyanTheTide merged commit ef29ad1 into main Nov 27, 2026
32 of 36 checks passed
@RyanTheTide
RyanTheTide deleted the fix/t8103-usb4-s2r branch November 27, 2026 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:display Area from CODEOWNERS (bot) area:gpu Area from CODEOWNERS (bot) area:platform Area from CODEOWNERS (bot) area:usb Area from CODEOWNERS (bot) blast:all Macs affected, from Merge risk (bot) ci-failing A check failed at the PR head (bot) door:two-way Revertible or not, from Merge risk (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants