Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [High] FRL training state is not cleared if the EDID is invalidated before a 
disconnect, causing subsequent FRL training to be skipped permanently.
--

commit 666a7a052848216c6b509f4ba1711921db6e5b40
Author: Xiao Lu <[email protected]>

drm/i915/dp: reset HDMI 2.1 PCON FRL state on disconnect

When a DP-to-HDMI 2.1 PCON is disconnected, frl.is_trained remains
set from the previous connection. On reconnect, intel_dp_check_frl_training()
checks this flag first and returns early if set, bypassing the entire FRL
training sequence entirely.

> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c 
> b/drivers/gpu/drm/i915/display/intel_dp.c
> index 113d767e62e9c..3643b6c4c1bc5 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
[ ... ]
> +/*
> + * On disconnect, the downstream PCON and its HDMI FRL link state are gone
> + * from the source's perspective. Clear the cached FRL training state so that
> + * intel_dp_check_frl_training() performs a fresh FRL negotiation on the next
> + * connect, rather than skipping training based on stale state.
> + */
> +static void
> +intel_dp_pcon_disconnect(struct intel_dp *intel_dp)
> +{
> +     struct intel_display *display = to_intel_display(intel_dp);
> +
> +     if (!intel_dp_is_hdmi_2_1_sink(intel_dp))
> +             return;

[Severity: High]
Can this early return prevent clearing the FRL state if the EDID is invalidated
before a disconnect?

If a transient I2C-over-AUX error occurs during a background reprobe while
the monitor is still physically connected, it can cause intel_dp_set_edid()
to fail. This failure causes drm_edid_connector_update() to be called with
NULL, which clears connector->base.display_info and sets is_hdmi to false.

If the monitor is subsequently unplugged, triggering a disconnect, this
function returns early because intel_dp_is_hdmi_2_1_sink() evaluates to
false. The frl.is_trained flag remains true.

When the monitor is reconnected, intel_dp_check_frl_training() skips
training because is_trained is still true, leading to a permanent blank
screen or severely limited resolution until a driver reload or reboot.

Should the state clearing be performed unconditionally, since the current
sink capabilities can be stale or invalidated?

> +
> +     drm_dbg_kms(display->drm,
> +                 "PCON HDMI2.1 sink disconnected, resetting FRL state (was 
> trained at %d Gbps)\n",
> +                 intel_dp->frl.trained_rate_gbps);
> +     intel_dp->frl.is_trained = false;
> +     intel_dp->frl.trained_rate_gbps = 0;
> +}

-- 
Sashiko AI review · 
https://sashiko.dev/#/patchset/[email protected]?part=1

Reply via email to