Public bug reported:

[Impact]
On HP systems (CID: 202512-38233) with Intel Lunar Lake GPU and HP Type-C to 
HDMI dongle
(03f0:8a4a), switching to mirror mode via hotkey fails. The system cannot 
switch mirror
mode on X11 when using a Type-C to HDMI external monitor.
The root cause is that on XELPDP+ platforms (Lunar Lake and later), the LTTPR 
dongle
fires a long HPD pulse after link training. The tc_phy_hpd_live_status() 
function reads
PICAINTERRUPT_ISR to determine DP-alt live status, but the 
XELPDP_DP_ALT_HOTPLUG_MASK
bit deasserts during a long HPD pulse. Since 
intel_tc_port_handles_hpd_glitches() returns
true for TC dp-alt ports, the 4ms glitch-filter retry loop is bypassed, giving 
no
protection against this transient deassertion. The hotplug handler then marks 
DP-1 as
disconnected, and the compositor disables eDP-1.
Error log:
  xe 0000:00:02.0: [drm:intel_dp_hpd_pulse [xe]] got hpd irq on 
[ENCODER:270:DDI TC1/PHY TC1] - long
  xe 0000:00:02.0: [drm:drm_dp_dpcd_access [drm_display_helper]] AUX USBC1/DDI 
TC1/PHY TC1: Too many retries, giving up. First error: -6
  xe 0000:00:02.0: [drm:intel_hotplug_detect_connector [xe]] 
[CONNECTOR:271:DP-1] status updated from connected to disconnected (epoch 
counter 178->179)
  [drm:intel_dp_hpd_pulse] got hpd irq on [ENCODER:270:DDI TC1/PHY TC1] - long
  [drm:intel_tc_port_update_mode] Port D/TC#1: TC port mode reset (disconnected 
-> tbt-alt)
  [drm:intel_dp_hpd_pulse] got hpd irq on [ENCODER:270:DDI TC1/PHY TC1] - long
  [drm:intel_hotplug_detect_connector] [CONNECTOR:271:DP-1] status updated from 
connected to disconnected
Affected hardware: HP systems (CID: 202512-38233) with Intel Lunar Lake GPU
Failure rate: High (reproducible with HP Type-C to HDMI dongle 03f0:8a4a on X11)

[Fix]
When the port has an active link (link_refcount > 0), trust the PHY ownership 
register
(XELPDP_PORT_BUF_CTL1 & XELPDP_TC_PHY_OWNERSHIP) over the transient HPD live 
status
in intel_tc_port_connected(). The ownership register is stable and does not 
toggle
during HPD pulses. The TC cold power domain is guaranteed to be held when
link_refcount > 0, as __intel_tc_port_lock() already asserts and verifies this 
via
tc_phy_is_owned() before reaching intel_tc_port_connected().
The patch is currently under review on the Intel DRM mailing list (not yet 
merged to
mainline).
Patch:
https://lore.kernel.org/lkml/[email protected]/T/#u

[Test Plan]
1. Connect HP Type-C to HDMI dongle (03f0:8a4a) to the system.
2. Ensure the external monitor is displaying output (extended mode).
3. Press the hotkey to switch to mirror mode.
Without the patch: The external monitor fails to switch to mirror mode. The 
kernel log
shows DP-1 connector status updated from connected to disconnected, and the 
internal
display may also blank.
With the patch: Mirror mode switches successfully. The kernel log shows the TC 
port
correctly stays in or returns to dp-alt mode:
  [drm:intel_tc_port_update_mode] Port D/TC#1: TC port mode reset (dp-alt -> 
disconnected)
  [drm:intel_tc_port_update_mode] Port D/TC#1: TC port mode reset (disconnected 
-> dp-alt)

[Where problems could occur]
It may affect the i915/xe display driver's Type-C port management on Lunar Lake 
and
later platforms.
If the condition `tc_phy_is_owned()` returns a stale or incorrect ownership 
state while
link_refcount > 0, the driver could incorrectly report a port as connected when 
the
physical link has actually been removed. This would manifest as a phantom 
connected
display that cannot be detected as disconnected until the next full port reset, 
potentially
causing display configuration errors or a hung compositor.
Additionally, the early-return path bypasses the existing 
tc_phy_hpd_live_status() mask
check. If there is an edge case where link_refcount > 0 but the port mode 
transitions
away from TC_PORT_DP_ALT between the refcount check and the ownership check, 
the port
status could be misreported.
The patch is submitted upstream for review but not yet merged.

[Other Info]
The patch is submitted to the Intel DRM mailing list for review but not yet 
merged to
mainline.
This issue only reproduces with the HP Type-C to HDMI dongle (03f0:8a4a) on 
X11. Wayland
and other dongle types (Type-C to DP/VGA, built-in HDMI/Thunderbolt) are not 
affected.

** Affects: hwe-next
     Importance: Undecided
         Status: New

** Affects: linux-oem-6.17 (Ubuntu)
     Importance: Undecided
         Status: New

** Affects: linux-oem-6.17 (Ubuntu Noble)
     Importance: Undecided
         Status: New


** Tags: jira-stella-3019 oem-priority stella

** Also affects: linux-oem-6.17 (Ubuntu Noble)
   Importance: Undecided
       Status: New

** Tags added: jira-stella-3019 oem-priority stella

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2143879

Title:
  drm/i915/lnl+/tc: Fix false disconnect of active DP-alt TC port during
  long HPD pulse

To manage notifications about this bug go to:
https://bugs.launchpad.net/hwe-next/+bug/2143879/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to