]> Git Repo - J-linux.git/commitdiff
Merge tag 'thunderbolt-for-v5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel...
authorGreg Kroah-Hartman <[email protected]>
Tue, 9 Feb 2021 12:00:07 +0000 (13:00 +0100)
committerGreg Kroah-Hartman <[email protected]>
Tue, 9 Feb 2021 12:00:07 +0000 (13:00 +0100)
Mika writes:

thunderbolt: Changes for v5.12 merge window

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

  * Start lane initialization after sleep for Thunderbolt 3 compatible
    devices

  * Add support for de-authorizing PCIe tunnels (software based
    connection manager only)

  * Add support for new ACPI 6.4 USB4 _OSC

  * Allow disabling XDomain protocol

  * Add support for new SL5 security level

  * Clean up kernel-docs to pass W=1 builds

  * A couple of cleanups and minor fixes

All these have been in linux-next without reported issues.

* tag 'thunderbolt-for-v5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt: (27 commits)
  thunderbolt: Add support for native USB4 _OSC
  ACPI: Add support for native USB4 control _OSC
  ACPI: Execute platform _OSC also with query bit clear
  thunderbolt: Allow disabling XDomain protocol
  thunderbolt: Add support for PCIe tunneling disabled (SL5)
  thunderbolt: dma_test: Drop unnecessary include
  thunderbolt: Add clarifying comments about USB4 terms router and adapter
  thunderbolt: switch: Fix kernel-doc descriptions of non-static functions
  thunderbolt: nhi: Fix kernel-doc descriptions of non-static functions
  thunderbolt: path: Fix kernel-doc descriptions of non-static functions
  thunderbolt: eeprom: Fix kernel-doc descriptions of non-static functions
  thunderbolt: ctl: Fix kernel-doc descriptions of non-static functions
  thunderbolt: switch: Fix function name in the header
  thunderbolt: tunnel: Fix misspelling of 'receive_path'
  thunderbolt: icm: Fix a couple of formatting issues
  thunderbolt: switch: Demote a bunch of non-conformant kernel-doc headers
  thunderbolt: tb: Kernel-doc function headers should document their parameters
  thunderbolt: nhi: Demote some non-conformant kernel-doc headers
  thunderbolt: xdomain: Fix 'tb_unregister_service_driver()'s 'drv' param
  thunderbolt: eeprom: Demote non-conformant kernel-doc headers to standard comment blocks
  ...

1  2 
drivers/thunderbolt/acpi.c
drivers/thunderbolt/icm.c
include/linux/acpi.h

index b5442f979b4d0170950d9ded3d3dbe9e3066d6da,6ed00396130850a32cb265d71b1b90a02ce8b932..35fa17f7e59983f90ec022b9415f95d212542148
@@@ -56,7 -56,7 +56,7 @@@ static acpi_status tb_acpi_add_link(acp
         * managed with the xHCI and the SuperSpeed hub so we create the
         * link from xHCI instead.
         */
 -      while (!dev_is_pci(dev))
 +      while (dev && !dev_is_pci(dev))
                dev = dev->parent;
  
        if (!dev)
@@@ -115,3 -115,68 +115,68 @@@ void tb_acpi_add_links(struct tb_nhi *n
        if (ACPI_FAILURE(status))
                dev_warn(&nhi->pdev->dev, "failed to enumerate tunneled ports\n");
  }
+ /**
+  * tb_acpi_is_native() - Did the platform grant native TBT/USB4 control
+  *
+  * Returns %true if the platform granted OS native control over
+  * TBT/USB4. In this case software based connection manager can be used,
+  * otherwise there is firmware based connection manager running.
+  */
+ bool tb_acpi_is_native(void)
+ {
+       return osc_sb_native_usb4_support_confirmed &&
+              osc_sb_native_usb4_control;
+ }
+ /**
+  * tb_acpi_may_tunnel_usb3() - Is USB3 tunneling allowed by the platform
+  *
+  * When software based connection manager is used, this function
+  * returns %true if platform allows native USB3 tunneling.
+  */
+ bool tb_acpi_may_tunnel_usb3(void)
+ {
+       if (tb_acpi_is_native())
+               return osc_sb_native_usb4_control & OSC_USB_USB3_TUNNELING;
+       return true;
+ }
+ /**
+  * tb_acpi_may_tunnel_dp() - Is DisplayPort tunneling allowed by the platform
+  *
+  * When software based connection manager is used, this function
+  * returns %true if platform allows native DP tunneling.
+  */
+ bool tb_acpi_may_tunnel_dp(void)
+ {
+       if (tb_acpi_is_native())
+               return osc_sb_native_usb4_control & OSC_USB_DP_TUNNELING;
+       return true;
+ }
+ /**
+  * tb_acpi_may_tunnel_pcie() - Is PCIe tunneling allowed by the platform
+  *
+  * When software based connection manager is used, this function
+  * returns %true if platform allows native PCIe tunneling.
+  */
+ bool tb_acpi_may_tunnel_pcie(void)
+ {
+       if (tb_acpi_is_native())
+               return osc_sb_native_usb4_control & OSC_USB_PCIE_TUNNELING;
+       return true;
+ }
+ /**
+  * tb_acpi_is_xdomain_allowed() - Are XDomain connections allowed
+  *
+  * When software based connection manager is used, this function
+  * returns %true if platform allows XDomain connections.
+  */
+ bool tb_acpi_is_xdomain_allowed(void)
+ {
+       if (tb_acpi_is_native())
+               return osc_sb_native_usb4_control & OSC_USB_XDOMAIN;
+       return true;
+ }
index b8c4159bc32d0163c0454fc01dd761f860d0ed24,8cd7b3054d14f0b28d2b0eb69d6294865cb0c19e..f6f605d48371208efe8cca5f4ee5eefa4a0835db
@@@ -85,8 -85,8 +85,8 @@@ struct usb4_switch_nvm_auth 
   * @set_uuid: Set UUID for the root switch (optional)
   * @device_connected: Handle device connected ICM message
   * @device_disconnected: Handle device disconnected ICM message
-  * @xdomain_connected - Handle XDomain connected ICM message
-  * @xdomain_disconnected - Handle XDomain disconnected ICM message
+  * @xdomain_connected: Handle XDomain connected ICM message
+  * @xdomain_disconnected: Handle XDomain disconnected ICM message
   * @rtd3_veto: Handle RTD3 veto notification ICM message
   */
  struct icm {
@@@ -1701,10 -1701,12 +1701,12 @@@ static void icm_handle_notification(str
                        icm->device_disconnected(tb, n->pkg);
                        break;
                case ICM_EVENT_XDOMAIN_CONNECTED:
-                       icm->xdomain_connected(tb, n->pkg);
+                       if (tb_is_xdomain_enabled())
+                               icm->xdomain_connected(tb, n->pkg);
                        break;
                case ICM_EVENT_XDOMAIN_DISCONNECTED:
-                       icm->xdomain_disconnected(tb, n->pkg);
+                       if (tb_is_xdomain_enabled())
+                               icm->xdomain_disconnected(tb, n->pkg);
                        break;
                case ICM_EVENT_RTD3_VETO:
                        icm->rtd3_veto(tb, n->pkg);
@@@ -2316,7 -2318,7 +2318,7 @@@ static int icm_usb4_switch_nvm_authenti
  
        if (auth && auth->reply.route_hi == sw->config.route_hi &&
            auth->reply.route_lo == sw->config.route_lo) {
 -              tb_dbg(tb, "NVM_AUTH found for %llx flags 0x%#x status %#x\n",
 +              tb_dbg(tb, "NVM_AUTH found for %llx flags %#x status %#x\n",
                       tb_route(sw), auth->reply.hdr.flags, auth->reply.status);
                if (auth->reply.hdr.flags & ICM_FLAGS_ERROR)
                        ret = -EIO;
diff --combined include/linux/acpi.h
index 053bf05fb1f7606e23fb7949c8f0132a82a9c10e,ac68c2d4e393eb2324a5829eac1dbdcd8fb48d24..68eef9e67dcbb9d7196746c697ebc4bce8367764
@@@ -546,9 -546,19 +546,19 @@@ acpi_status acpi_run_osc(acpi_handle ha
  #define OSC_SB_OSLPI_SUPPORT                  0x00000100
  #define OSC_SB_CPC_DIVERSE_HIGH_SUPPORT               0x00001000
  #define OSC_SB_GENERIC_INITIATOR_SUPPORT      0x00002000
+ #define OSC_SB_NATIVE_USB4_SUPPORT            0x00040000
  
  extern bool osc_sb_apei_support_acked;
  extern bool osc_pc_lpi_support_confirmed;
+ extern bool osc_sb_native_usb4_support_confirmed;
+ /* USB4 Capabilities */
+ #define OSC_USB_USB3_TUNNELING                        0x00000001
+ #define OSC_USB_DP_TUNNELING                  0x00000002
+ #define OSC_USB_PCIE_TUNNELING                        0x00000004
+ #define OSC_USB_XDOMAIN                               0x00000008
+ extern u32 osc_sb_native_usb4_control;
  
  /* PCI Host Bridge _OSC: Capabilities DWORD 2: Support Field */
  #define OSC_PCI_EXT_CONFIG_SUPPORT            0x00000001
@@@ -885,13 -895,6 +895,13 @@@ static inline int acpi_device_modalias(
        return -ENODEV;
  }
  
 +static inline struct platform_device *
 +acpi_create_platform_device(struct acpi_device *adev,
 +                          struct property_entry *properties)
 +{
 +      return NULL;
 +}
 +
  static inline bool acpi_dma_supported(struct acpi_device *adev)
  {
        return false;
This page took 0.06183 seconds and 4 git commands to generate.