Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1573752pxb; Thu, 16 Sep 2021 10:10:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZ7end8o1Bd+tyDnGUjZQ4/L0WR7qkeM++Ax5k0gA3Od++0aWWBVWHSkvOlZONEHOTBEav X-Received: by 2002:a17:906:5586:: with SMTP id y6mr7313009ejp.189.1631812255653; Thu, 16 Sep 2021 10:10:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631812255; cv=none; d=google.com; s=arc-20160816; b=rqIbayrselGx1Cl3ZxUDOliVIVKA8QoUO6gsWXig6GCEWNYxQ7xX3l7ytdOSdBiqLc gddWzA9GiUIdFG4ZyLeZcMv9DjM22leyrgfvOQ65FGcExoQFkZ9O4xxKoD+yC62izAVS xO+sjmLaRTImWR96nAC7etKx8muf9m2LyXd/1+epDFMuOCBm/wh6B+oVIkYaspomBAtl u2oDesQ5XkCZ4a5wntfwCdaSZrMlUObfN9enk/IhLJ2hWoFtOaSD9zQWbvgmOZS2NYZv 928GzBfdzaXtflDc29dZirqwOyg7ExxzWIAbPO1waX7Aq0kznnnGHjBLlpfd7uN4AXz3 cpRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=fberwAFhnjcwYyQzSXHRgVaOlO4PW9FnpjtGRFDtzKg=; b=eTOQ2278vPxhKo4bRder+9M5SvA5oD/60M3Xu379vdKeuoMN/b/JHlYgjJdSMY2bqs NzMryTK+UK/mWP3GVEt0i2rfFWCUi4mQSjlvDjohaiqqGLzMMR1CNU0l2vnbpQEslMla EOba2RwlRF2sXffag8alDECz0dcNdpXjchJG8uqADs5U5NyTiwa55r6auQb9EiiNf6Zl HwMNOPiOxCzFK48J4yuh/pwo8HNUnqzeNFXNHwBOubmOsNG9kLgb0lEU/9FyhLmSNXVD 9ulxPCVlPzZd+Qg6AoBD7BX3GwU3fZCYLHvb733AO0OoyDJ0fw7QaXxaF7WcrUjBrv7Y VtFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aGX75xdO; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e25si4130234ejy.256.2021.09.16.10.10.23; Thu, 16 Sep 2021 10:10:55 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aGX75xdO; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349628AbhIPRJN (ORCPT + 99 others); Thu, 16 Sep 2021 13:09:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:34036 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348403AbhIPRCq (ORCPT ); Thu, 16 Sep 2021 13:02:46 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8F7DA6139F; Thu, 16 Sep 2021 16:33:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631810025; bh=Q2Ovodfp8re7jwomZOCLSBh1cGJXYJoKDevgiklErVc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aGX75xdOXgQKUfkNP3GibFtuHZBI+RbrRbht6m9Pwep4F5JWY4j1SwxqiOxnG2emb MscI1+POOd52xT/gvFPkPMR7HOJTsycj3M+AElJFzOChZE6jVQHH1bLNWn0C5YoXpa 2UF53ove67BBBe3lAloM8Q9CUX305KVJ5wBz7iXE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rajkumar Subbiah , Kuogee Hsieh , Stephen Boyd , Jani Nikula , Lyude Paul Subject: [PATCH 5.13 370/380] drm/dp_mst: Fix return code on sideband message failure Date: Thu, 16 Sep 2021 18:02:07 +0200 Message-Id: <20210916155816.639793884@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155803.966362085@linuxfoundation.org> References: <20210916155803.966362085@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rajkumar Subbiah commit 92bd92c44d0d9be5dcbcda315b4be4b909ed9740 upstream. 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 Changes in V3: -- remove "unlikely" optimization Fixes: 2f015ec6eab6 ("drm/dp_mst: Add sideband down request tracing + selftests") Cc: # v5.5+ Signed-off-by: Rajkumar Subbiah Signed-off-by: Kuogee Hsieh Reviewed-by: Stephen Boyd Reviewed-by: Jani Nikula Reviewed-by: Lyude Paul Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/1625585434-9562-1-git-send-email-khsieh@codeaurora.org Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/drm_dp_mst_topology.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c @@ -2867,11 +2867,13 @@ static int process_single_tx_qlock(struc 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 (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; }