Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3638655pxv; Mon, 5 Jul 2021 02:09:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxILiaYzn4VdsTvUu0e4d8NpCuuFiRT0hFXP8aeHqeFN/lN37di6Woga6BFd+U5LsuiO3V X-Received: by 2002:a17:906:6b1b:: with SMTP id q27mr12286845ejr.169.1625476162400; Mon, 05 Jul 2021 02:09:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625476162; cv=none; d=google.com; s=arc-20160816; b=1Ed+AO0WgkraWvzs8j32Pa8joDlALrmLnTIoCr+9a3QnGRnE5/Q7oM3bsmwHOkZPii A2Q9ijuEU79drqTnqJQ5ooBzFgde+DDY9St9SOvZFWFFWEjudaGlhdecFdqC5XKsI+jk bdfNn3KXj6qSxhahBNtM72AgMVkcy2SnWQTLnw/GChIiksh4xaxotE4RS2GnpVwQELdP 51GN1TeNaxjOcjzsD6XJZqmRd6JfN7CRxXqLIgonsWD7fN7J2R36ctzVvJuOugBDkACD tEJhPKY7YA633ozK1m4mT/gzqld2kbn2bxTkVDCfnKlQzcpJxVKn1vLr8Bx1V1bgPCey IWzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :organization:in-reply-to:subject:cc:to:from; bh=mGeS4NaVc+qt11BPB0WLZl/NOZHYw9w9n2ZKixU+8FY=; b=b1Eb0GDVmGcLND0NVd/v8HV6sNI/8X2NMUvqpkpBAr+Dfz/ilvp9wGcXtljqX4MWh+ dFGF1kBWnzN2VE31zcAkDSkELK7FCg6JZ28qgLDusCqyjJbGjDSI6njx2fp8LJhtfioL DGpNcMSbpTiKDWpYJs0LgWQ3vmGJif2MrnawkEiqqq4iY4gWyGvNlP+hT17izdLcXX+o MWB9vZbwXNnTZVXoqw9Qrij7EOWLgA/rGbGzxE+AMrrG4HzwVnF5e3YW7DVR3hIm+7nE reV+rqRSX7Yr66Wwg/dww7Wdckv4325c4WnK2tpxPvd2nHSXUZ7XGg6lHqpIAg1lCNAv seIg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m18si11070047eje.74.2021.07.05.02.08.58; Mon, 05 Jul 2021 02:09:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230241AbhGEJKY (ORCPT + 99 others); Mon, 5 Jul 2021 05:10:24 -0400 Received: from mga05.intel.com ([192.55.52.43]:41923 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230121AbhGEJKX (ORCPT ); Mon, 5 Jul 2021 05:10:23 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10035"; a="294590796" X-IronPort-AV: E=Sophos;i="5.83,325,1616482800"; d="scan'208";a="294590796" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jul 2021 02:07:46 -0700 X-IronPort-AV: E=Sophos;i="5.83,325,1616482800"; d="scan'208";a="485435002" Received: from elang-mobl.ger.corp.intel.com (HELO localhost) ([10.252.59.138]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jul 2021 02:07:41 -0700 From: Jani Nikula To: Kuogee Hsieh , robdclark@gmail.com, sean@poorly.run, swboyd@chromium.org, lyude@redhat.com Cc: rnayak@codeaurora.org, tzimmermann@suse.de, airlied@linux.ie, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, abhinavk@codeaurora.org, khsieh@codeaurora.org, aravindh@codeaurora.org, freedreno@lists.freedesktop.org, rsubbia@codeaurora.org Subject: Re: [PATCH v2] drm/dp_mst: Fix return code on sideband message failure In-Reply-To: <1625008068-16458-1-git-send-email-khsieh@codeaurora.org> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <1625008068-16458-1-git-send-email-khsieh@codeaurora.org> Date: Mon, 05 Jul 2021 12:07:38 +0300 Message-ID: <87czrx9lid.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 29 Jun 2021, Kuogee Hsieh wrote: > From: Rajkumar Subbiah > > 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 > Signed-off-by: Kuogee Hsieh > > Reviewed-by: Stephen Boyd > --- > 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 Nikula, Intel Open Source Graphics Center