Skip to content

arm64: dts: apple: t6041-j616c: system power state for the port controllers - #2174

Merged
RyanTheTide merged 2 commits into
aurora-silicon:mainfrom
AxxzyWasTaken:pr/j616c-usbpd-sleep-ssps
Nov 27, 2026
Merged

RyanTheTide merged 2 commits into
aurora-silicon:mainfrom
AxxzyWasTaken:pr/j616c-usbpd-sleep-ssps

Conversation

@AxxzyWasTaken

@AxxzyWasTaken AxxzyWasTaken commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

What: Add apple,sleep-ssps to the four shared T6041 SN201202x USB-C/MagSafe port controller nodes (hpm0, hpm1, hpm2, hpm5) in arch/arm64/boot/dts/apple/t6041-j614c-j616c.dtsi so the tipd/sn201202x driver sends system power state S3 before firmware-driven suspend and S0 after resume, matching J700/J714s/J716c/J813/J815.

Tested:

  • J616C (MacBook Pro 16-inch, M4 Max, T6041) booted at exact head 9e8f843d017c (7.3.0-pr2174-9e8f843d+, unmodified kernel + t6041-j616c.dtb):
    • Verified all 4 apple,sleep-ssps properties live in /proc/device-tree/spmi@509188000/usb-pd@{8,a,c} and /proc/device-tree/spmi@509198000/usb-pd@c.
    • Ran 2/2 consecutive deep S2R cycles (apple-pmu-rtc rtc1 12 s wakealarm, mem_sleep=s2idle [deep]), both rc=0 (PM: suspend entry (deep) -> PM: suspend exit).
    • Post-resume: all 4 SN201202x controllers (1-08, 1-0a, 1-0c, 2-0c) bound (driver=sn201202x, runtime_status=suspended), AC online (macsmc-ac online=1, tps6598x-source-psy-1-08 online=1, battery 95% Not charging), 0 failed systemd units, 0 tipd/sn201202x/SPMI/asahi/DART/IOMMU errors.
  • Host checks at 9e8f843d017c: CHECK_DTBS=y (apple,sn201202x.yaml) on both t6041-j616c.dtb and t6041-j614c.dtb 0 errors/warnings; scripts/checkpatch.pl --strict --git HEAD~1..HEAD 0/0/0; t6041-j616c.dtb byte-for-byte identical to e7cdc52b5606.

Risk: two-way · Scoped to shared t6041-j614c-j616c.dtsi (hpm0, hpm1, hpm2, hpm5) on deep S2R; s2idle is unchanged (pm_suspend_via_firmware() gated).

