Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1542410pxb; Thu, 16 Sep 2021 09:34:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxC2+KPfPQyTlCyJJhlt4fEsksXmjFvtKQBS1yyP8nqbs1FDnWWbxgo+FkcBwsqoTYmclQl X-Received: by 2002:a92:ca82:: with SMTP id t2mr4541543ilo.151.1631810061481; Thu, 16 Sep 2021 09:34:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631810061; cv=none; d=google.com; s=arc-20160816; b=pRncQLk1pEUTLAb+PpTVzdFx0TarUPzpq31Xsgfn7Oz/E8XRPnkgV2JZleJw/sQwXK hzXYDJm85FVN1DMUotB3cSuFSeg0FRBnDwmWgvUX9KVf/NNWITVXnti+PeRNP1XU8EBd qajItyl7MOgvlHVHeS7w4m/lir5Pr6nM9DT9SBtm60blZXGGcW5GZJhIaDHQWiUp6pth Cg9lcffxMqBoe5bzOuYY9AKx/kA0Utpy3BYRUszuTsNmLjGZzT15SE2oFnUmhFXWrNC0 wJcGjBlgE5Q1op/NsNrYzefHNuAU7RRolHw10zbd91PRKHpoI3lbofxCYuzN84pJqgBA ctZw== 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=JKCj3d9gsNi2rJfVpUBUgB6JqomOOV5GNAsfjqYcS4I=; b=Bc0SjGDch57VPk1hV5Lt26bCr9CISZtGQuMb39FQmyz1l69ZgfvUbwG0KEHr6tKF6z DD2kzQVfEfTCPxdmgzI/IbalhEXrlosMQuweKJ5B69tYqpUFRcGdYJjqrszIy+grto+x endvinY0JP3MUZAkZbb6CjPwX8xhrL8knNUNuvP+5ovFgDbKEvKaDtnt9K5qgYccjvJy OmVJ4RcaiOQ/R7Pj5TBIpdrTKcjiUjrQsO4+CUMy9nAdHHN77uh60cUelu6mnA/D8BmO bXGz9BufKxwzgPLBMDEK7c4Cp0751tW8wGprkCRlYW7jjg7nDGW6Wpra8uyE8ZJrBJWp dq/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Z0fU1XPq; 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 m22si2555351jaa.52.2021.09.16.09.34.09; Thu, 16 Sep 2021 09:34:21 -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=Z0fU1XPq; 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 S242304AbhIPQdU (ORCPT + 99 others); Thu, 16 Sep 2021 12:33:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:37482 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240819AbhIPQZL (ORCPT ); Thu, 16 Sep 2021 12:25:11 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AA588613CE; Thu, 16 Sep 2021 16:16:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631808991; bh=vHuqIDHvWxPgaCQEKm/V2kYjdfojuwWIISJ9PRqTjFg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z0fU1XPq6WRZPtSnIT7tDo6sKrHgP6hWwxKqiiFFhajLBeDQPkqGd/Hr/4YnoMPAl RKhtrPJYnpDu2iLKVfAk5oW0JdJCgRA+PGjsciX9netAVnWQ43stVn4tnBIct7GkhW YwTmFwwnd+uN52U+uWoWxILtSNzWwPWyKv7sNbhM= 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.10 298/306] drm/dp_mst: Fix return code on sideband message failure Date: Thu, 16 Sep 2021 18:00:43 +0200 Message-Id: <20210916155804.251002646@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155753.903069397@linuxfoundation.org> References: <20210916155753.903069397@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 @@ -2869,11 +2869,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; }