Commit 780607b9 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull USB and Thunderbolt updates from Greg KH:
 "Here is the big set of USB and Thunderbolt driver changes for
  5.12-rc1.

  It's been an active set of development in these subsystems for the
  past few months:

   - loads of typec features added for new hardware

   - xhci features and bugfixes

   - dwc3 features added for more hardware support

   - dwc2 fixes and new hardware support

   - cdns3 driver updates for more hardware support

   - gadget driver cleanups and minor fixes

   - usb-serial fixes, new driver, and more devices supported

   - thunderbolt feature additions for new hardware

   - lots of other tiny fixups and additions

  The chrome driver changes are in here as well, as they depended on
  some of the typec changes, and the maintainer acked them.

  All of these have been in linux-next for a while with no reported
  issues"

* tag 'usb-5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (300 commits)
  dt-bindings: usb: mediatek: musb: add mt8516 compatbile
  dt-bindings: usb: mtk-xhci: add compatible for mt2701 and mt7623
  dt-bindings: usb: mtk-xhci: add optional assigned clock properties
  Documentation: connector: Update the description of sink-vdos
  usb: misc: usb3503: Fix logic in usb3503_init()
  dt-bindings: usb: usb-device: fix typo in required properties
  usb: Replace lkml.org links with lore
  dt-bindings: usb: dwc3: add description for rk3328
  dt-bindings: usb: convert rockchip,dwc3.txt to yaml
  usb: quirks: add quirk to start video capture on ELMO L-12F document camera reliable
  USB: quirks: sort quirk entries
  USB: serial: drop bogus to_usb_serial_port() checks
  USB: serial: make remove callback return void
  USB: serial: drop if with an always false condition
  usb: gadget: Assign boolean values to a bool variable
  usb: typec: tcpm: Get Sink VDO from fwnode
  dt-bindings: connector: Add SVDM VDO properties
  usb: typec: displayport: Fill the negotiated SVDM Version in the header
  usb: typec: ucsi: Determine common SVDM Version
  usb: typec: tcpm: Determine common SVDM Version
  ...
parents e4286926 b5a12546
Loading
Loading
Loading
Loading
+18 −4
Original line number Diff line number Diff line
@@ -49,6 +49,15 @@ Description: Holds a comma separated list of device unique_ids that
		If a device is authorized automatically during boot its
		boot attribute is set to 1.

What: /sys/bus/thunderbolt/devices/.../domainX/deauthorization
Date:		May 2021
KernelVersion:	5.12
Contact:	Mika Westerberg <mika.westerberg@linux.intel.com>
Description:	This attribute tells whether the system supports
		de-authorization of devices. Value of 1 means user can
		de-authorize PCIe tunnel by writing 0 to authorized
		attribute under each device.

What: /sys/bus/thunderbolt/devices/.../domainX/iommu_dma_protection
Date:		Mar 2019
KernelVersion:	4.21
@@ -76,6 +85,8 @@ Description: This attribute holds current Thunderbolt security level
		usbonly  Automatically tunnel USB controller of the
			 connected Thunderbolt dock (and Display Port). All
			 PCIe links downstream of the dock are removed.
		nopcie   USB4 system where PCIe tunneling is disabled from
			 the BIOS.
		=======  ==================================================

What: /sys/bus/thunderbolt/devices/.../authorized
@@ -84,22 +95,25 @@ KernelVersion: 4.13
Contact:	thunderbolt-software@lists.01.org
Description:	This attribute is used to authorize Thunderbolt devices
		after they have been connected. If the device is not
		authorized, no devices such as PCIe and Display port are
		available to the system.
		authorized, no PCIe devices are available to the system.

		Contents of this attribute will be 0 when the device is not
		yet authorized.

		Possible values are supported:

		==  ===========================================
		==  ===================================================
		0   The device will be de-authorized (only supported if
		    deauthorization attribute under domain contains 1)
		1   The device will be authorized and connected
		==  ===========================================
		==  ===================================================

		When key attribute contains 32 byte hex string the possible
		values are:

		==  ========================================================
		0   The device will be de-authorized (only supported if
		    deauthorization attribute under domain contains 1)
		1   The 32 byte hex string is added to the device NVM and
		    the device is authorized.
		2   Send a challenge based on the 32 byte hex string. If the
