linux-usb.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>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	netdev@vger.kernel.org
Subject: [PATCH v2 01/10] thunderbolt: Do not clear USB4 router protocol adapter IFC and ISE bits
Date: Tue, 10 Nov 2020 12:19:48 +0300	[thread overview]
Message-ID: <20201110091957.17472-2-mika.westerberg@linux.intel.com> (raw)
In-Reply-To: <20201110091957.17472-1-mika.westerberg@linux.intel.com>

These fields are marked as vendor defined in the USB4 spec and should
not be modified by the software, so only clear them when we are dealing
with pre-USB4 hardware.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Yehezkel Bernat <YehezkelShB@gmail.com>
---
 drivers/thunderbolt/path.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/thunderbolt/path.c b/drivers/thunderbolt/path.c
index 03e7b714deab..7c2c45d9ba4a 100644
--- a/drivers/thunderbolt/path.c
+++ b/drivers/thunderbolt/path.c
@@ -406,10 +406,17 @@ static int __tb_path_deactivate_hop(struct tb_port *port, int hop_index,
 
 		if (!hop.pending) {
 			if (clear_fc) {
-				/* Clear flow control */
-				hop.ingress_fc = 0;
+				/*
+				 * Clear flow control. Protocol adapters
+				 * IFC and ISE bits are vendor defined
+				 * in the USB4 spec so we clear them
+				 * only for pre-USB4 adapters.
+				 */
+				if (!tb_switch_is_usb4(port->sw)) {
+					hop.ingress_fc = 0;
+					hop.ingress_shared_buffer = 0;
+				}
 				hop.egress_fc = 0;
-				hop.ingress_shared_buffer = 0;
 				hop.egress_shared_buffer = 0;
 
 				return tb_port_write(port, &hop, TB_CFG_HOPS,
-- 
2.28.0


  reply	other threads:[~2020-11-10  9:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-10  9:19 [PATCH v2 00/10] thunderbolt: Add DMA traffic test driver Mika Westerberg
2020-11-10  9:19 ` Mika Westerberg [this message]
2020-11-10  9:19 ` [PATCH v2 02/10] thunderbolt: Find XDomain by route instead of UUID Mika Westerberg
2020-11-10  9:19 ` [PATCH v2 03/10] thunderbolt: Create XDomain devices for loops back to the host Mika Westerberg
2020-11-10  9:19 ` [PATCH v2 04/10] thunderbolt: Add link_speed and link_width to XDomain Mika Westerberg
2020-11-10  9:19 ` [PATCH v2 05/10] thunderbolt: Add functions for enabling and disabling lane bonding on XDomain Mika Westerberg
2020-11-10  9:19 ` [PATCH v2 06/10] thunderbolt: Create debugfs directory automatically for services Mika Westerberg
2020-11-10  9:19 ` [PATCH v2 07/10] thunderbolt: Make it possible to allocate one directional DMA tunnel Mika Westerberg
2020-11-10  9:19 ` [PATCH v2 08/10] thunderbolt: Add support for end-to-end flow control Mika Westerberg
2020-11-10  9:19 ` [PATCH v2 09/10] thunderbolt: Add DMA traffic test driver Mika Westerberg
2020-11-10  9:19 ` [PATCH v2 10/10] MAINTAINERS: Add Isaac as maintainer of Thunderbolt " Mika Westerberg
2020-11-10  9:30 ` [PATCH v2 00/10] thunderbolt: Add " Greg Kroah-Hartman
2020-11-11  7:23   ` 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=20201110091957.17472-2-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=gregkh@linuxfoundation.org \
    --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).