dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Vivek Kumar" <vk092kumar@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v3] drm/msm/dp: allow eDP sinks without DP_SINK_COUNT
Date: Thu, 17 Sep 2026 12:55:59 +0000	[thread overview]
Message-ID: <20260917125559.C866B1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260917124706.421107-1-vk092kumar@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] drm/msm/dp: eDP exemption missing in msm_dp_panel_read_link_caps and error code swallowed
--

commit 7281f0c6a3afd650cbe36bf532b8b56ce312bf5e
Author: Vivek Kumar <vk092kumar@gmail.com>

drm/msm/dp: allow eDP sinks without DP_SINK_COUNT

Some eDP sinks, especially fixed-format eDP-to-HDMI bridge chips with
no downstream AUX-capable panel behind them, do not report a non-zero
DP_SINK_COUNT even though they participate normally in DPCD capability
exchange and link training.

Treating sink_count == 0 as a permanent disconnect is valid for external
DisplayPort, but it breaks eDP probe/enable paths in
msm_dp_display_prepare_link().

> diff --git a/drivers/gpu/drm/msm/dp/dp_link.c b/drivers/gpu/drm/msm/dp/dp_link.c
> index 34a91e194a124..bf08b5b18097d 100644
> --- a/drivers/gpu/drm/msm/dp/dp_link.c
> +++ b/drivers/gpu/drm/msm/dp/dp_link.c
> @@ -725,6 +725,16 @@ static int msm_dp_link_parse_sink_status_field(struct msm_dp_link_private *link)
>  		DRM_ERROR("DP parse sink count failed\n");
>  		return ret;
>  	}
> +
> +	/*
> +	 * Some eDP sinks do not report a valid sink count, even though they
> +	 * otherwise participate in link training and DPCD capability exchange.
> +	 * Treat a zero raw count as a valid non-zero placeholder so we do not
> +	 * misclassify the link as disconnected on eDP.
> +	 */
> +	if (msm_dp_aux_is_edp(link->aux) && ret == 0)
> +		ret = 1;
> +
>  	link->msm_dp_link.sink_count = ret;

[Severity: High]
Does this patch miss a similar check in msm_dp_panel_read_link_caps()?

Looking at drivers/gpu/drm/msm/dp/dp_panel.c, there is another check for the
sink count that will still return -ENOTCONN for these eDP branch devices:

drivers/gpu/drm/msm/dp/dp_panel.c:msm_dp_panel_read_link_caps() {
	...
	count = drm_dp_read_sink_count(panel->aux);
	if (!count) {
		panel->link->sink_count = 0;
		return -ENOTCONN;
	}
	...
}

Because this duplicate check aborts the connection process, eDP-to-HDMI
bridges reporting a zero sink count will still be broken, negating the
purpose of this patch.

Additionally, could the check in msm_dp_panel_read_link_caps() be
swallowing negative error codes? Since it only checks if (!count), a
negative error code (like -EIO or -ETIMEDOUT) from drm_dp_read_sink_count()
will evaluate to false, skipping the error block and allowing the code to
continue with an invalid state instead of handling the error.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260917124706.421107-1-vk092kumar@gmail.com?part=1

  reply	other threads:[~2026-09-17 12:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-17 12:47 [PATCH v3] drm/msm/dp: allow eDP sinks without DP_SINK_COUNT Vivek Kumar
2026-09-17 12:55 ` sashiko-bot [this message]
2026-10-01  1:50 ` Dmitry Baryshkov

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=20260917125559.C866B1F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=vk092kumar@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox