Repository navigation
Conversation
The T6050 DPTX PHY powers its PLL, lanes and AUX block up when the DCP sets DP mode (t6050_activate()), and down again on PHY_MODE_INVALID (t6050_deactivate()). Its power domain stayed on throughout, however, because the driver never enabled runtime PM. On J775c the dptx_phy domain therefore reads "on" after DPMS off, although the DCP has released the link and the PHY's blocks are down. Enable runtime PM for the T6050 variant. An active link holds a reference, taken before t6050_activate() and dropped after a successful t6050_deactivate(); a failed activation drops it again. With that, genpd can power the domain off while the display is off. The T6020 path, which has its own power handling, is unchanged. Signed-off-by: Satya Benson <satya@benson.earth>
|
Thanks, the runtime-PM wiring is small and the J775c genpd table shows the domain following DPMS. A few points:
Assisted-by: LLM (Claude:Opus 5.5) |
|
Claude Opus 5.5 on @satchlj's behalf. Repeated on this PR's own base. The lobata candidate cand-13 is
DPMS off → s2idle → DPMS on still leaves HDMI dark, as before this change. Assisted-by: LLM (Anthropic:Claude Opus 5.5) |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Adversarial review at 04454c901781 against pre-pr-checklist.md:
Blockers
-
§3 (Runtime-PM reference leak on
t6050_deactivate()failure —drivers/phy/apple/dptx.c:893-909, 961-965):t6050_deactivate()unconditionally powers down AUX, clearsphy->active = falseandphy->rate = 0, and callst6050_device_power(phy, false)even whent6050_pll_power_down()returns a negative error.dptx_phy_set_mode()guards the put withelse if (mode == PHY_MODE_INVALID && was_active && !ret). After any PLL power-down error,dptx_phy->activeisfalsewhile the runtime-PM reference is leaked permanently; the nextPHY_MODE_DPtakes another reference andps_dptx_phycan never suspend again until reboot. Drop the reference wheneverwas_active(sincet6050_deactivate()always clearsactive).
-
§3 (Returning
pm_retafter completed deactivation corruptsphy->attrs.mode—dptx.c:962-965,drivers/phy/phy-core.c:389-390):- Returning a negative
phy_pm_runtime_put_sync()error aftert6050_deactivate()has already powered down the PHY and clearedactive = falsereports a failed mode switch to DCP and causesphy_set_mode_ext()to skipphy->attrs.mode = mode, leavingphy->attrs.modestale asPHY_MODE_DPwhile the PHY is off. Log the runtime-PM put failure (dev_warn) rather than overridingretafter teardown.
- Returning a negative
-
§3 (Early-boot runtime-PM state mismatch —
dptx.c:1102-1106):dptx_phy_probe()callsdevm_pm_runtime_enable(dev)withoutpm_runtime_set_active()(or preserving a live bootloader link). Becausedcp_desktop_external()does not run on firmware 27.0 fixed HDMI, nothing holds a runtime-PM reference betweendptx_phy_probe()and DCP's firstphy_set_mode_ext(PHY_MODE_DP). During that windowdevisRPM_SUSPENDEDwithusage_count == 0, allowinggenpd_power_off_unused()(or a sibling suspend) to power offps_dptx_phyunder an active bootloader HDMI display / simplefb if DCP probes late, defers, or fails.
-
§3 (Minor locking hygiene —
dptx.c:941):if (dptx_phy->active) return 0;readsdptx_phy->activeoutsidedptx_phy->lock. Althoughphy_set_mode_ext()serializes calls withphy->mutex, keeping all reads/writes ofdptx_phy->activeunderdptx_phy->lockkeeps the locking invariant consistent withdptx_phy_configure().
-
§5 (Evidence gaps):
- Report the SELinux denial count explicitly (0 required by §5) and show
dptx-phygenpd state across early boot before DCP activates the link. - Note that
apple,t6050-dptx-phyis also the fallback compatible for T6041 J575c HDMI (t6041-j575c-hdmi.dtsi:52) and die-1 (t6050-ultra.dtsi:265); please either add DPMS off/on coverage or list them explicitly under "Not covered".
- Report the SELinux denial count explicitly (0 required by §5) and show
Checks Passing
- §1 / §2 / §4 / §6: Uses existing
DPTX_PHY_T6050HW block variant, default cmdline, human author/committer and humanSigned-off-by:only,Assisted-by:present in PR body, clean naming, CIhost-testsgreen.
Assisted-by: LLM (Gemini 4 Neon)
…e link Three fixes to the previous commit's reference handling, plus one lock: - t6050_deactivate() powers the PHY down and clears ->active even when t6050_pll_power_down() fails, but the INVALID path dropped the link's reference only when deactivation returned 0. One PLL error leaked it for good, and ps_dptx_phy could never suspend again. Drop it whenever the link was active. - A failed runtime-PM put after the PHY is already down overrode the return value. phy_set_mode_ext() then reports the switch as failed and keeps attrs.mode at DP for a PHY that is off. Report the put failure with dev_warn() instead. - Between probe and the DCP's first mode switch nothing held the domain: the device was suspended with a zero usage count, so genpd's unused power-off could turn ps_dptx_phy off under a link the boot loader left up for simplefb, if the DCP probes late, defers or fails. Probe now marks the device active with a reference of its own (boot_hold), which the first mode switch drops after it has taken the link's. - ->active is now read under dptx_phy->lock for the "already active" early return too, like every other access. Signed-off-by: Satya Benson <satya@benson.earth>
DjDeveloperr
left a comment
There was a problem hiding this comment.
Adversarial re-review at fdd99f79142e87f5518de07433379c8aff1a4df4 against pre-pr-checklist.md:
Prior Blockers Resolved
- §3 (PLL power-down error refcount leak): Resolved —
dptx_phy_set_mode()now drops the link's runtime-PM reference whenevermode == PHY_MODE_INVALID && was_activeregardless oft6050_deactivate()'s return code. - §3 (Stale
phy->attrs.modeonpm_retfailure): Resolved —pm_ret < 0is logged withdev_warn()instead of overridingret. - §3 (Unlocked
dptx_phy->activeread): Resolved — now checked underdptx_phy->lock.
Blockers
-
§3 (New regression —
boot_holdruntime-PM refcount leak on probe error paths and driver unbind —drivers/phy/apple/dptx.c:1129-1158):dptx_phy_probe()callspm_runtime_get_noresume(dev)at line 1130 and only unwinds it ifpm_runtime_set_active()(line 1133) ordevm_pm_runtime_enable()(line 1138) fails.- If
devm_phy_create()(line 1146 — which can return-EPROBE_DEFERviaregulator_get_optional()),devm_of_phy_provider_register()(line 1152), ort6050_probe()(line 1156 — returns-EINVALifapple,ufp-endpointis missing) fails,dptx_phy_probe()returns without callingpm_runtime_put_noidle(dev), leakingdev->power.usage_count(and compounding on every-EPROBE_DEFERretry). - Likewise, if the driver is unbound before the first
dptx_phy_set_mode()call (e.g. if DCP fails to probe or the module is unloaded), nothing releasesboot_hold, leavingusage_countunbalanced on unbind. - Register a
devm_add_action_or_reset()cleanup right afterpm_runtime_get_noresume(dev)(checking and clearingdptx_phy->boot_holdunderdptx_phy->lockand callingpm_runtime_put_noidle(dev)) so both probe failures and unbind before first mode switch always balance the reference.
-
§3 (New regression — unsupported
modedropsboot_holddespite returning-EINVAL—drivers/phy/apple/dptx.c:955-965, 982-983):- If the first
dptx_phy_set_mode()call passes a mode other thanPHY_MODE_DPorPHY_MODE_INVALID,retstays-EINVALand neither activate nor deactivate runs, yet lines 963–964 unconditionally cleardptx_phy->boot_hold = falseand line 983 callspm_runtime_put(dev), dropping the bootloader display power-domain hold on a rejected call. Reject unsupported modes (if (mode != PHY_MODE_DP && mode != PHY_MODE_INVALID) return -EINVAL;) before touchingboot_hold.
- If the first
-
§5 (Hardware verification gaps on live head):
fdd99f79(withboot_hold/pm_runtime_set_active()) has not been booted on hardware yet (all test results are from04454c90).- Please add on the fixed head: early-boot
dptx-phygenpd state before DCP's first mode switch, explicit SELinux denial count (0required by §5), and either test coverage or explicit "Not covered" entries for T6041 J575c (t6041-j575c-hdmi.dtsi:52) and die-1 (t6050-ultra.dtsi:265), which also bind toapple,t6050-dptx-phy. Also update the PR description's "dropped after a successfult6050_deactivate()" wording.
Checks Passing
- §1 / §2 / §4 / §6 / CI: Uses existing
DPTX_PHY_T6050match variant, default cmdline, both commits (04454c90,fdd99f79) carry human author/committer and humanSigned-off-by:only,Assisted-by:present in PR body, clean naming,host-testsgreen atfdd99f79.
Assisted-by: LLM (Gemini 4 Neon)
|
Claude Opus 5.5 on @satchlj's behalf. Reply to @DjDeveloperr's review of
Compile: J775c row
Not covered: Assisted-by: LLM (Anthropic:Claude Opus 5.5) |
Claude Opus 5.5 on @satchlj's behalf.
phy: apple: dptx: enable runtime PM for the T6050 DPTX PHY, so its power domain follows the link.PHY_MODE_INVALID, but the domain stayed on.t6050_activate()and dropped after a successfult6050_deactivate(), and genpd powers the domain off while the display is off.This is the PHY half of what #2503 does for DPMS off. #2503 releases the fixed HDMI port's DPTX link on firmware 27, and this lets the PHY's domain follow.
Selection: the driver's existing per-variant branch (
hw.type == DPTX_PHY_T6050, from theapple,t6050-dptx-phymatch data), the same branchset_modealready takes for this PHY. The T6020 path has its own power handling and is unchanged.Testing
J775c (Mac Studio, M5 Max, DCP firmware 27.0), HDMI monitor attached, default cmdline, one-shot trial boot.
integration/auroracacf3554, lobata's open PRs including drm/apple: release a fixed HDMI link on DPMS off with DCP firmware 27 #2503, and soc: apple: clpc: count I/O wait as busy #2754) plus this commit (3eba044bthere, the same change as04454c90here). Boot75cb4804.hl.dsp.dpms).5552a4c6): the link is released (dcp_dptx_disconnect), butdptx-phystayson.on→off-0→on.dptx-phy(genpd)rtcwake -m freeze -s 10, display onsetmode failed.fab3-socat each resume, which is tracked separately.--strict: clean.Assisted-by: LLM (Anthropic:Claude Opus 5.5)