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 <[email protected]>

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/[email protected]?part=1

Reply via email to