From patchwork Thu Jun 1 01:51:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Koba Ko X-Patchwork-Id: 1788724 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=UcRSyGMT; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QWpz33DC1z20QB for ; Thu, 1 Jun 2023 11:51:59 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1q4XTl-0001Ko-1c; Thu, 01 Jun 2023 01:51:53 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1q4XTi-0001JV-KP for kernel-team@lists.ubuntu.com; Thu, 01 Jun 2023 01:51:50 +0000 Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 6274A41230 for ; Thu, 1 Jun 2023 01:51:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1685584310; bh=X2AluJfi+l3jCyHp0kI+yfm3GmDS1/0FKYZE4pKA9Og=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=UcRSyGMTy8lqEtz0t2KIAMszDQDq9PB4LD4gF4ZFP9BRVzCFpDykIWHUyjESbMnF9 lPFH1BUco6smOgT4Hz44677lHKVzWk4rgEfuR2+JzZXTZhDnMXghJ+rWSnil0wfYi7 HiqLmJUwmiLGWgI2YrNYyQd9+GV8oMXYUH0X91UxMOBf0nfL2X7kc/TnFp7foZi0Qn icu/Sxv3yljLsFRErrhsW1X18e72Aurk5dw0BQ6hUXaCHxgdHnK2N6tsQUa+tyrxR/ r9teV/sGpfKTUZFuXJbPqHLBb4J/btOS3g3nqQXgGS3yB9yY7CUz+3ZPJhGDZ68xUW KDb5PrTftwyCQ== Received: by mail-qt1-f198.google.com with SMTP id d75a77b69052e-3f6a8c3ef10so1923491cf.2 for ; Wed, 31 May 2023 18:51:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685584309; x=1688176309; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=X2AluJfi+l3jCyHp0kI+yfm3GmDS1/0FKYZE4pKA9Og=; b=awj3L1iIkfVKZUgeZJyzaY3T5WJ5JZwifkzE3SPUUtBryz7vCHZS84SLUpIGQr/tfV tHL1tcpjNVlvcXoCoYohShVD/bQIwvZQR3C1V/EFTJGeTnUdwg4J9otQgNv+dGkUmQsm LEmVLJ9kZmqecVYbJLpmjTcZdUj/uYJQJ7iWnf0/LLVoNEUqf+Jnqh95ZbODkAOtf0eB 1miifJGt8WlV3h+APawVLyNGn19lvNBNiWkHQfHitnnFcG8gyVJa+/VSmWVvd3DqTKul 4Jg3+yiHDHUbR3UKwBOU7N+IJG253mp6k5uN6mJ1o0nfYFt8Pm98Hmnp7/GGWTchmfkc tKBw== X-Gm-Message-State: AC+VfDze6w24NABq9uZCh4DrshpCd1fuLTKI+2yQyEDR2daDy0brW8wb P77a/kv5/n2edXnVd2XOiqq92YKNEau2G6tA8dySWahQ5ZqM25ATFzgw4W2ycsp4FXxPlYxxxC6 XApwwXy8BJApYOMJ1XNhxoRfra070xbbisWASegqftMG+XgFtIg== X-Received: by 2002:a05:622a:15d5:b0:3f5:483b:768a with SMTP id d21-20020a05622a15d500b003f5483b768amr8226145qty.6.1685584308992; Wed, 31 May 2023 18:51:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4/M01TzahM57Jrp3mEpVmMIIE1aBR6+2YU6nn1C9MxdQiNuEmfGAP5T2fXfUYoYAKjxEc37w== X-Received: by 2002:a05:622a:15d5:b0:3f5:483b:768a with SMTP id d21-20020a05622a15d500b003f5483b768amr8226127qty.6.1685584308563; Wed, 31 May 2023 18:51:48 -0700 (PDT) Received: from canonical.com (211-75-139-218.hinet-ip.hinet.net. [211.75.139.218]) by smtp.gmail.com with ESMTPSA id k27-20020a63ba1b000000b0051f15beba7fsm1752214pgf.67.2023.05.31.18.51.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 May 2023 18:51:47 -0700 (PDT) From: Koba Ko To: kernel-team@lists.ubuntu.com Subject: [PATCH 2/4][SRU][U/L/K] thunderbolt: Do not touch CL state configuration during discovery Date: Thu, 1 Jun 2023 09:51:26 +0800 Message-Id: <20230601015128.246426-3-koba.ko@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230601015128.246426-1-koba.ko@canonical.com> References: <20230601015128.246426-1-koba.ko@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Mika Westerberg BugLink: https://bugs.launchpad.net/bugs/2021949 If the boot firmware has already established tunnels, especially ones that have special requirements from the link such as DisplayPort, we should not blindly enable CL states (nor change the TMU configuration). Otherwise the existing tunnels may not work as expected. For this reason, skip the CL state enabling when we go over the existing topology. This will also keep the TMU settings untouched because we do not change the TMU configuration when CL states are not enabled. Reported-by: Koba Ko Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/7831 Cc: stable@vger.kernel.org # v6.0+ Acked-By: Yehezkel Bernat Signed-off-by: Mika Westerberg (cherry picked from commit 3fe95742af29b8b4eccab2ba94bc521805c6e10c git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt.git) Signed-off-by: Koba Ko --- drivers/thunderbolt/tb.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/thunderbolt/tb.c b/drivers/thunderbolt/tb.c index 3f1ab30c4fb15..e1eb092ad1d67 100644 --- a/drivers/thunderbolt/tb.c +++ b/drivers/thunderbolt/tb.c @@ -607,6 +607,7 @@ static void tb_scan_port(struct tb_port *port) { struct tb_cm *tcm = tb_priv(port->sw->tb); struct tb_port *upstream_port; + bool discovery = false; struct tb_switch *sw; int ret; @@ -674,8 +675,10 @@ static void tb_scan_port(struct tb_port *port) * tunnels and know which switches were authorized already by * the boot firmware. */ - if (!tcm->hotplug_active) + if (!tcm->hotplug_active) { dev_set_uevent_suppress(&sw->dev, true); + discovery = true; + } /* * At the moment Thunderbolt 2 and beyond (devices with LC) we @@ -705,10 +708,14 @@ static void tb_scan_port(struct tb_port *port) * CL0s and CL1 are enabled and supported together. * Silently ignore CLx enabling in case CLx is not supported. */ - ret = tb_switch_enable_clx(sw, TB_CL1); - if (ret && ret != -EOPNOTSUPP) - tb_sw_warn(sw, "failed to enable %s on upstream port\n", - tb_switch_clx_name(TB_CL1)); + if (discovery) { + tb_sw_dbg(sw, "discovery, not touching CL states\n"); + } else { + ret = tb_switch_enable_clx(sw, TB_CL1); + if (ret && ret != -EOPNOTSUPP) + tb_sw_warn(sw, "failed to enable %s on upstream port\n", + tb_switch_clx_name(TB_CL1)); + } if (tb_switch_is_clx_enabled(sw, TB_CL1)) /*