Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [High] drm_dp_mst_is_virtual_dpcd() unconditionally accepts 
DP_PEER_DEVICE_DP_LEGACY_CONV as a virtual DPCD without checking for a non-zero 
DPCD revision.
--

commit 7fdc1d351cc143b9e4d9acdb9eabc2fbc5bb1fee
Author: Xiao Lu <[email protected]>

drm/dp/mst: recognize DP-to-HDMI PCON as virtual DPCD in DP-to-DP topology

This commit attempts to correctly identify DP-to-HDMI PCON devices as having
a virtual DPCD within DP-to-DP topologies. It updates the peer device check
to accept legacy converters as valid downstream peer types.

> diff --git a/drivers/gpu/drm/display/drm_dp_mst_topology.c 
> b/drivers/gpu/drm/display/drm_dp_mst_topology.c
> --- a/drivers/gpu/drm/display/drm_dp_mst_topology.c
> +++ b/drivers/gpu/drm/display/drm_dp_mst_topology.c
[ ... ]
> @@ -6047,7 +6047,8 @@ static bool drm_dp_mst_is_virtual_dpcd(struct 
> drm_dp_mst_port *port)
>           port->mstb &&
>           port->mstb->num_ports == 2) {
>               list_for_each_entry(downstream_port, &port->mstb->ports, next) {
> -                     if (downstream_port->pdt == DP_PEER_DEVICE_SST_SINK &&
> +                     if ((downstream_port->pdt == DP_PEER_DEVICE_SST_SINK ||
> +                          downstream_port->pdt == 
> DP_PEER_DEVICE_DP_LEGACY_CONV) &&
>                           !downstream_port->input) {

[Severity: High]
Does this code also need to check for a non-zero DPCD revision?

The commit message specifies that PCON devices indicating a virtual DPCD
advertise DP_PEER_DEVICE_DP_LEGACY_CONV with a non-zero DPCD_Revision (VESA
SCR Option 2). However, this new condition accepts any downstream port with
the legacy converter peer type without verifying that 
downstream_port->dpcd_rev != 0.

Standard legacy converters (like DP-to-VGA or standard DP-to-HDMI adapters)
with an internal MST branch will typically have a DPCD revision of 0. By
omitting the dpcd_rev != 0 check, these standard legacy converters might be
falsely identified as having a virtual DPCD. 

If this happens, drm_dp_mst_dsc_aux_for_port() treats the adapter as having 
a virtual DPCD and attempts a remote DPCD read on the legacy port. Since 
the legacy port has no virtual DPCD, the remote DPCD read receives a NAK 
and returns -EIO, causing drm_dp_mst_dsc_aux_for_port() to return NULL and 
potentially disable DSC for the port entirely.

>                               mutex_unlock(&port->mgr->lock);
>                               return true;
>                       }

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

Reply via email to