Commit 6c9a9a8d authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Merge tag 'thunderbolt-for-v5.9' of...

Merge tag 'thunderbolt-for-v5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt into usb-next

Mika writes:

thunderbolt: Changes for v5.9 merge window

This includes following Thunderbolt/USB4 changes for v5.9 merge window:

  * Improvements around NHI (Native Host Interface) HopID allocation

  * Improvements to tunneling and USB3 bandwidth management support

  * Add KUnit tests for path walking and tunneling

  * Initial support for USB4 retimer firmware upgrade

  * Implement Thunderbolt device firmware upgrade mechanism that runs
    the NVM image authentication when the device is disconnected.

  * A couple of small non-critical fixes

* tag 'thunderbolt-for-v5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt: (32 commits)
  thunderbolt: Fix old style declaration warning
  thunderbolt: Add support for authenticate on disconnect
  thunderbolt: Add support for separating the flush to SPI and authenticate
  thunderbolt: Ensure left shift of 512 does not overflow a 32 bit int
  thunderbolt: Add support for on-board retimers
  thunderbolt: Implement USB4 port sideband operations for retimer access
  thunderbolt: Retry USB4 block read operation
  thunderbolt: Generalize usb4_switch_do_[read|write]_data()
  thunderbolt: Split common NVM functionality into a separate file
  thunderbolt: Add Intel USB-IF ID to the NVM upgrade supported list
  thunderbolt: Add KUnit tests for tunneling
  thunderbolt: Add USB3 bandwidth management
  thunderbolt: Make tb_port_get_link_speed() available to other files
  thunderbolt: Implement USB3 bandwidth negotiation routines
  thunderbolt: Increase DP DPRX wait timeout
  thunderbolt: Report consumed bandwidth in both directions
  thunderbolt: Make usb4_switch_map_pcie_down() also return enabled ports
  thunderbolt: Make usb4_switch_map_usb3_down() also return enabled ports
  thunderbolt: Do not tunnel USB3 if link is not USB4
  thunderbolt: Add DP IN resources for all routers
  ...
parents 15d157e8 ef7e1207
Loading
Loading
Loading
Loading
+55 −2
Original line number Diff line number Diff line
@@ -178,11 +178,18 @@ KernelVersion: 4.13
Contact:	thunderbolt-software@lists.01.org
Description:	When new NVM image is written to the non-active NVM
		area (through non_activeX NVMem device), the
		authentication procedure is started by writing 1 to
		this file. If everything goes well, the device is
		authentication procedure is started by writing to
		this file.
		If everything goes well, the device is
		restarted with the new NVM firmware. If the image
		verification fails an error code is returned instead.

		This file will accept writing values "1" or "2"
		- Writing "1" will flush the image to the storage
		area and authenticate the image in one action.
		- Writing "2" will run some basic validation on the image
		and flush it to the storage area.

		When read holds status of the last authentication
		operation if an error occurred during the process. This
		is directly the status value from the DMA configuration
@@ -236,3 +243,49 @@ KernelVersion: 4.15
Contact:	thunderbolt-software@lists.01.org
Description:	This contains XDomain service specific settings as
		bitmask. Format: %x

What:		/sys/bus/thunderbolt/devices/<device>:<port>.<index>/device
Date:		Oct 2020
KernelVersion:	v5.9
Contact:	Mika Westerberg <mika.westerberg@linux.intel.com>
Description:	Retimer device identifier read from the hardware.

What:		/sys/bus/thunderbolt/devices/<device>:<port>.<index>/nvm_authenticate
Date:		Oct 2020
KernelVersion:	v5.9
Contact:	Mika Westerberg <mika.westerberg@linux.intel.com>
Description:	When new NVM image is written to the non-active NVM
		area (through non_activeX NVMem device), the
		authentication procedure is started by writing 1 to
		this file. If everything goes well, the device is
		restarted with the new NVM firmware. If the image
		verification fails an error code is returned instead.

		When read holds status of the last authentication
		operation if an error occurred during the process.
		Format: %x.

What:		/sys/bus/thunderbolt/devices/<device>:<port>.<index>/nvm_version
Date:		Oct 2020
KernelVersion:	v5.9
Contact:	Mika Westerberg <mika.westerberg@linux.intel.com>
Description:	Holds retimer NVM version number. Format: %x.%x, major.minor.

What:		/sys/bus/thunderbolt/devices/<device>:<port>.<index>/vendor
Date:		Oct 2020
KernelVersion:	v5.9
Contact:	Mika Westerberg <mika.westerberg@linux.intel.com>
Description:	Retimer vendor identifier read from the hardware.

What:		/sys/bus/thunderbolt/devices/.../nvm_authenticate_on_disconnect
Date:		Oct 2020
KernelVersion:	v5.9
Contact:	Mario Limonciello <mario.limonciello@dell.com>
Description:	For supported devices, automatically authenticate the new Thunderbolt
		image when the device is disconnected from the host system.

		This file will accept writing values "1" or "2"
		- Writing "1" will flush the image to the storage
		area and prepare the device for authentication on disconnect.
		- Writing "2" will run some basic validation on the image
		and flush it to the storage area.
+6 −5
Original line number Diff line number Diff line
@@ -173,8 +173,8 @@ following ``udev`` rule::

  ACTION=="add", SUBSYSTEM=="thunderbolt", ATTRS{iommu_dma_protection}=="1", ATTR{authorized}=="0", ATTR{authorized}="1"

Upgrading NVM on Thunderbolt device or host
-------------------------------------------
Upgrading NVM on Thunderbolt device, host or retimer
----------------------------------------------------
Since most of the functionality is handled in firmware running on a
host controller or a device, it is important that the firmware can be
upgraded to the latest where possible bugs in it have been fixed.
@@ -185,9 +185,10 @@ for some machines:

  `Thunderbolt Updates <https://thunderbolttechnology.net/updates>`_

Before you upgrade firmware on a device or host, please make sure it is a
suitable upgrade. Failing to do that may render the device (or host) in a
state where it cannot be used properly anymore without special tools!
Before you upgrade firmware on a device, host or retimer, please make
sure it is a suitable upgrade. Failing to do that may render the device
in a state where it cannot be used properly anymore without special
tools!

Host NVM upgrade on Apple Macs is not supported.

+2 −2
Original line number Diff line number Diff line
@@ -866,8 +866,8 @@ static int tbnet_open(struct net_device *dev)
	eof_mask = BIT(TBIP_PDF_FRAME_END);

	ring = tb_ring_alloc_rx(xd->tb->nhi, -1, TBNET_RING_SIZE,
				RING_FLAG_FRAME | RING_FLAG_E2E, sof_mask,
				eof_mask, tbnet_start_poll, net);
				RING_FLAG_FRAME, sof_mask, eof_mask,
				tbnet_start_poll, net);
	if (!ring) {
		netdev_err(dev, "failed to allocate Rx ring\n");
		tb_ring_free(net->tx_ring.ring);
+7 −2
Original line number Diff line number Diff line
@@ -8,10 +8,15 @@ menuconfig USB4
	select CRYPTO_HASH
	select NVMEM
	help
	  USB4 and Thunderbolt driver. USB4 is the public speficiation
	  based on Thunderbolt 3 protocol. This driver is required if
	  USB4 and Thunderbolt driver. USB4 is the public specification
	  based on the 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.

	  To compile this driver a module, choose M here. The module will be
	  called thunderbolt.

config USB4_KUNIT_TEST
	bool "KUnit tests"
	depends on KUNIT=y
	depends on USB4=y
+3 −0
Original line number Diff line number Diff line
@@ -2,3 +2,6 @@
obj-${CONFIG_USB4} := thunderbolt.o
thunderbolt-objs := nhi.o nhi_ops.o ctl.o tb.o switch.o cap.o path.o tunnel.o eeprom.o
thunderbolt-objs += domain.o dma_port.o icm.o property.o xdomain.o lc.o tmu.o usb4.o
thunderbolt-objs += nvm.o retimer.o quirks.o

obj-${CONFIG_USB4_KUNIT_TEST} += test.o
Loading