1. 18 12月, 2019 2 次提交
  2. 02 11月, 2019 5 次提交
    • M
      thunderbolt: Add bandwidth management for Display Port tunnels · a11b88ad
      Mika Westerberg 提交于
      Titan Ridge supports Display Port 1.4 which adds HBR3 (High Bit Rate)
      rates that may be up to 8.1 Gb/s over 4 lanes. This translates to
      effective data bandwidth of 25.92 Gb/s (as 8/10 encoding is removed by
      the DP adapters when going over Thunderbolt fabric). If another high
      rate monitor is connected we may need to reduce the bandwidth it
      consumes so that it fits into the total 40 Gb/s available on the
      Thunderbolt fabric.
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      a11b88ad
    • M
      thunderbolt: Add Display Port adapter pairing and resource management · 8afe909b
      Mika Westerberg 提交于
      To perform proper Display Port tunneling for Thunderbolt 3 devices we
      need to allocate DP resources for DP IN port before they can be used.
      The reason for this is that the user can also connect a monitor directly
      to the Type-C ports in which case the Thunderbolt controller acts as
      re-driver for Display Port (no tunneling takes place) taking the DP
      sinks away from the connection manager. This allocation is done using
      special sink allocation registers available through the link controller.
      
      We can pair DP IN to DP OUT only if
      
       * DP IN has sink allocated via link controller
       * DP OUT port receives hotplug event
      
      For DP IN adapters (only for the host router) we first query whether
      there is DP resource available (it may be the previous instance of the
      driver for example already allocated it) and if it is we add it to the
      list. We then update the list when after each plug/unplug event to a DP
      IN/OUT adapter. Each time the list is updated we try to find additional
      DP IN <-> DP OUT pairs for tunnel establishment. This strategy also
      makes it possible to establish another tunnel in case there are 3
      monitors connected and one gets unplugged releasing the DP IN adapter
      for the new tunnel.
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      8afe909b
    • M
      thunderbolt: Add downstream PCIe port mappings for Alpine and Titan Ridge · 7bffd97e
      Mika Westerberg 提交于
      In order to keep PCIe hierarchies consistent across hotplugs, add
      hard-coded PCIe downstream port to Thunderbolt port for Alpine Ridge and
      Titan Ridge as well.
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      7bffd97e
    • M
      thunderbolt: Expand controller name in tb_switch_is_xy() · 17a8f815
      Mika Westerberg 提交于
      For a casual reader tb_switch_is_cr() does not tell much so instead
      spell out the full controller name in the function name. For example
      tb_switch_is_cr() becomes tb_switch_is_cactus_ridge() which is easier
      to understand.
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      17a8f815
    • M
      thunderbolt: Add support for lane bonding · 91c0c120
      Mika Westerberg 提交于
      Lane bonding allows aggregating two 10/20 Gb/s (depending on the
      generation) lanes into a single 20/40 Gb/s bonded link. This allows
      sharing the full bandwidth more efficiently. In order to establish lane
      bonding we need to check that lane bonding is possible through link
      controller and that both ends of the link actually supports 2x widths.
      This also means that all the paths should be established through the
      primary port so update tb_path_alloc() to handle this as well.
      
      Lane bonding is supported starting from Falcon Ridge (2nd generation)
      controllers.
      
      We also expose the current speed and number of lanes under each device
      except the host router following similar attribute naming than USB bus.
      Expose speed and number of lanes for both directions to allow possibility
      of asymmetric link in the future.
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      91c0c120
  3. 01 11月, 2019 3 次提交
  4. 12 6月, 2019 1 次提交
    • M
      thunderbolt: Make sure device runtime resume completes before taking domain lock · 4f7c2e0d
      Mika Westerberg 提交于
      When a device is authorized from userspace by writing to authorized
      attribute we first take the domain lock and then runtime resume the
      device in question. There are two issues with this.
      
      First is that the device connected notifications are blocked during this
      time which means we get them only after the authorization operation is
      complete. Because of this the authorization needed flag from the
      firmware notification is not reflecting the real authorization status
      anymore. So what happens is that the "authorized" keeps returning 0 even
      if the device was already authorized properly.
      
      Second issue is that each time the controller is runtime resumed the
      connection_id field of device connected notification may be different
      than in the previous resume. We need to use the latest connection_id
      otherwise the firmware rejects the authorization command.
      
      Fix these by moving runtime resume operations to happen before the
      domain lock is taken, and waiting for the updated device connected
      notification from the firmware before we allow runtime resume of a
      device to complete.
      
      While there add missing locking to tb_switch_nvm_read().
      
      Fixes: 09f11b6c ("thunderbolt: Take domain lock in switch sysfs attribute callbacks")
      Reported-by: NPengfei Xu <pengfei.xu@intel.com>
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      4f7c2e0d
  5. 25 4月, 2019 1 次提交
  6. 18 4月, 2019 23 次提交
  7. 03 10月, 2018 2 次提交
  8. 25 7月, 2018 1 次提交
    • M
      thunderbolt: Add support for runtime PM · 2d8ff0b5
      Mika Westerberg 提交于
      When Thunderbolt host controller is set to RTD3 mode (Runtime D3) it is
      present all the time. Because of this it is important to runtime suspend
      the controller whenever possible. In case of ICM we have following rules
      which all needs to be true before the host controller can be put to D3:
      
        - The controller firmware reports to support RTD3
        - All the connected devices announce support for RTD3
        - There is no active XDomain connection
      
      Implement this using standard Linux runtime PM APIs so that when all the
      children devices are runtime suspended, the Thunderbolt host controller
      PCI device is runtime suspended as well. The ICM firmware then starts
      powering down power domains towards RTD3 but it can prevent this if it
      detects that there is an active Display Port stream (this is not visible
      to the software, though).
      
      The Thunderbolt host controller will be runtime resumed either when
      there is a remote wake event (device is connected or disconnected), or
      when there is access from userspace that requires hardware access.
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2d8ff0b5
  9. 09 3月, 2018 2 次提交
    • M
      thunderbolt: Add support for preboot ACL · 9aaa3b8b
      Mika Westerberg 提交于
      Preboot ACL is a mechanism that allows connecting Thunderbolt devices
      boot time in more secure way than the legacy Thunderbolt boot support.
      As with the legacy boot option, this also needs to be enabled from the
      BIOS before booting is allowed. Difference to the legacy mode is that
      the userspace software explicitly adds device UUIDs by sending a special
      message to the ICM firmware. Only the devices listed in the boot ACL are
      connected automatically during the boot. This works in both "user" and
      "secure" security levels.
      
      We implement this in Linux by exposing a new sysfs attribute (boot_acl)
      below each Thunderbolt domain. The userspace software can then update
      the full list as needed.
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com>
      9aaa3b8b
    • Y
      thunderbolt: Add 'boot' attribute for devices · 14862ee3
      Yehezkel Bernat 提交于
      In various cases, Thunderbolt device can be connected by ICM on boot
      without waiting for approval from user. Most cases are related to
      OEM-specific BIOS configurations. This information is interesting for
      user-space as if the device isn't in SW ACL, it may create a friction in
      the user experience where the device is automatically authorized if it's
      connected on boot but requires an explicit user action if connected
      after OS is up. User-space can use this information to suggest adding
      the device to SW ACL for auto-authorization on later connections.
      Signed-off-by: NYehezkel Bernat <yehezkel.bernat@intel.com>
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com>
      14862ee3