[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201110091957.17472-3-mika.westerberg@linux.intel.com>
Date: Tue, 10 Nov 2020 12:19:49 +0300
From: Mika Westerberg <mika.westerberg@...ux.intel.com>
To: linux-usb@...r.kernel.org
Cc: Michael Jamet <michael.jamet@...el.com>,
Yehezkel Bernat <YehezkelShB@...il.com>,
Andreas Noever <andreas.noever@...il.com>,
Isaac Hazan <isaac.hazan@...el.com>,
Lukas Wunner <lukas@...ner.de>,
"David S . Miller" <davem@...emloft.net>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Mika Westerberg <mika.westerberg@...ux.intel.com>,
netdev@...r.kernel.org
Subject: [PATCH v2 02/10] thunderbolt: Find XDomain by route instead of UUID
We are going to represent loops back to the host also as XDomains and
they all have the same (host) UUID, so finding them needs to use route
string instead. This also requires that we check if the XDomain device
is added to the bus before its properties can be updated. Otherwise the
remote UUID might not be populated yet.
Signed-off-by: Mika Westerberg <mika.westerberg@...ux.intel.com>
Acked-by: Yehezkel Bernat <YehezkelShB@...il.com>
---
drivers/thunderbolt/xdomain.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/thunderbolt/xdomain.c b/drivers/thunderbolt/xdomain.c
index 48907853732a..e436e9efa7e7 100644
--- a/drivers/thunderbolt/xdomain.c
+++ b/drivers/thunderbolt/xdomain.c
@@ -587,8 +587,6 @@ static void tb_xdp_handle_request(struct work_struct *work)
break;
case PROPERTIES_CHANGED_REQUEST: {
- const struct tb_xdp_properties_changed *xchg =
- (const struct tb_xdp_properties_changed *)pkg;
struct tb_xdomain *xd;
ret = tb_xdp_properties_changed_response(ctl, route, sequence);
@@ -598,10 +596,12 @@ static void tb_xdp_handle_request(struct work_struct *work)
* the xdomain related to this connection as well in
* case there is a change in services it offers.
*/
- xd = tb_xdomain_find_by_uuid_locked(tb, &xchg->src_uuid);
+ xd = tb_xdomain_find_by_route_locked(tb, route);
if (xd) {
- queue_delayed_work(tb->wq, &xd->get_properties_work,
- msecs_to_jiffies(50));
+ if (device_is_registered(&xd->dev)) {
+ queue_delayed_work(tb->wq, &xd->get_properties_work,
+ msecs_to_jiffies(50));
+ }
tb_xdomain_put(xd);
}
--
2.28.0
Powered by blists - more mailing lists