Repository navigation
phy: apple: atc: stop T8103 DP link and AUSPLL on link rate 0 - #3554
Conversation
When DCP tears down an active DisplayPort link during DPMS off, it calls SET_LINK_RATE with rate 0. On T8103-family PHYs, atcphy_dpphy_configure() previously returned 0 on case 0 without touching hardware, leaving the AUSPLL locked and the DP TX lanes actively driving the link. External USB-C monitors such as the EIZO FlexScan EV2780 kept seeing an active carrier and bounced in a "No Signal" / wake loop instead of entering standby. Add atcphy_dp_stop_lane() and atcphy_dp_stop() to put active DP TX lanes into High-Z, power down the TX/RX-as-TX output stages and clocks, clear LN_RX_TXMODE, disable AUSPLL_CLKOUT_MASTER drivers, issue AUSPLL stop command 3, wait for ACIOPHY_AUSPLL_LOCK to clear, and reset the cached dp_link_rate to -1. Also clear dp_link_rate in atcphy_disable_dp_aux() so re-enabling the same rate after a full PHY power-down always reprograms the PLL. Add KUnit tests covering single-pair (USB3+DP), four-lane (DP), repeated stop idempotence, and busy/non-DP guards. Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
9d50cd2 to
53ec15e
Compare
There was a problem hiding this comment.
Verdict: FINISH, then merge at 53ec15e8
Blockers:
- PR description fields (
pr-text): Replace/augment## Summary/## Testingwith the required**What:**,**Tested:**(citing exact head SHA53ec15e8), and**Risk:**(two-way+ affected Macs, e.g.,M1/M2 T8103-family ATC PHYs) lines sopr-textpasses. - Hosted CI at
53ec15e8: Checks are currently queued (0passing yet); wait for the full hosted suite (apple-build,dt-checks,host-tests,kunit,pr-text,readiness) to go green.
Checked:
- Audited
atcphy_dp_stop_lane(),atcphy_dp_stop(),atcphy_disable_dp_aux(),atcphy_dpphy_configure(), and the newphy-apple-atc-t8103-dpKUnit suite indrivers/phy/apple/atc-test.c; zero code blockers found. - Confirmed
atcphy_dpphy_configure()already dispatches T8132/T8142/T8152,has_t8140_dp, anddp_t8122before reachingcase 0: return atcphy_dp_stop(atcphy);, so onlyapple,t8103-atcphy(atcphy_hw_t8103) takes the new stop path. - Verified every register/bit cleared or reset in
atcphy_dp_stop_lane()andatcphy_dp_stop()(LN_TXA_HIZ,LN_TXA_CLK_EN,LN_TXA_DIV2_RESET,LN_BYTECLK_RESET_SYNC_EN,LN_LDOCLK_*,LN_TX_CLK_EN,LN_TX_CLK_DIV2_RST,LN_TX_EN,LN_DTVREG_*,LN_VREF_EN,LN_RX_TXMODE,LN_TX_BYTECLK_RESET_SYNC_{CLR,EN},LN_RX_DIV20_RESET_N,DP_PMA_BYTECLK_RESET,AUSPLL_CLKOUT_MASTER_DRVR_EN, AUSPLL APB stop command3) is symmetrically restored byatcphy_dp_configure()/atcphy_dp_configure_lane()on wake. - Verified locking (
guard(mutex)(&atcphy->lock)+lockdep_assert_held), lane selection (mode_cfg->dp_lane[0..1]leaves the USB3 lane untouched inAPPLE_ATCPHY_MODE_USB3_DP), idempotence (dp_link_rate = -1in bothatcphy_dp_stop()andatcphy_disable_dp_aux()), and guards (mode_dirty,pipe_pending,tunnel_clock_on,tunnel_saved, non-DP modes).
Evidence
drivers/phy/apple/atc.c:AUSPLL_CLKOUT_MASTER_DRVR_EN(BIT(2) | BIT(4) | BIT(6)) +atcphy_auspll_apb_command(atcphy, 3)matches the existing AUSPLL stop sequence inatc.c, andatcphy_dp_configure()re-enables all three master driver bits, locks AUSPLL (0+0x2800), re-runsatcphy_dp_configure_lane(), and clearsDP_PMA_BYTECLK_RESET.drivers/phy/apple/atc-test.c:phy-apple-atc-t8103-dpcovers USB3+DP single-pair lane isolation, 4-lane DP stop, repeated-stop idempotence, busy/tunnel guards (-EBUSY), and non-DP mode rate clearing (63/63arm64 KUnit reported locally,checkpatch --strict0/0/0,W=10 warnings).- Hardware verification reported on J313 M1 Air (T8103, DCP fw 27) with external EIZO EV2780 (direct USB-C DP Alt Mode + USB-C-to-HDMI bridge): DPMS off stops TX lanes & unlocks AUSPLL, DPMS wake cleanly retrains
2560x1440@60.
There was a problem hiding this comment.
Verdict: MERGE at 53ec15e8
Blockers: None (wait for queued hosted CI checks to finish green).
Checked:
- Confirmed PR description update at
53ec15e8ac61:**What:**,**Tested:**(exact-head J313 M1 Air T8103 DCP fw 27 DPMS off steady standby 52s + wake2560x1440@60,63/63arm64 KUnit includingphy-apple-atc-t8103-dp,checkpatch.pl --strict0/0/0,W=10 warnings),**Risk:**(two-way door · M1-family Macs (T8103 / T600x / T602x ATC PHYs)), and**Not yet:**are all in place. - Previously audited full diff (
drivers/phy/apple/atc.c,drivers/phy/apple/atc-test.c) at53ec15e8: T8103-only dispatch inatcphy_dpphy_configure(), symmetric restore of every TX/RX-as-TX/AUSPLL/byteclk bit inatcphy_dp_configure()/atcphy_dp_configure_lane(), mutex/lane-isolation/idempotence/busy guards, and KUnit coverage are all clean.
Evidence
drivers/phy/apple/atc.c:atcphy_dp_stop_lane(),atcphy_dp_stop(),dp_link_rate = -1inatcphy_disable_dp_aux(), andcase 0: return atcphy_dp_stop(atcphy);inatcphy_dpphy_configure()(reached only byatcphy_hw_t8103).drivers/phy/apple/atc-test.c:phy-apple-atc-t8103-dpcovers USB3+DP single-pair lane isolation, 4-lane DP stop, repeated-stop idempotence, busy/tunnel-EBUSYguards, and non-DP rate clearing.
|
code-owner ping <@422957901716652033> / @DjDeveloperr: merge train at |
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
Add an atcphy_dp_stop() stub to the standalone atcphy_dpphy_configure() harness in tools/asahi/atc-dp-drive-tests.py and verify that link_rate 0 invokes atcphy_dp_stop() without touching atcphy_dp_configure(). Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
There was a problem hiding this comment.
Verdict: MERGE at 04a20882 once the queued CI checks pass.
Blockers: none in code (queued CI pending).
Checked: Delta commit 04a20882f1 (tools/asahi/atc-dp-drive-tests.py) over previously approved 53ec15e8ac, confirmation that kernel code is unchanged, and local/hardware verification at 04a20882f1.
Evidence
- Delta since approved
53ec15e8ac(04a20882f1): Test-only update intools/asahi/atc-dp-drive-tests.pystubbingatcphy_dp_stop()and asserting thatlink_rate == 0invokesatcphy_dp_stop()once without programming a new link rate (calls_stop == 1 && !calls_rate && !calls_other), while unknown rates still return-EINVAL. Kernel code indrivers/phy/apple/atc.cis byte-identical to53ec15e8ac. - Verification at
04a20882f1:phy-apple-atcKUnit63/63pass,tools/asahi/atc-dp-drive-tests.pypasses and kills all 3 mutations,checkpatch.pl --strict0/0/0,W=10 warnings, and J313 (T8103) live DPMS off/on standby +2560x1440@60restore PASS.
|
Merging under the 6-point rule (Ryan 09:29, permanent), at |
|
Second-generation row (T8112), as asked by Dj: J473 M2 mini at 82e146e (linux main 965d4a7, which contains this PR's 1bd9c26, + #3405), macOS 27.2 firmware, MSI MPG 325CQRXF on USB-C (atc1, now on dcpext): pass for DPMS. GNOME DPMS off for 15 s logs |
What: Implement DisplayPort link and AUSPLL shutdown on
link_rate == 0for T8103-family ATC PHYs (atcphy_dp_stop()/atcphy_dp_stop_lane()) so DPMS off stops driving the DP link instead of returning early as a no-op, and stubatcphy_dp_stop()intools/asahi/atc-dp-drive-tests.py.Tested: J313 M1 Air (T8103, DCP firmware 27) at
04a20882f1c1(kernel code identical to53ec15e8ac61;04a20882f1c1only updates host testtools/asahi/atc-dp-drive-tests.py): boots cleanly, DPMS off stops the DP link and EIZO EV2780 over USB-C-to-HDMI bridge stays in steady standby (52s continuous, zero wakeups), DPMS wake restores2560x1440@60. KUnitphy-apple-atc63/63 passed,tools/asahi/atc-dp-drive-tests.pypassed + killed all 3 mutations,checkpatch.pl --strict0/0/0,W=10 new warnings.Risk: two-way · M1-family Macs (T8103 / T600x / T602x ATC PHYs) using USB-C DisplayPort.
Not yet: T600x / T602x hardware regression run (only J313 T8103 tested on hardware).
Details
When DCP tears down an active DisplayPort link during DPMS off, it calls
SET_LINK_RATEwith rate0. On T8103-family PHYs,atcphy_dpphy_configure()previously returned0oncase 0without touching hardware, leaving the AUSPLL locked and the DP TX lanes actively driving the link.atcphy_dp_stop_lane()andatcphy_dp_stop()called fromatcphy_dpphy_configure()onlink_rate == 0:LN_RX_TXMODE.AUSPLL_CLKOUT_MASTERdrivers, issue AUSPLL stop command3, wait forACIOPHY_AUSPLL_LOCKto clear, and resetdp_link_rate = -1.mode_dirty,pipe_pending, active USB4 tunnels, non-DP modes, and repeated stop calls.dp_link_rate = -1inatcphy_disable_dp_aux()so re-enabling the same rate after a full PHY power-down always reprograms the PLL.phy-apple-atc-t8103-dpKUnit tests indrivers/phy/apple/atc-test.ccovering single-pair (USB3+DP), four-lane (DP), repeated stop idempotence, and busy/non-DP guards.atcphy_dp_stop()and assertlink_rate == 0stops the link intools/asahi/atc-dp-drive-tests.py.Evidence
53ec15e8ac61(kernel code unchanged at04a20882f1c1):poweroffdisplays->dcp_dptx_disconnect(port=0)-> steady standby (BL_OFF, 52s continuous, 0 wakeups).wakeup->dcp_hotplug() connected:1->set_digital_out_mode2560x1440@60(DP-1: active=true power=true).python3 -I -B tools/asahi/atc-dp-drive-tests.pyPASS (8 cases) + killedeopnotsupp,accept-with-rate, andrefuse-drivemutations../tools/testing/kunit/kunit.py run --arch=arm64 --kunitconfig=drivers/phy/apple/.kunitconfig.apple-atc: 63/63 passed (phy-apple-atc-t8103-dp:atcphy_test_t8103_dp_stop,atcphy_test_t8103_dp_stop_guards)../scripts/checkpatch.pl --strict: 0 errors, 0 warnings, 0 checks;W=1compile ondrivers/phy/apple/atc.o: 0 new warnings.