|
Takashi Iwai |
4e78b2 |
From b60e31bf18a7064032dbcb73dcb5b58f8a00a110 Mon Sep 17 00:00:00 2001
|
|
Takashi Iwai |
4e78b2 |
From: Sanjay R Mehta <sanju.mehta@amd.com>
|
|
Takashi Iwai |
4e78b2 |
Date: Thu, 4 Aug 2022 05:48:38 -0500
|
|
Takashi Iwai |
4e78b2 |
Subject: [PATCH] thunderbolt: Add DP OUT resource when DP tunnel is discovered
|
|
Takashi Iwai |
4e78b2 |
Git-commit: b60e31bf18a7064032dbcb73dcb5b58f8a00a110
|
|
Takashi Iwai |
4e78b2 |
Patch-mainline: v6.1-rc1
|
|
Takashi Iwai |
4e78b2 |
References: git-fixes
|
|
Takashi Iwai |
4e78b2 |
|
|
Takashi Iwai |
4e78b2 |
If the boot firmware implements a connection manager of its own it may
|
|
Takashi Iwai |
4e78b2 |
create a DisplayPort tunnel and will be handed off to Linux connection
|
|
Takashi Iwai |
4e78b2 |
manager, but the DP OUT resource is not saved in the dp_resource list.
|
|
Takashi Iwai |
4e78b2 |
|
|
Takashi Iwai |
4e78b2 |
This patch adds tunnelled DP OUT port to the dp_resource list once the
|
|
Takashi Iwai |
4e78b2 |
DP tunnel is discovered.
|
|
Takashi Iwai |
4e78b2 |
|
|
Takashi Iwai |
4e78b2 |
Signed-off-by: Sanjay R Mehta <sanju.mehta@amd.com>
|
|
Takashi Iwai |
4e78b2 |
Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
|
|
Takashi Iwai |
4e78b2 |
Tested-by: Renjith Pananchikkal <Renjith.Pananchikkal@amd.com>
|
|
Takashi Iwai |
4e78b2 |
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
|
|
Takashi Iwai |
4e78b2 |
Acked-by: Takashi Iwai <tiwai@suse.de>
|
|
Takashi Iwai |
4e78b2 |
|
|
Takashi Iwai |
4e78b2 |
---
|
|
Takashi Iwai |
4e78b2 |
drivers/thunderbolt/tb.c | 28 ++++++++++++++++++++++++++++
|
|
Takashi Iwai |
4e78b2 |
1 file changed, 28 insertions(+)
|
|
Takashi Iwai |
4e78b2 |
|
|
Takashi Iwai |
4e78b2 |
diff --git a/drivers/thunderbolt/tb.c b/drivers/thunderbolt/tb.c
|
|
Takashi Iwai |
4e78b2 |
index 9853f6c7e81d..583c22df4040 100644
|
|
Takashi Iwai |
4e78b2 |
--- a/drivers/thunderbolt/tb.c
|
|
Takashi Iwai |
4e78b2 |
+++ b/drivers/thunderbolt/tb.c
|
|
Takashi Iwai |
4e78b2 |
@@ -105,6 +105,32 @@ static void tb_remove_dp_resources(struct tb_switch *sw)
|
|
Takashi Iwai |
4e78b2 |
}
|
|
Takashi Iwai |
4e78b2 |
}
|
|
Takashi Iwai |
4e78b2 |
|
|
Takashi Iwai |
4e78b2 |
+static void tb_discover_dp_resource(struct tb *tb, struct tb_port *port)
|
|
Takashi Iwai |
4e78b2 |
+{
|
|
Takashi Iwai |
4e78b2 |
+ struct tb_cm *tcm = tb_priv(tb);
|
|
Takashi Iwai |
4e78b2 |
+ struct tb_port *p;
|
|
Takashi Iwai |
4e78b2 |
+
|
|
Takashi Iwai |
4e78b2 |
+ list_for_each_entry(p, &tcm->dp_resources, list) {
|
|
Takashi Iwai |
4e78b2 |
+ if (p == port)
|
|
Takashi Iwai |
4e78b2 |
+ return;
|
|
Takashi Iwai |
4e78b2 |
+ }
|
|
Takashi Iwai |
4e78b2 |
+
|
|
Takashi Iwai |
4e78b2 |
+ tb_port_dbg(port, "DP %s resource available discovered\n",
|
|
Takashi Iwai |
4e78b2 |
+ tb_port_is_dpin(port) ? "IN" : "OUT");
|
|
Takashi Iwai |
4e78b2 |
+ list_add_tail(&port->list, &tcm->dp_resources);
|
|
Takashi Iwai |
4e78b2 |
+}
|
|
Takashi Iwai |
4e78b2 |
+
|
|
Takashi Iwai |
4e78b2 |
+static void tb_discover_dp_resources(struct tb *tb)
|
|
Takashi Iwai |
4e78b2 |
+{
|
|
Takashi Iwai |
4e78b2 |
+ struct tb_cm *tcm = tb_priv(tb);
|
|
Takashi Iwai |
4e78b2 |
+ struct tb_tunnel *tunnel;
|
|
Takashi Iwai |
4e78b2 |
+
|
|
Takashi Iwai |
4e78b2 |
+ list_for_each_entry(tunnel, &tcm->tunnel_list, list) {
|
|
Takashi Iwai |
4e78b2 |
+ if (tb_tunnel_is_dp(tunnel))
|
|
Takashi Iwai |
4e78b2 |
+ tb_discover_dp_resource(tb, tunnel->dst_port);
|
|
Takashi Iwai |
4e78b2 |
+ }
|
|
Takashi Iwai |
4e78b2 |
+}
|
|
Takashi Iwai |
4e78b2 |
+
|
|
Takashi Iwai |
4e78b2 |
static void tb_switch_discover_tunnels(struct tb_switch *sw,
|
|
Takashi Iwai |
4e78b2 |
struct list_head *list,
|
|
Takashi Iwai |
4e78b2 |
bool alloc_hopids)
|
|
Takashi Iwai |
4e78b2 |
@@ -1446,6 +1472,8 @@ static int tb_start(struct tb *tb)
|
|
Takashi Iwai |
4e78b2 |
tb_scan_switch(tb->root_switch);
|
|
Takashi Iwai |
4e78b2 |
/* Find out tunnels created by the boot firmware */
|
|
Takashi Iwai |
4e78b2 |
tb_discover_tunnels(tb);
|
|
Takashi Iwai |
4e78b2 |
+ /* Add DP resources from the DP tunnels created by the boot firmware */
|
|
Takashi Iwai |
4e78b2 |
+ tb_discover_dp_resources(tb);
|
|
Takashi Iwai |
4e78b2 |
/*
|
|
Takashi Iwai |
4e78b2 |
* If the boot firmware did not create USB 3.x tunnels create them
|
|
Takashi Iwai |
4e78b2 |
* now for the whole topology.
|
|
Takashi Iwai |
4e78b2 |
--
|
|
Takashi Iwai |
4e78b2 |
2.35.3
|
|
Takashi Iwai |
4e78b2 |
|