Repository navigation
arm64: dts & PCI: apple: enable J773g port 2 Ethernet and T8132 multi-port deep sleep - #2770
DjDeveloperr wants to merge 4 commits into
Conversation
Enable the J773g Broadcom Gigabit Ethernet root port (port02) and its DART (dart_apcie2) alongside the port00 radio: - Drop the port-0-only apple,managed-sids / apple,dma-range clamps on &dart_apcie0 and &pcie0 and map bus 0x200 to &dart_apcie2 in iommu-map. - Drop dart_apcie2's power-domains reference (matching dart_apcie0, since ps_apcie_sys_gp stays off under the T8132 PMGR policy) and mark &dart_apcie2 and &port02 status = "okay". Signed-off-by: Diljit Singh <[email protected]>
Describe the AP CLKREQ# GPIO on T8132 PCIe port 2 (AP GPIO 162, active low) in t8132-apcie-port2.dtsi and port 0's CLKREQ# GPIO (AP GPIO 160, active low) plus both ports' ADT maximum-link-speed values (Gen2 on port00, Gen1 on port02) in t8132-j773g.dts. These properties let the PCIe host driver restore CLKREQ# input direction and root-port link-speed caps when retraining T8132 multi-port links after deep sleep. Signed-off-by: Diljit Singh <[email protected]>
…eep sleep Multi-port T8132 PCIe hosts (such as J773g with port0 radio and port2 Ethernet) do not use the J713 single-port managed-radio transaction. During deep sleep, apple-sleep lowers the shared apcie_gp and apcie_phy_sw domains, wiping every port's registers, RID2SID and MSI tables, and PHY state while leaving endpoints powered under PERST#. Register a per-port deep sleep recovery path for non-managed, non-tunneled apple,t8132-pcie hosts. Save each port's interrupt mask, clock policy, MSI configuration, and RID2SID mappings in suspend_noirq and keep the host on the awake path so apple-sleep stops all ports cleanly. On resume_noirq after a real deep wake, restore each port's defaults, DT tunables (falling back to port 0's tables when a peer port omits them), PHY refclks, DBI link speed and x1 width, RID2SID and MSI mappings, host-resumed DART, and root port config space, then deassert AP PERST# and retrain the link. Notify apple-sleep via apple_sleep_radio_port_up() once a port comes back up. Signed-off-by: Diljit Singh <[email protected]>
|
Review of the three commits on top of #2762 (b5b3375, 3a049d0, edcee3b) at edcee3b. J713 looks unchanged. The managed-SID and dma-range clamps stay in t8132-jxxx.dtsi and are deleted only in t8132-j773g.dts. Error paths in the retrain (edcee3b):
Overlap with apple-sleep:
Values and constants:
DT:
Testing: the 3/3 J773g deep-sleep table covers the case where both ports come back. Missing are a row where one port fails to retrain (e.g. port 2 held down), followed by a second deep sleep, and a J713 deep-sleep row at edcee3b showing the managed radio path unchanged. Assisted-by: LLM (Claude:Opus 5.5) |
|
@RyanTheTide All review items from your 05:27Z review are fixed locally (
Holding the force-push on Assisted-by: LLM (Gemini:4 Neon) |
There was a problem hiding this comment.
Verdict: HOLD at edcee3b2
Blockers:
- Targets non-
mainbase branchdjdev/t8132-apcie-port2-shared-regs; fullmainCI has not run.
Checked:
- Verified base ref is
djdev/t8132-apcie-port2-shared-regswith no CI checks recorded at headedcee3b2. - Deferred final review until the base branch lands and this PR is retargeted/rebased onto
mainwith green CI.
Evidence
- Base ref:
djdev/t8132-apcie-port2-shared-regs. - Checks at
edcee3b2: none.
|
@DjDeveloperr: stale-PR closeout. The fixes for the 11-22 review are described at |
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
|
@DjDeveloperr last call on this one. The review fixes you described at |
Ryan's review of this series (11-22) asked for the following changes. They were done on a rewritten copy of the three commits; this commit applies the same final tree on top of the pushed branch instead of replacing it. - dts: move port02's clkreq-gpios from the shared t8132-apcie-port2.dtsi to the J773g board file, next to its max-link-speed, since the ADT function-clkreq line is board wiring. - dts: drop the bootloader managed-radio apple,dma-range window on dart_apcie0 along with the managed-SID clamp, so Linux owns the DART's full IOVA range, and explain why dart_apcie2 drops its power-domains reference. - pcie-apple: gate multi-port deep sleep on a t8132_sleep flag in the T8132 hw_info, not on the compatible string. - pcie-apple: apply each port's own sleep tunables; no fallback to port0's tables. - pcie-apple: register APCIe port ownership with apple-sleep for the lifetime of the host (devm action), so apple-sleep skips its unowned port fallback on wake. - pcie-apple: snapshot and restore the DBI link mode and width, and keep the last good snapshot when a previous wake failed to restore a port. - pcie-apple-radio: share the T8132 port reset register table with pcie-apple.c instead of keeping a second copy. Signed-off-by: DjDeveloperr <[email protected]>
There was a problem hiding this comment.
Verdict: FIX, then merge at 2995b2b3
Blockers:
- Unresolved symbols against base branch:
drivers/pci/controller/pcie-apple.ccallsapple_sleep_apcie_ports_owned()(lines 187 and 261 of the diff) andapple_sleep_apcie_port_up()(line 476 of the diff), neither of which is declared ininclude/linux/soc/apple/sleep.hat2995b2b3(they live in open PR#2763, which is not in#2762/djdev/t8132-apcie-port2-shared-regs). Wait for#2762and#2763to land and rebase/retarget this PR ontomainso full CI builds and runs. - Partial probe failure leaves earlier port DART permanently unresumed across deep sleep (
drivers/pci/controller/pcie-apple.c,apple_pcie_t8132_sleep_probe()): inside thelist_for_each_entry(port, &pcie->ports, entry)loop,apple_pcie_t8132_port_dart(port)callsapple_dart_set_host_resumes(&pdev->dev)(settingdart->host_resumes = trueindrivers/iommu/apple-dart.c:7113). If a later port fails validation (!port->phy, missing/sleepingPERST#, ordevm_kcallocfailure) ordevm_add_action_or_reset()fails,apple_pcie_t8132_sleep_probe()returns early withpcie->t8132_sleep = false, soapple_pcie_t8132_resume_noirq()never runs whileapple-dart.c:7051skips resuming any DART withhost_resumes == trueon firmware wake. Deferapple_pcie_t8132_port_dart()/apple_dart_set_host_resumes()to a second pass only after every port passes validation anddevm_add_action_or_reset()succeeds. - Missing
mainCI and exact-head hardware row: fullmainCI has not run on2995b2b3, and the 3/3 J773g deep-sleep verification row predates2995b2b3.
Checked:
arch/arm64/boot/dts/apple/t8132-j773g.dts: board-scopedclkreq-gpiosandmax-link-speedonport00/port02, removal ofapple,managed-sidsandapple,dma-rangeondart_apcie0/pcie0, and documented removal ofpower-domainsondart_apcie2.drivers/pci/controller/pcie-apple.candpcie-apple-radio.c: sharedapple_pcie_t8132_port_reset_regs[]table (defined before#include "pcie-apple-radio.c"),.t8132_sleephw_infoflag gating, per-portsleep_tables[4]parsing with no cross-port fallback,saved_msimap/saved_rid2sid/saved_link_*save/restore, andt8132_sleep_downhandling across non-firmware and firmware resume.- Checked
include/linux/soc/apple/sleep.handdrivers/iommu/apple-dart.cat2995b2b3.
Evidence
include/linux/soc/apple/sleep.hat2995b2b3declaresapple_sleep_radio_port_{up,down,wake}only;apple_sleep_apcie_ports_ownedandapple_sleep_apcie_port_upare absent.drivers/iommu/apple-dart.c:7051(if (dart->host_resumes && pm_resume_via_firmware())) relies on the host driver callingapple_dart_host_resume()whenhost_resumesis set.- Non-blocking nit:
apple_pcie_t8132_port_dart()holds a device ref fromof_find_device_by_node()without a matchingdevmput_device(), and calling it lazily fromapple_pcie_t8132_suspend_noirq()invokesdevice_link_add()duringsuspend_noirq— worth binding strictly during probe withdevmcleanup when fixing blocker 2.
Summary
Enable Broadcom Gigabit Ethernet on J773g APCIe port 2 (
port02/dart_apcie2) alongside the port 0 radio, and add per-port suspend/resume link retraining for multi-port T8132 PCIe controllers across real deep sleep.Commits
b5b337568c161—arm64: dts: apple: t8132-j773g: enable Broadcom Ethernet on APCIe port 2: drops port-0-onlyapple,managed-sids/apple,dma-rangeclamps on&dart_apcie0and&pcie0, maps bus0x200to&dart_apcie2, and enables&dart_apcie2and&port02.3a049d07710e5—arm64: dts: apple: t8132: wire apcie clkreq GPIOs and J773g link speeds: wiresclkreq-gpiosfor port 2 (AP GPIO 162, active low) and J773g port 0 (AP GPIO 160, active low) plus ADTmax-link-speedcaps (Gen2 onport00, Gen1 onport02).edcee3b20673e—PCI: apple: suspend and retrain T8132 multi-port controllers across deep sleep: saves each port's interrupt mask, clock policy, MSI, and RID2SID mappings insuspend_noirq, and on real deep wake restores port defaults, DT tunables, PHY refclks, DBI link speed/width, RID2SID/MSI tables, host-resumed DART, and root port config space before deasserting PERST#, retraining each link, and callingapple_sleep_radio_port_up().Dependencies
djdev/t8132-apcie-port2-shared-regs, base branch) for sharedt8132-apcie-port2.dtsiandapple,pcie.yamlbindings.soc: apple: sleep: stop all enabled apcie ports before lowering apcie) for stopping all enabled APCIe ports before lowering APCIe inapple-sleep.Live Verification — 3/3 Real Deep Sleep (
dcp66-m4prod5-deepsleep)Tested on live M4 Mac mini (
J773g/T8132, macOS 27.226B123,7.3.0-ARCH-m4prod5):boot object resumesport 0(Radio)port 2(Ethernet)tg3 end00 -> 1port 0: link restored after deep sleep(5GT/s x1)port 2: link restored after deep sleep(2.5GT/s x1)UP 1000Mb/s Full1 -> 2port 0: link restored after deep sleep(5GT/s x1)port 2: link restored after deep sleep(2.5GT/s x1)UP 1000Mb/s Full2 -> 3port 0: link restored after deep sleep(5GT/s x1)port 2: link restored after deep sleep(2.5GT/s x1)UP 1000Mb/s Fullscripts/checkpatch.pl --strict: 0 errors, 0 warnings, 0 checks on all 3 commits. 0 oops/warnings/SErrors across all 3 wakes.