netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: linux-usb@vger.kernel.org
Cc: Michael Jamet <michael.jamet@intel.com>,
	Yehezkel Bernat <YehezkelShB@gmail.com>,
	Andreas Noever <andreas.noever@gmail.com>,
	Isaac Hazan <isaac.hazan@intel.com>,
	Lukas Wunner <lukas@wunner.de>,
	"David S . Miller" <davem@davemloft.net>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	netdev@vger.kernel.org
Subject: [PATCH 02/10] thunderbolt: Find XDomain by route instead of UUID
Date: Wed,  4 Nov 2020 17:00:22 +0300	[thread overview]
Message-ID: <20201104140030.6853-3-mika.westerberg@linux.intel.com> (raw)
In-Reply-To: <20201104140030.6853-1-mika.westerberg@linux.intel.com>

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@linux.intel.com>
---
 drivers/thunderbolt/xdomain.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/thunderbolt/xdomain.c b/drivers/thunderbolt/xdomain.c
index c00ad817042e..e2866248f389 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,8 +596,8 @@ 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);
-		if (xd) {
+		xd = tb_xdomain_find_by_route_locked(tb, route);
+		if (xd && 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


  parent reply	other threads:[~2020-11-04 14:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-04 14:00 [PATCH 00/10] thunderbolt: Add DMA traffic test driver Mika Westerberg
2020-11-04 14:00 ` [PATCH 01/10] thunderbolt: Do not clear USB4 router protocol adapter IFC and ISE bits Mika Westerberg
2020-11-04 14:00 ` Mika Westerberg [this message]
2020-11-04 14:00 ` [PATCH 03/10] thunderbolt: Create XDomain devices for loops back to the host Mika Westerberg
2020-11-04 14:00 ` [PATCH 04/10] thunderbolt: Add link_speed and link_width to XDomain Mika Westerberg
2020-11-04 14:00 ` [PATCH 05/10] thunderbolt: Add functions for enabling and disabling lane bonding on XDomain Mika Westerberg
2020-11-04 14:00 ` [PATCH 06/10] thunderbolt: Create debugfs directory automatically for services Mika Westerberg
2020-11-04 14:20   ` Greg KH
2020-11-04 14:58     ` Mika Westerberg
2020-11-04 14:00 ` [PATCH 07/10] thunderbolt: Make it possible to allocate one directional DMA tunnel Mika Westerberg
2020-11-04 14:00 ` [PATCH 08/10] thunderbolt: Add support for end-to-end flow control Mika Westerberg
2020-11-04 14:00 ` [PATCH 09/10] thunderbolt: Add DMA traffic test driver Mika Westerberg
2020-11-04 18:38   ` Yehezkel Bernat
2020-11-05  7:16     ` Mika Westerberg
2020-11-04 14:00 ` [PATCH 10/10] MAINTAINERS: Add Isaac as maintainer of Thunderbolt " Mika Westerberg
2020-11-04 18:39 ` [PATCH 00/10] thunderbolt: Add " Yehezkel Bernat
2020-11-05  7:17   ` Mika Westerberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201104140030.6853-3-mika.westerberg@linux.intel.com \
    --to=mika.westerberg@linux.intel.com \
    --cc=YehezkelShB@gmail.com \
    --cc=andreas.noever@gmail.com \
    --cc=davem@davemloft.net \
    --cc=isaac.hazan@intel.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=michael.jamet@intel.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).