+19 −1
Original line number Diff line number Diff line
@@ -105,7 +105,25 @@ Date: April 2017
Contact:	Heikki Krogerus <heikki.krogerus@linux.intel.com>
Description:
		Revision number of the supported USB Power Delivery
		specification, or 0 when USB Power Delivery is not supported.
		specification, or 0.0 when USB Power Delivery is not supported.

		Example values:
		- "2.0": USB Power Delivery Release 2.0
		- "3.0": USB Power Delivery Release 3.0
		- "3.1": USB Power Delivery Release 3.1

What:		/sys/class/typec/<port>-{partner|cable}/usb_power_delivery_revision
Date:		January 2021
Contact:	Benson Leung <bleung@chromium.org>
Description:
		Revision number of the supported USB Power Delivery
		specification of the port partner or cable, or 0.0 when USB
		Power Delivery is not supported.

		Example values:
		- "2.0": USB Power Delivery Release 2.0
		- "3.0": USB Power Delivery Release 3.0
		- "3.1": USB Power Delivery Release 3.1

What:		/sys/class/typec/<port>/usb_typec_revision
Date:		April 2017
+23 −0
Original line number Diff line number Diff line
@@ -47,6 +47,9 @@ be DMA masters and thus read contents of the host memory without CPU and OS
knowing about it. There are ways to prevent this by setting up an IOMMU but
it is not always available for various reasons.

Some USB4 systems have a BIOS setting to disable PCIe tunneling. This is
treated as another security level (nopcie).

The security levels are as follows:

  none
@@ -77,6 +80,10 @@ The security levels are as follows:
    Display Port in a dock. All PCIe links downstream of the dock are
    removed.

  nopcie
    PCIe tunneling is disabled/forbidden from the BIOS. Available in some
    USB4 systems.

The current security level can be read from
``/sys/bus/thunderbolt/devices/domainX/security`` where ``domainX`` is
the Thunderbolt domain the host controller manages. There is typically
@@ -153,6 +160,22 @@ If the user still wants to connect the device they can either approve
the device without a key or write a new key and write 1 to the
``authorized`` file to get the new key stored on the device NVM.

De-authorizing devices
----------------------
It is possible to de-authorize devices by writing ``0`` to their
``authorized`` attribute. This requires support from the connection
manager implementation and can be checked by reading domain
``deauthorization`` attribute. If it reads ``1`` then the feature is
supported.

When a device is de-authorized the PCIe tunnel from the parent device
PCIe downstream (or root) port to the device PCIe upstream port is torn
down. This is essentially the same thing as PCIe hot-remove and the PCIe
toplogy in question will not be accessible anymore until the device is
authorized again. If there is storage such as NVMe or similar involved,
there is a risk for data loss if the filesystem on that storage is not
properly shut down. You have been warned!

DMA protection utilizing IOMMU
------------------------------
Recent systems from 2018 and forward with Thunderbolt ports may natively
+12 −0
Original line number Diff line number Diff line
@@ -137,6 +137,18 @@ properties:
    maxItems: 7
    $ref: /schemas/types.yaml#/definitions/uint32-array

  sink-vdos:
    description: An array of u32 with each entry, a Vendor Defined Message Object (VDO),
      providing additional information corresponding to the product, the detailed bit
      definitions and the order of each VDO can be found in
      "USB Power Delivery Specification Revision 3.0, Version 2.0 + ECNs 2020-12-10"
      chapter 6.4.4.3.1 Discover Identity. User can specify the VDO array via
      VDO_IDH/_CERT/_PRODUCT/_UFP/_DFP/_PCABLE/_ACABLE(1/2)/_VPD() defined in
      dt-bindings/usb/pd.h.
    minItems: 3
    maxItems: 6
    $ref: /schemas/types.yaml#/definitions/uint32-array

  op-sink-microwatt:
    description: Sink required operating power in microwatt, if source can't
      offer the power, Capability Mismatch is set. Required for power sink and
+1 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@ Generic Bluetooth controller over USB (btusb driver)
Required properties:

  - compatible : should comply with the format "usbVID,PID" specified in
		 Documentation/devicetree/bindings/usb/usb-device.txt
		 Documentation/devicetree/bindings/usb/usb-device.yaml
		 At the time of writing, the only OF supported devices
		 (more may be added later) are:

Loading