On 11/18/26 11:53, [email protected] wrote:
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] drm/i915/dp: HBR2 quirk in intel_edp_set_sink_rates() skips
   fallback
--

commit b3bcea937e62f9aba672f8e2782fab0f2b184dbd
Author: Kory Maincent <[email protected]>

drm/dp: Move eDP sink link rates reading helper out of i915

This commit moves the eDP DP_SUPPORTED_LINK_RATES reading logic from i915
into a generic drm_dp_read_edp_sink_rates() helper.

...

/*
         * Use DP_LINK_RATE_SET if DP_SUPPORTED_LINK_RATES are available,
         * default to DP_MAX_LINK_RATE and DP_LINK_BW_SET otherwise.
         */
-       if (intel_dp->num_sink_rates)
+       if (num_sink_rates)
                intel_dp->use_rate_select = true;
        else
                intel_dp_set_sink_rates(intel_dp);

[Severity: Medium]
Can this leave intel_dp->num_sink_rates as 0 on platforms with
QUIRK_EDP_LIMIT_RATE_HBR2 if DP_SUPPORTED_LINK_RATES only lists rates
above 540000 kHz?

Previously, rates above 540000 kHz were filtered out before checking
intel_dp->num_sink_rates, so an empty filtered list fell back to
intel_dp_set_sink_rates().  Now num_sink_rates is checked before the
following intel_dp_rate_limit_len() call clamps intel_dp->sink_rates:

drivers/gpu/drm/i915/display/intel_dp.c:intel_edp_set_sink_rates() {
        ...
        if (num_sink_rates)
                intel_dp->use_rate_select = true;
        else
                intel_dp_set_sink_rates(intel_dp);
        ...
        if (intel_dp->num_sink_rates && intel_has_quirk(display, 
QUIRK_EDP_LIMIT_RATE_HBR2))
                intel_dp->num_sink_rates = 
intel_dp_rate_limit_len(intel_dp->sink_rates,
                                                                   
intel_dp->num_sink_rates,
                                                                   540000);
}

When all entries in DP_SUPPORTED_LINK_RATES exceed 540000 kHz, this sets
intel_dp->use_rate_select to true, skips intel_dp_set_sink_rates(), and
then reduces intel_dp->num_sink_rates to 0, triggering drm_WARN_ON() in
intel_dp_get_common_rates() and breaking eDP link training.

There is indeed maybe a small case where this can happen.
I will fix it in next version.

--
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

Reply via email to