Not yet: Live boot on J614c (14" M4 Max); external USB-C DisplayPort / active USB-C hub plug-across-sleep testing; apple,sleep-ssps-rules opt-in.

@AxxzyWasTaken
AxxzyWasTaken force-pushed the pr/j616c-usbpd-sleep-ssps branch from 7d925f6 to c9140b0 Compare November 21, 2026 09:48
@RyanTheTide

Copy link
Copy Markdown
Contributor

Looks good; approve once the J616c suspend-to-RAM row below is on this head with #1664.

The DT change itself is correct: the four nodes exist in t6041-j614c-j616c.dtsi (hpm0/hpm1 on nub_spmi_a0, hpm5 at 0x8, hpm2 on nub_spmi_a1), all are interrupt-driven, so sn201202x_macos_entry() (drivers/usb/typec/tipd/spmi.c:1288-1296) is never taken and the USBw notifier registered at spmi.c:1028-1036 returns at once (!sn->macos_sleep). Only the plain S3/S0 path in core.c runs, and only when pm_suspend_via_firmware(), so nothing changes until #1664 (still open) lands. dt-checks and host-tests pass.

  1. arch/arm64/boot/dts/apple/t6041-j616c.dts:65-81: the property's only proof is "booted since 9 Nov"; the S3 result is logged at dev_dbg, and on this board the resume side is silent in both directions: without apple,sleep-ssps-rules, drivers/usb/typec/tipd/core.c:2039-2040 sets ret = 0 after the S0 switch, so a controller that stays in S3 after the wake is neither logged nor marked setup_pending. A controller left in S3 is exactly the failure this property can introduce (port or MagSafe charging not coming back), so the row has to show the S0 side by behaviour, not by log lines.
  2. Nit: the J614c shares these nodes through t6041-j614c-j616c.dtsi; if the J616c row passes, consider putting the property in the shared dtsi and asking a J614c owner for the same row, so the two boards don't drift.

HW row: J616c (M4 Max), this head + #1664 on current integration/aurora, default command line, dyndbg="file drivers/usb/typec/tipd/core.c +p"; 5 firmware suspend-to-RAM cycles (rtcwake on rtc1) with a USB device on hpm0, a DisplayPort sink on hpm2 and MagSafe charging; pass = "system power state S3" from all four controllers each cycle, no "didn't take system power state" warning, after each wake the USB device re-enumerates, the display relights and MagSafe reports charging within 10 s; 0 AVC, 0 failed units, no new kernel errors.

Assisted-by: LLM (Claude:Opus 5.5)

@AxxzyWasTaken

Copy link
Copy Markdown
Contributor Author

Rebased onto integration/aurora (cacf35543b4d5) as a9cb8bbd6db2 (dt_binding_check, CHECK_DTBS=y, and checkpatch --strict 0/0/0 all clean). Queued for the 5-cycle rtcwake firmware S2R row on J616C as soon as #1664 v2 is boot-tested.

@AxxzyWasTaken
AxxzyWasTaken force-pushed the pr/j616c-usbpd-sleep-ssps branch 2 times, most recently from a9cb8bb to 7b1a2f3 Compare November 22, 2026 15:10
@AxxzyWasTaken

Copy link
Copy Markdown
Contributor Author

Rebased onto integration/aurora (eb6d9ec180e8 → 7b1a2f307a0b) to resolve the EOF conflict in arch/arm64/boot/dts/apple/t6041-j616c.dts after #2750/#2753. Zero semantic changes (t6041-j616c.dtb W=1 clean, 4 apple,sleep-ssps properties intact). Keeping Draft pending the paired #1664 5-cycle S2R row.

@AxxzyWasTaken

Copy link
Copy Markdown
Contributor Author

Rebased onto integration/aurora (0bbe021a28bd → f890aae61f79) to resolve the EOF conflict in arch/arm64/boot/dts/apple/t6041-j616c.dts after #3027 (apr0) merged. Zero semantic diff (git range-diff shows only EOF context lines); t6041-j616c.dtb compiles cleanly with W=1 and retains both &apr0 and apple,sleep-ssps on hpm0/hpm1/hpm2/hpm5.

@AxxzyWasTaken
AxxzyWasTaken force-pushed the pr/j616c-usbpd-sleep-ssps branch 2 times, most recently from f890aae to 4ae3ec0 Compare November 24, 2026 19:11
…ollers

macOS tells the USB-C port controllers the system power state (SSPS),
S3 before a sleep and S0 after it. The tipd driver does the same around
a firmware-driven suspend for a controller with apple,sleep-ssps, as the
J700, J714s, J716c and J813/J815 have. Give it to the J616c's four
SN201202x controllers: hpm0, hpm1, hpm2 and MagSafe's hpm5.

Signed-off-by: AxxzyWasTaken <axxzytte@gmail.com>
@AxxzyWasTaken
AxxzyWasTaken force-pushed the pr/j616c-usbpd-sleep-ssps branch from 4ae3ec0 to e7cdc52 Compare November 25, 2026 07:09
@AxxzyWasTaken

Copy link
Copy Markdown
Contributor Author

Exact-head J616C (M4 Max, T6041, 25G83) verification at e7cdc52b5606:

  • Booted 7.3.0-j616c-main25nov+ (main 11e708c6c6b8) with exact unmodified t6041-j616c.dtb built from e7cdc52b5606.
  • Live DT confirmed 4/4 apple,sleep-ssps properties on usb-pd@{8,a,c} (spmi@509188000) and usb-pd@c (spmi@509198000).
  • 2/2 consecutive deep S2R cycles PASS (rtc1 apple-pmu-rtc 12 s wakealarm):
    • Cycle 1: 09:13:01 -> 09:13:19 (rc=0)
    • Cycle 2: 09:13:19 -> 09:13:37 (rc=0)
  • Post-wake: 1-08, 1-0a, 1-0c, 2-0c all bound (driver=sn201202x, rt=suspended), AC=1, failed_units=0, gpu_faults=0, 0 tipd/SPMI errors.

Marking Ready for Review.

@AxxzyWasTaken
AxxzyWasTaken marked this pull request as ready for review November 25, 2026 09:16
@AxxzyWasTaken
AxxzyWasTaken requested review from a team as code owners November 25, 2026 09:16
DjDeveloperr
DjDeveloperr previously approved these changes Nov 25, 2026
@github-actions github-actions Bot added area:bringup Area from CODEOWNERS (bot) blast:m4 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) labels Nov 25, 2026
@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Merge readiness at 9e8f843d: ready to merge

Check Detail
CI at head ok 4 checks passed
Review ok approved by RyanTheTide
Requested changes ok none
Hardware row at head ok in the PR body at 9e8f843d
Conflicts ok none
PR text ok Risk: two-way · Scoped to shared t6041-j614c-j616c.dtsi (hpm0, hpm1, hpm2, hpm5) on deep S2R; s2idle is unchanged (pmsuspendviafirmware() gated).

Areas: area:bringup
Merge: gh pr merge 2174 --merge (Owners and Core through the bypass: add --admin).

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

@RyanTheTide RyanTheTide 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 e7cdc52b5606

