Re: [RFC PATCH 17/22] thunderbolt: Add initial support for USB4

From: Greg Kroah-Hartman
Date: Tue Oct 01 2019 - 08:47:55 EST


On Tue, Oct 01, 2019 at 02:38:25PM +0300, Mika Westerberg wrote:
> USB4 is a public spec based on Thunderbolt protocol. There are some
> differences in register layouts and flows. In addition to PCIe and DP
> tunneling, USB4 supports tunneling of USB 3.x. USB4 is also backward
> compatible with Thunderbolt 3 (and older generations but the spec only
> talks about 3rd generation). USB4 compliant devices can be identified by
> checking USB4 version field in router configuration space.
>
> This patch adds initial support for USB4 compliant hosts and devices
> which enables following features provided by the existing functionality
> in the driver:
>
> - PCIe tunneling
> - Display Port tunneling
> - Host and device NVM firmware upgrade
> - P2P networking
>
> This brings the USB4 support to the same level that we already have for
> Thunderbolt 1, 2 and 3 devices.
>
> Note the spec talks about host and device "routers" but in the driver we
> still use term "switch" in most places. Both can be used interchangeably.
>
> This also updates the Kconfig entry accordingly.
>
> Co-developed-by: Rajmohan Mani <rajmohan.mani@xxxxxxxxx>
> Signed-off-by: Rajmohan Mani <rajmohan.mani@xxxxxxxxx>
> Signed-off-by: Mika Westerberg <mika.westerberg@xxxxxxxxxxxxxxx>
> ---
> drivers/thunderbolt/Kconfig | 9 +-
> drivers/thunderbolt/Makefile | 2 +-
> drivers/thunderbolt/eeprom.c | 53 ++-
> drivers/thunderbolt/nhi.c | 3 +
> drivers/thunderbolt/nhi.h | 2 +
> drivers/thunderbolt/switch.c | 384 +++++++++++++-----
> drivers/thunderbolt/tb.c | 20 +-
> drivers/thunderbolt/tb.h | 36 ++
> drivers/thunderbolt/tb_regs.h | 36 +-
> drivers/thunderbolt/tunnel.c | 10 +-
> drivers/thunderbolt/usb4.c | 722 ++++++++++++++++++++++++++++++++++
> drivers/thunderbolt/xdomain.c | 6 +
> 12 files changed, 1162 insertions(+), 121 deletions(-)
> create mode 100644 drivers/thunderbolt/usb4.c
>
> diff --git a/drivers/thunderbolt/Kconfig b/drivers/thunderbolt/Kconfig
> index fd9adca898ff..8193ec310bae 100644
> --- a/drivers/thunderbolt/Kconfig
> +++ b/drivers/thunderbolt/Kconfig
> @@ -1,6 +1,6 @@
> # SPDX-License-Identifier: GPL-2.0-only
> menuconfig THUNDERBOLT
> - tristate "Thunderbolt support"
> + tristate "USB4 (Thunderbolt) support"
> depends on PCI
> depends on X86 || COMPILE_TEST
> select APPLE_PROPERTIES if EFI_STUB && X86
> @@ -9,9 +9,10 @@ menuconfig THUNDERBOLT
> select CRYPTO_HASH
> select NVMEM
> help
> - Thunderbolt Controller driver. This driver is required if you
> - want to hotplug Thunderbolt devices on Apple hardware or on PCs
> - with Intel Falcon Ridge or newer.
> + USB4 (Thunderbolt) driver. USB4 is the public spec based on
> + Thunderbolt 3 protocol. This driver is required if you want to
> + hotplug Thunderbolt and USB4 compliant devices on Apple
> + hardware or on PCs with Intel Falcon Ridge or newer.

Wait, did "old" thunderbolt just get re-branded as USB4?

Because if I have an "old" laptop that needs Thunderbolt support, how am
I going to know it is now called USB4 instead?

Shouldn't there just be a new USB4 option that only enables/builds the
USB4 stuff if selected? Why would I want all of this additional code on
my old system if it's not going to do anything at all?

Or am I confused?

thanks,

greg k-h