Repository navigation
Conversation
|
The approach looks right: on s2idle, hold the active combo-PHY domains and DP tunnel gates out of genpd's system suspend, release exactly what was recorded at POST_SUSPEND (abort included), and select it all from what is active, with no switch. The J775c before/after, with no
Assisted-by: LLM (Claude:Opus 5.5) |
…2idle On T6050, t6050_dp_suspend_late() only quiesces the combo PHY for firmware deep sleep (pm_suspend_no_platform() == false). During suspend-to-idle (s2idle), an active combo PHY remains running, and drivers/thunderbolt/apple.c holds ACIO's virtual genpd devices out of system suspend with dev_pm_syscore_device(..., true). However, combo_pm_notify() in atc-t6050-combo.h was gated on combo_sleep_board() (j714s/j716c) and only held domain[0] during firmware deep sleep. As a result, genpd_suspend_noirq() powered off active combo PHY virtual genpd devices (including atc1_phymxwrap) during s2idle while the PHY RTKit CPU was still running. On resume, the first CIO-to-SAFE transition timed out with "PHY firmware stop failed: -62" and marked the PHY faulted, wedging the port (-5) until reboot. Register combo_pm_notify() for all T6050 combo PHYs and, when entering s2idle (pm_suspend_no_platform(), set in enter_state() before suspend_prepare() invokes PM_SUSPEND_PREPARE notifiers), hold every active dp->domain[] and dp->dp_gate[] virtual genpd device with dev_pm_syscore_device(..., true). Release every held device unconditionally on PM_POST_SUSPEND (covering both normal resume and suspend abort) using bitmasks so the hold cannot leak if active state changes. Tested on J775c (Mac Studio M5 Max, T6050, ATC1 XDomain): - Without this patch, post-s2idle CIO teardown fails with "PHY firmware stop failed: -62" and wedges 2ab000000.phy (-5). - With this patch, pmgr-pwrstate dyndbg confirms zero atc1_phymxwrap/atc1_* power-off transitions across s2idle, and post-resume CIO teardown cleanly receives ep20: 8000010000000001 and restarts to "CIO mode up" in 11 ms. Signed-off-by: Satya Benson <satya@benson.earth>
eebba1f to
843c5f5
Compare
|
Codex GPT-6.2 Sol on @satchlj's behalf The local revision moves the s2idle snapshot into the PHY's suspend_late callback under the PHY mutex and releases the recorded holds in resume_early, including the PM unwind after a successful late callback. It bounds both u8 masks and documents that the existing deep-sleep board gate is left for the deep-sleep work. The local revision compiled and the cand-11 trial containing it booted. It returned to known-good Aura with direct Thunderbolt connectivity. That boot did not exercise s2idle, so it does not establish the late-to-noirq ordering under live tunnel activity or validate resume/abort release on hardware. The earlier domain-hold and PHY restart observations apply to the earlier implementation. The separate link-training drop remains open. |
Take the active-domain snapshot under the PHY lock in late suspend. Fence mode, tunnel-clock and CIO changes through noirq and release the recorded holds in early resume, including on suspend unwind. A zero-rate tunnel request during the fence records a stop so DCP can release the route. Process the stop after thaw or before reusing the clock. Clear pending state only after the clock is parked and its gate is released. Bound the domain and tunnel masks, and leave the existing firmware deep-sleep gate to separate work. Signed-off-by: Satya Benson <satya@benson.earth>
|
Codex GPT-6.2 Sol on @satchlj's behalf Updated to J775c cand-11 integration boot |
|
Re-review of 6fb5e78: Blockers: 1. Earlier points:
New in 6fb5e78:
Commits have a human Signed-off-by and no agent trailers. The PR body ends with the Assisted-by line. HW row: J775c on 6fb5e78 plus fix 1, default command line. Run 5 RTC s2idle cycles with an active DP tunnel through the XDomain/dock port, one cycle with the cable pulled while asleep, and one suspend abort injected after the PHY's late suspend. Pass: no PHY stop -62, no SError, no "Deferred DP tunnel clock" warning, the display comes back, and 0 AVC, 0 failed units, 0 new kernel errors. Assisted-by: LLM (Claude:Opus 5.5) |
|
J714s (Apple M5 Pro / T6050) combined-stack
Assisted-by: LLM (Gemini 4 Neon) |
|
Claude Opus 5.5 on @satchlj's behalf J775c (Mac Studio, M5 Max) rows for #2664 at head Stack.
Without this PR, the same stack and DTB:
With Limits.
|
|
Claude Opus 5.5 on @satchlj's behalf Current-tip J775c row for #2664 at
#2592 is closed in favour of this PR. |
|
Claude Opus 5.5 on @satchlj's behalf Follow-up to the current-tip row above (#2664): the same Image (
|
|
Merge-train adversarial review (MERGETRAIN-LINUX2) at 6fb5e78: BLOCKERS. Not merging until the blockers below are fixed or answered; the details give file:line and a failure case. Full review#2664 phy: apple: atc-t6050: keep active combo PHY domains powered across s2idle @6fb5e78fVERDICT: BLOCKERS The head is unchanged since Ryan's re-review of 6fb5e78. Its blocker 1 is still open, and I reproduced it from the code. Blockers:
Nits:
Hygiene: both commits have only Missing rows:
|
DjDeveloperr
left a comment
There was a problem hiding this comment.
Adversarial review at 6fb5e78f9b46b3c69c6032303f17c07c2f25b81b: REQUEST_CHANGES (1 open code blocker reproduced from source; CI host-tests: pass; mergeable/clean).
Blockers
- Deferred DP tunnel clock stop can outlive USB4/CIO mode and write
banks[39]MMIO after domains are powered off (drivers/phy/apple/atc-t6050-dp.c:622-634,:806-835,:864-876;drivers/phy/apple/atc-t6050-combo.h:431-434)- While
dp->s2idle_frozenis set, a rate-0 call toapple_t6050_dp_tunnel_clock()setsdp->s2idle_clock_stops |= BIT(clock - 1)and returns0(atc-t6050-dp.c:865-870), causingdcp_route_clock_rate()(drivers/gpu/drm/apple/dcp-fabric.c:479-480) to setroute->tunnel_rate = 0. atc_dp_tunnels_stop()(atc-t6050-dp.c:622-634), invoked fromcombo_stop()(atc-t6050-combo.h:151) andapple_t6050_phy_cio_off()(atc-t6050-dp.c:1313), zeroesdp->tunnel_rate[]and drops the gates, but does not cleardp->s2idle_clock_stops.- On resume,
combo_s2idle_release()(atc-t6050-combo.h:432-433) queuesdp->s2idle_clock_workontosystem_freezable_wq— the same workqueue used bytipd(drivers/usb/typec/tipd/core.c:1662,:2733), with no ordering guarantee. If the cable was unplugged while asleep andtipd'sresume_workruns first,combo_mux(SAFE)->combo_stop()tears down CIO toCOMBO_SAFEand powers off the PHY domains. atc_s2idle_clock_work()then runsatc_s2idle_clock_stop()->atc_dp_tunnel_apply(dp, i + 1, NULL)->atc_dp_tunnel_switch()(atc-t6050-dp.c:521-545), writingdp->banks[39](ATC_CFG_DP_SWITCH/ATC_CFG_DP_ENABLE) and pollingATC_CFG_DP_STATUSfor 10 ms outsideCOMBO_CIOwith the PHY domains off — risking an asynchronous SError.- A subsequent
apple_t6050_dp_tunnel_clock()call on that clock also hits the stale bit atatc-t6050-dp.c:872-875and performs the same switch write. - Fix: Clear
dp->s2idle_clock_stops = 0inatc_dp_tunnels_stop(), and inatc_s2idle_clock_stop()skipbanks[39]switch writes whendp->faulted || dp->combo_mode != COMBO_CIO(only releasingdp_gate[i]if still active, then clearing the bit).
- While
Checklist audit (§1–§4, §6) & non-blocking nits
- §1 / §2 / §3 / §4 / §6: Pass. No new chip/board/firmware gates (
combo_sleep_board()is pre-existing and noted atatc-t6050-combo.h:775); default-cmdline safe;u8bitmask widths are bounded at probe (atc-t6050-dp.c:1141-1143); both commits (843c5f5c,6fb5e78f) carry human-onlySigned-off-by: Satya Benson <satya@benson.earth>with no agent trailers; PR body ends withAssisted-by: LLM (Codex:GPT-6.2). - Nits:
atc-t6050-dp.c:812:atc_s2idle_clock_stop()calls single-clockatc_dp_tunnel_apply()instead ofatc_dp_tunnels_apply(dp, i + 1, NULL), diverging from the comment at:751-752and immediate stop at:777.- Adding a
dev_dbg()whens2idle_frozenrefuses a call with-EBUSYwould make any unexpected late/noirq caller visible. apple_t6050_phy_cio_finish()andapple_t6050_phy_cio_lost()are unfenced unlike the other CIO exports (deep-sleep only today; worth a brief comment).- Commit
843c5f5cdescribes the supersededPM_SUSPEND_PREPAREnotifier design replaced by6fb5e78f; squashing or rewording avoids a misleading bisect point.
§5 HW evidence needed after fixing the blocker
- J775c (default cmdline, isolated PR on current tip with the fix):
- 5 RTC
s2idlecycles with an active DP tunnel through the XDomain/dock port; - 1
s2idlecycle with the cable pulled while asleep (exercises thes2idle_clock_workvstipdSAFE ordering); - 1 suspend abort injected after
t6050_dp_suspend_late(). - Pass criteria: 0 PHY stop
-62, 0 SError, 0Deferred DP tunnel clockwarnings, display recovery, and 0 SELinux denials / 0 failed units / 0 new kernel errors.
- 5 RTC
- Additional T6050 combo-PHY board coverage (e.g. J716c or standalone J714s
s2idle+deepregression; the existing J714s row is a combined stack with#2007/#2592/#2557/#2739).
Assisted-by: LLM (Gemini 4 Neon)
Problem
On T6050,
t6050_dp_suspend_late()only quiesces the combo PHY for firmware deep sleep (pm_suspend_no_platform() == false). Durings2idle, an active combo PHY remains running, anddrivers/thunderbolt/apple.cholds ACIO's virtual genpd devices out of system suspend withdev_pm_syscore_device(..., true).However,
combo_pm_notify()indrivers/phy/apple/atc-t6050-combo.hwas gated oncombo_sleep_board()(j714s/j716c) and only helddomain[0]during firmware deep sleep. Durings2idle,genpd_suspend_noirq()powered off active combo PHY virtual genpd devices (includingatc1_phymxwrap) under the still-running PHY RTKit CPU. On resume, the first CIO-to-SAFE transition timed out withapple-t6050-dp-phy 2ab000000.phy: PHY firmware stop failed: -62and marked the PHY faulted (dp->faulted = true), permanently wedging the port (-5) until reboot.Fix
combo_pm_notify()for allapple,t6050-combo-phyinstances (not gated oncombo_sleep_board()).PM_SUSPEND_PREPAREwhenpm_suspend_no_platform()is true (set inenter_state()beforesuspend_prepare()invokes notifiers, merged in T6050: a "freeze" with mem_sleep at deep is a suspend-to-idle (no dock teardown, no -67) #2510), hold every activedp->domain[]anddp->dp_gate[]virtual genpd device out of system suspend withdev_pm_syscore_device(..., true)and record the held devices in bitmasks (s2idle_domain_syscore,s2idle_gate_syscore).PM_POST_SUSPEND, release every device recorded in those bitmasks unconditionally (covering both normal resume and suspend abort viapm_notifier_call_chain_robust, independent of whetheractivechanged in the meantime).Hardware verification (J775c / Mac Studio M5 Max, T6050, ATC1 XDomain,
s2idle)Tested on
cand-11(8f345b748824) on the default command line (s2idle_teardown=N) acrossrtcwake -d rtc0 -m freeze:apple-t6050-dp-phy 2ab000000.phy: PHY firmware stop failed: -62(dp->faulted = true), leaving the PHY wedged (-5) even after a USB-C PD replug succeeded.pmgr-pwrstatedynamic debug confirmed zeroatc1_phymxwraporatc1_*power-off transitions acrosss2idle(only idleatc0/2/3_phymxwrapcycled).10ee7606-bb95-48ac-aae9-022620fed01f), post-resumeset cable state: 0cleanly receivedPHY firmware ep20: 8000010000000001(zero-62), cycledatc1_phymxwrap0x0 -> 0xf, and restarted2ab000000.phytoCIO mode up: UC_TNBL_DONE (0), reverse orientation, 11 ms.drivers/phy/apple/atc-t6050-dp.obuilds cleanly onintegration/aurora107047f61826.(Note: This PR fixes the combo PHY
s2idledomain power-off and-62stop wedge. On the J775c↔macOS XDomain pair,2a9ac0000.aciostill hitsTraining TO HL0 -> Dead End~2 s intos2idleseparately; that link-drop cause is being isolated independently.)Review follow-up at 6fb5e78: the late snapshot and mutation fence now share the PHY mutex. Early resume releases the saved masks. Zero-rate requests during the fence are queued for stop after thaw, and a pending stop must complete before reuse. The deep-sleep board gate remains separate.
The final revision completed one RTC-backed XDomain s2idle cycle on a cand-11 J775c integration build with 1 success and 0 failures, no logged ATC1 PMGR power-off and no PHY stop -62. The HL0 timeout still dropped the link. An active DP tunnel, injected suspend abort and matched forced PHY restart were outside this run.
Assisted-by: LLM (Codex:GPT-6.2)