From patchwork Thu Nov 10 17:19:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Bader X-Patchwork-Id: 1702226 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=QUbD+Xkg; 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 4N7T8q0t6Lz23mT for ; Fri, 11 Nov 2022 04:19:23 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1otBCv-0006WW-Bj; Thu, 10 Nov 2022 17:19:17 +0000 Received: from smtp-relay-canonical-1.internal ([10.131.114.174] helo=smtp-relay-canonical-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 1otBCs-0006VO-1z for kernel-team@lists.ubuntu.com; Thu, 10 Nov 2022 17:19:14 +0000 Received: from canonical.com (1.general.smb.uk.vpn [10.172.193.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPSA id B14114327A; Thu, 10 Nov 2022 17:19:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1668100753; bh=HAWjq6YTBWXDqzU+twpR9b3xuA1zvjDE0ps2Ji5F2wM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=QUbD+XkgCWQQD76g1JPysgZTfu8E+V5ifF9McDoIESHrqPQGp8rpkO5IRqYyVClZ8 9ALrqmQbS7uP2xefu3lw3lsyZMiPxBgRvOLEmXkY4C6zZuoWPukwXXjI4PH3+zwORN JkRDZ/Q3QRNy1/MwMPgBzNqw9+anly7N8lI3TQ1H+7BHk2btpIKPUStSJEczKbxc+B 8KMarfmRoPMNk5i2muy0lEv1rzsHxZmQ+hAEnlQ1Fr5ug7Pa9bHlElUjmBspc/4v6V 8+ccDobCw8K03ZZUiDvDVprZkpCAIE2zg98ResR24NK2YVKDEKXuhMwu0lAeVk+WDu 7kbest/s9j6MA== From: Stefan Bader To: kernel-team@lists.ubuntu.com Subject: [SRU Jammy][PATCH 1/2] Revert "UBUNTU: SAUCE: thunderbolt: Add DP out resource when DP tunnel is discovered." Date: Thu, 10 Nov 2022 18:19:11 +0100 Message-Id: <20221110171912.153390-2-stefan.bader@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221110171912.153390-1-stefan.bader@canonical.com> References: <20221110171912.153390-1-stefan.bader@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: , Cc: Mario Limonciello Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1989944 This reverts commit c8ce3e4fd19d65e6393c04f6c170b516f68c2db4 to be replaced by the upstream variant. Signed-off-by: Stefan Bader --- drivers/thunderbolt/tb.c | 15 --------------- drivers/thunderbolt/tb.h | 1 - drivers/thunderbolt/tunnel.c | 2 -- 3 files changed, 18 deletions(-) diff --git a/drivers/thunderbolt/tb.c b/drivers/thunderbolt/tb.c index eeff620ef407..ea77b4369c7e 100644 --- a/drivers/thunderbolt/tb.c +++ b/drivers/thunderbolt/tb.c @@ -1007,21 +1007,6 @@ static void tb_dp_resource_unavailable(struct tb *tb, struct tb_port *port) tb_tunnel_dp(tb); } -void tb_dp_resource_available_discovered(struct tb *tb, struct tb_port *port) -{ - struct tb_cm *tcm = tb_priv(tb); - struct tb_port *p; - - list_for_each_entry(p, &tcm->dp_resources, list) { - if (p == port) - return; - } - - tb_port_dbg(port, "DP %s resource available discovered\n", - tb_port_is_dpin(port) ? "IN" : "OUT"); - list_add_tail(&port->list, &tcm->dp_resources); -} - static void tb_dp_resource_available(struct tb *tb, struct tb_port *port) { struct tb_cm *tcm = tb_priv(tb); diff --git a/drivers/thunderbolt/tb.h b/drivers/thunderbolt/tb.h index 3149b3ca0f2e..3fae40670b72 100644 --- a/drivers/thunderbolt/tb.h +++ b/drivers/thunderbolt/tb.h @@ -956,7 +956,6 @@ int tb_dp_port_set_hops(struct tb_port *port, unsigned int video, unsigned int aux_tx, unsigned int aux_rx); bool tb_dp_port_is_enabled(struct tb_port *port); int tb_dp_port_enable(struct tb_port *port, bool enable); -void tb_dp_resource_available_discovered(struct tb *tb, struct tb_port *port); struct tb_path *tb_path_discover(struct tb_port *src, int src_hopid, struct tb_port *dst, int dst_hopid, diff --git a/drivers/thunderbolt/tunnel.c b/drivers/thunderbolt/tunnel.c index d85b41a093b9..500a0afe3073 100644 --- a/drivers/thunderbolt/tunnel.c +++ b/drivers/thunderbolt/tunnel.c @@ -832,8 +832,6 @@ struct tb_tunnel *tb_tunnel_discover_dp(struct tb *tb, struct tb_port *in, goto err_deactivate; } - tb_dp_resource_available_discovered(tb, tunnel->dst_port); - tb_tunnel_dbg(tunnel, "discovered\n"); return tunnel; From patchwork Thu Nov 10 17:19:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Bader X-Patchwork-Id: 1702227 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=KpAYQ8FV; 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 4N7T8r0794z23mT for ; Fri, 11 Nov 2022 04:19:24 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1otBCv-0006Wx-K9; Thu, 10 Nov 2022 17:19:17 +0000 Received: from smtp-relay-canonical-0.internal ([10.131.114.83] helo=smtp-relay-canonical-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1otBCs-0006VZ-NF for kernel-team@lists.ubuntu.com; Thu, 10 Nov 2022 17:19:14 +0000 Received: from canonical.com (1.general.smb.uk.vpn [10.172.193.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPSA id 5E428422D1; Thu, 10 Nov 2022 17:19:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1668100754; bh=qdwQmccd5S0QhsLpejBKXlNInk6Wj7X3QPdW8CqT3Lk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=KpAYQ8FVfznV7dxQAmrOCumCmxd4+wJAE9ZvN7bV4gN4nZvA/ULZCWGLKYRfZHzw3 BJPkBVbqdZoI4LWOW5DIq6PTiLKhmgaegNhdIMxCYpiKktEFi1hR9I0PBoTGfaCCZ3 FlNiTN5KA6DycyuRxX9Vgc9gTjQS6a2p+s/rCkmht+9zbUICJ3QMK1uSxYX8YdXBf9 /Igq+qo38NUupn6ok1g5cyBZEKrIcfcXIIv4QK10pHJirMeDtavDMsLxvQJHa1eDl+ 5t7VW3NOKWEYS6dA4j+Qe0olMncxUn8SkDdpv9NWjK2xeopArw5wOe00/VKU/h8haJ 1qTMXtJWbDDOg== From: Stefan Bader To: kernel-team@lists.ubuntu.com Subject: [SRU Jammy][PATCH 2/2] thunderbolt: Add DP OUT resource when DP tunnel is discovered Date: Thu, 10 Nov 2022 18:19:12 +0100 Message-Id: <20221110171912.153390-3-stefan.bader@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221110171912.153390-1-stefan.bader@canonical.com> References: <20221110171912.153390-1-stefan.bader@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: , Cc: Mario Limonciello Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Sanjay R Mehta BugLink: https://bugs.launchpad.net/bugs/1989944 If the boot firmware implements a connection manager of its own it may create a DisplayPort tunnel and will be handed off to Linux connection manager, but the DP OUT resource is not saved in the dp_resource list. This patch adds tunnelled DP OUT port to the dp_resource list once the DP tunnel is discovered. Signed-off-by: Sanjay R Mehta Signed-off-by: Basavaraj Natikar Tested-by: Renjith Pananchikkal Signed-off-by: Mika Westerberg (cherry picked from commit b60e31bf18a7064032dbcb73dcb5b58f8a00a110) Signed-off-by: Stefan Bader --- drivers/thunderbolt/tb.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/drivers/thunderbolt/tb.c b/drivers/thunderbolt/tb.c index ea77b4369c7e..0c3e1d14cddc 100644 --- a/drivers/thunderbolt/tb.c +++ b/drivers/thunderbolt/tb.c @@ -105,6 +105,32 @@ static void tb_remove_dp_resources(struct tb_switch *sw) } } +static void tb_discover_dp_resource(struct tb *tb, struct tb_port *port) +{ + struct tb_cm *tcm = tb_priv(tb); + struct tb_port *p; + + list_for_each_entry(p, &tcm->dp_resources, list) { + if (p == port) + return; + } + + tb_port_dbg(port, "DP %s resource available discovered\n", + tb_port_is_dpin(port) ? "IN" : "OUT"); + list_add_tail(&port->list, &tcm->dp_resources); +} + +static void tb_discover_dp_resources(struct tb *tb) +{ + struct tb_cm *tcm = tb_priv(tb); + struct tb_tunnel *tunnel; + + list_for_each_entry(tunnel, &tcm->tunnel_list, list) { + if (tb_tunnel_is_dp(tunnel)) + tb_discover_dp_resource(tb, tunnel->dst_port); + } +} + static void tb_switch_discover_tunnels(struct tb_switch *sw, struct list_head *list, bool alloc_hopids) @@ -1396,6 +1422,8 @@ static int tb_start(struct tb *tb) tb_scan_switch(tb->root_switch); /* Find out tunnels created by the boot firmware */ tb_discover_tunnels(tb); + /* Add DP resources from the DP tunnels created by the boot firmware */ + tb_discover_dp_resources(tb); /* * If the boot firmware did not create USB 3.x tunnels create them * now for the whole topology.