[PATCH] drm/dp_mst: Don't return error code when crtc is null
Ruhl, Michael J
michael.j.ruhl at intel.com
Fri Aug 14 17:35:46 UTC 2020
>-----Original Message-----
>From: dri-devel <dri-devel-bounces at lists.freedesktop.org> On Behalf Of
>Bhawanpreet Lakha
>Sent: Friday, August 14, 2020 1:02 PM
>To: mikita.lipski at amd.com; nicholas.kazlauskas at amd.com;
>alexander.deucher at amd.com
>Cc: Bhawanpreet Lakha <Bhawanpreet.Lakha at amd.com>; dri-
>devel at lists.freedesktop.org; amd-gfx at lists.freedesktop.org
>Subject: [PATCH] drm/dp_mst: Don't return error code when crtc is null
>
>[Why]
>In certain cases the crtc can be NULL and returning -EINVAL causes
>atomic check to fail when it shouln't. This leads to valid
>configurations failing because atomic check fails.
So is this a bug fix or an exception case, or an expected possibility?
>From my reading of the function comments, it is not clear that pos->port->connector
might be NULL for some reason.
A better explanation of why this would occur would make this a much more
useful commit message.
My reading is that you ran into this issue an are masking it with this fix.
Rather than this is a real possibility and this is the correct fix.
Mike
>[How]
>Don't early return if crtc is null
>
>Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha at amd.com>
>---
> drivers/gpu/drm/drm_dp_mst_topology.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c
>b/drivers/gpu/drm/drm_dp_mst_topology.c
>index 70c4b7afed12..bc90a1485699 100644
>--- a/drivers/gpu/drm/drm_dp_mst_topology.c
>+++ b/drivers/gpu/drm/drm_dp_mst_topology.c
>@@ -5037,8 +5037,8 @@ int drm_dp_mst_add_affected_dsc_crtcs(struct
>drm_atomic_state *state, struct drm
>
> crtc = conn_state->crtc;
>
>- if (WARN_ON(!crtc))
>- return -EINVAL;
>+ if (!crtc)
>+ continue;
>
> if (!drm_dp_mst_dsc_aux_for_port(pos->port))
> continue;
>--
>2.17.1
>
>_______________________________________________
>dri-devel mailing list
>dri-devel at lists.freedesktop.org
>https://lists.freedesktop.org/mailman/listinfo/dri-devel
More information about the amd-gfx
mailing list