All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Alexander Kaplan" <alexander.kaplan@sms-medipool.de>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/dp: Read the PCON max FRL bandwidth only for HDMI DFPs
Date: Wed, 10 Jun 2026 18:03:11 +0000	[thread overview]
Message-ID: <20260610180312.374901F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260610174819.6258-1-alexander.kaplan@sms-medipool.de>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] `intel_dp_check_frl_training` improperly evaluates source control mode support, potentially initiating FRL training and writing PCON registers on non-PCON or non-HDMI branch devices.
--

commit 4303b79dbb0d5f0f36551e50e709e33e49cee039
Author: Alexander Kaplan <alexander.kaplan@sms-medipool.de>

drm/dp: Read the PCON max FRL bandwidth only for HDMI DFPs

This commit fixes an issue where the PCON max FRL bandwidth was read
without checking the DFP type, branch presence, or whether detailed
capability info was available. By properly scoping the parsing, it
prevents incorrect mode pruning on adapters that replicate the DFP type
byte across the descriptor.

> diff --git a/drivers/gpu/drm/display/drm_dp_helper.c b/drivers/gpu/drm/display/drm_dp_helper.c
> index 9c31e14cc413b..3328909c8db47 100644
> --- a/drivers/gpu/drm/display/drm_dp_helper.c
> +++ b/drivers/gpu/drm/display/drm_dp_helper.c
> @@ -3686,6 +3686,15 @@ int drm_dp_get_pcon_max_frl_bw(const u8 dpcd[DP_RECEIVER_CAP_SIZE],
>  	int bw;
>  	u8 buf;
>  
> +	if (!drm_dp_is_branch(dpcd))
> +		return 0;
> +
> +	if ((dpcd[DP_DOWNSTREAMPORT_PRESENT] & DP_DETAILED_CAP_INFO_AVAILABLE) == 0)
> +		return 0;
> +
> +	if ((port_cap[0] & DP_DS_PORT_TYPE_MASK) != DP_DS_PORT_TYPE_HDMI)
> +		return 0;
> +

[Severity: High]
This is a pre-existing issue, but seeing the capability checks added
here raises a question about similar logic in the i915 driver.

In drivers/gpu/drm/i915/display/intel_dp.c, the intel_dp_check_frl_training()
function appears to blindly check downstream_ports[2] without verifying
if detailed capabilities are available:

drivers/gpu/drm/i915/display/intel_dp.c:intel_dp_check_frl_training() {
    ...
    if (!(intel_dp->downstream_ports[2] & DP_PCON_SOURCE_CTL_MODE) ||
        !intel_dp_is_hdmi_2_1_sink(intel_dp) ||
        intel_dp->frl.is_trained)
        return;
    ...
}

If detailed capability info is not available, downstream_ports contains 1-byte
descriptors per port. Doesn't this mean downstream_ports[2] would represent
the third downstream port rather than byte 2 of Port 0?

If Port 2 happens to have bit 5 set, could this cause the driver to
incorrectly assume it's a PCON supporting source control mode, triggering
FRL training logic on non-PCON or non-HDMI branch devices? 

Even if the training gracefully aborts due to max_pcon_frl_bw being 0, it
looks like the error path unconditionally calls intel_dp_pcon_set_tmds_mode(),
which writes to DP_PCON_HDMI_LINK_CONFIG_1. Could writing to these registers
on generic MST hubs or docks cause hardware hangs or link training failures?

Should intel_dp_check_frl_training() be updated with similar checks to ensure
we only evaluate DP_PCON_SOURCE_CTL_MODE when appropriate?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260610174819.6258-1-alexander.kaplan@sms-medipool.de?part=1

  reply	other threads:[~2026-06-10 18:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-10 17:48 [PATCH] drm/dp: Read the PCON max FRL bandwidth only for HDMI DFPs Alexander Kaplan
2026-06-10 18:03 ` sashiko-bot [this message]
2026-06-10 18:44   ` Alexander Kaplan
2026-06-10 18:47 ` ✗ LGCI.VerificationFailed: failure for " Patchwork
2026-06-10 18:49 ` [PATCH] " Ville Syrjälä

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260610180312.374901F00893@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=alexander.kaplan@sms-medipool.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.