Blockers: arch/arm64/boot/dts/apple/t6041-j616c.dts:174: the four controllers are defined in t6041-j614c-j616c.dtsi, which both J614c and J616c include. The change marks the capability on one board only. Please put the properties at the shared controller nodes if the same SSPS requirement applies, or document the firmware behavior that makes these four properties specific to J616c.

Checked: The driver reads the existing per-controller DT property and acts only on firmware-driven suspend. The exact J616c row shows four properties, two successful deep sleep cycles and all four controllers bound after wake. The latest PR text and DTS checks passed.

Evidence

The shared DTSI defines hpm0, hpm1, hpm2 and hpm5 for both boards. J616c exact-head row. A shared change would also need J614c coverage with a short deep sleep and port/MagSafe recovery.

… dtsi

Both the J614c and J616c share the four SN201202x port controllers
(hpm0, hpm1, hpm2 and MagSafe's hpm5) defined in t6041-j614c-j616c.dtsi.
Move apple,sleep-ssps from the J616c board file onto those shared
controller nodes so both boards receive the same firmware-suspend SSPS
handling without board-gating J616c.

Signed-off-by: AxxzyWasTaken <axxzytte@gmail.com>
@AxxzyWasTaken

Copy link
Copy Markdown
Contributor Author

Moved apple,sleep-ssps; onto the shared hpm0, hpm1, hpm2, and hpm5 controller nodes in t6041-j614c-j616c.dtsi and dropped the J616c board-local overrides in fast-forward commit 9e8f843d017c.

Verified:

  • checkpatch.pl --strict --git HEAD~1..HEAD: 0 errors, 0 warnings, 0 checks
  • CHECK_DTBS=y (apple,sn201202x.yaml) on both t6041-j616c.dtb and t6041-j614c.dtb: 0 errors, 0 warnings
  • t6041-j616c.dtb is byte-for-byte identical to e7cdc52b5606 (preserving the prior 2/2 deep S2R hardware row), and t6041-j614c.dtb adds only the four apple,sleep-ssps; properties.

@github-actions github-actions Bot added changes-requested A reviewer requested changes (bot) needs-hw-row No hardware row at the PR head (bot) labels Nov 25, 2026
@github-actions github-actions Bot added needs-review No approving review from Core or Omarchy Mac yet (bot) and removed ci-failing A check failed at the PR head (bot) labels Nov 25, 2026

@RyanTheTide RyanTheTide 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.

Resolved: apple,sleep-ssps now sits on the shared hpm nodes in t6041-j614c-j616c.dtsi, so the 14" and 16" boards both get it from one place instead of a J616c-only override. DT property only, CHECK_DTBS clean on both boards, CI green. Clearing my change request.

@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 25, 2026
@AxxzyWasTaken

Copy link
Copy Markdown
Contributor Author

Completed the exact-head J616C boot and 2/2 deep S2R verification at 9e8f843d017c (7.3.0-pr2174-9e8f843d+, unmodified kernel + t6041-j616c.dtb) and updated What:/Tested: above:

  • All 4 apple,sleep-ssps properties verified live under /proc/device-tree/spmi@509188000/usb-pd@{8,a,c} and /proc/device-tree/spmi@509198000/usb-pd@c.
  • 2/2 consecutive deep S2R cycles (rtc1 apple-pmu-rtc +12 s wakealarm, mem_sleep=s2idle [deep]): both rc=0 (PM: suspend entry (deep) -> PM: suspend exit).
  • Post-resume: all 4 SN201202x controllers (1-08, 1-0a, 1-0c, 2-0c) bound (driver=sn201202x, runtime_status=suspended), AC online (macsmc-ac online=1, tps6598x-source-psy-1-08 online=1, battery 95% Not charging), 0 failed systemd units, 0 tipd/sn201202x/SPMI/asahi/DART/IOMMU errors.

@github-actions github-actions Bot added ready-to-merge Meets the merge policy: merge it (bot) and removed needs-hw-row No hardware row at the PR head (bot) labels Nov 27, 2026
@RyanTheTide
RyanTheTide merged commit 8e58766 into aurora-silicon:main Nov 27, 2026
8 checks passed
7robertodantas added a commit to 7robertodantas/linux that referenced this pull request Nov 30, 2026
…ollers

The J575c's version of aurora-silicon#2174: its four back Type-C port controllers
(hpm0-3) take the sleep's system power states (apple,sleep-ssps), as the
J614c/J616c's do.

Signed-off-by: Roberto Dantas <7robertodantas@gmail.com>
7robertodantas added a commit to 7robertodantas/linux that referenced this pull request Dec 1, 2026
…ollers

The J575c's version of aurora-silicon#2174: its four back Type-C port controllers
(hpm0-3) take the sleep's system power states (apple,sleep-ssps), as the
J614c/J616c's do.

Signed-off-by: Roberto Dantas <7robertodantas@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:bringup Area from CODEOWNERS (bot) blast:m4 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) ready-to-merge Meets the merge policy: merge it (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants