On Tue, 29 Jun 2021, Kuogee Hsieh <khs...@codeaurora.org> wrote:
> From: Rajkumar Subbiah <rsub...@codeaurora.org>
>
> Commit 2f015ec6eab6 ("drm/dp_mst: Add sideband down request tracing +
> selftests") added some debug code for sideband message tracing. But
> it seems to have unintentionally changed the behavior on sideband message
> failure. It catches and returns failure only if DRM_UT_DP is enabled.
> Otherwise it ignores the error code and returns success. So on an MST
> unplug, the caller is unaware that the clear payload message failed and
> ends up waiting for 4 seconds for the response. Fixes the issue by
> returning the proper error code.
>
> Changes in V2:
> -- Revise commit text as review comment
> -- add Fixes text
>
> Fixes: 2f015ec6eab6 ("drm/dp_mst: Add sideband down request tracing + 
> selftests")
>
> Signed-off-by: Rajkumar Subbiah <rsub...@codeaurora.org>
> Signed-off-by: Kuogee Hsieh <khs...@codeaurora.org>
>
> Reviewed-by: Stephen Boyd <swb...@chromium.org>
> ---
>  drivers/gpu/drm/drm_dp_mst_topology.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c 
> b/drivers/gpu/drm/drm_dp_mst_topology.c
> index 1590144..8d97430 100644
> --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> @@ -2887,11 +2887,13 @@ static int process_single_tx_qlock(struct 
> drm_dp_mst_topology_mgr *mgr,
>       idx += tosend + 1;
>  
>       ret = drm_dp_send_sideband_msg(mgr, up, chunk, idx);
> -     if (unlikely(ret) && drm_debug_enabled(DRM_UT_DP)) {
> -             struct drm_printer p = drm_debug_printer(DBG_PREFIX);
> +     if (unlikely(ret)) {
> +             if (drm_debug_enabled(DRM_UT_DP)) {
> +                     struct drm_printer p = drm_debug_printer(DBG_PREFIX);
>  
> -             drm_printf(&p, "sideband msg failed to send\n");
> -             drm_dp_mst_dump_sideband_msg_tx(&p, txmsg);
> +                     drm_printf(&p, "sideband msg failed to send\n");
> +                     drm_dp_mst_dump_sideband_msg_tx(&p, txmsg);
> +             }
>               return ret;
>       }

Seems like a sensible thing to do.

(I'd probably rip out the "unlikely" while at it, as it feels like
unnecessary optimization, but *shrug*.)

Reviewed-by: Jani Nikula <jani.nik...@intel.com>


-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

Reply via email to