Skip to content

Commit

Permalink
Merge tag 'thunderbolt-for-v5.5' of git://git.kernel.org/pub/scm/linu…
Browse files Browse the repository at this point in the history
…x/kernel/git/westeri/thunderbolt into char-misc-next

Mika writes:

thunderbolt: Changes for v5.5 merge window

This adds Thunderbolt 3 support for the software connection manager. It
is currently only used in Apple systems. Previously the driver started
the firmware connection manager on those but it is not necessary anymore
with these patches (we still leave user an option to start the firmware
in case there are problems with the software connection manager).

This includes:

  - Expose 'generation' attribute under each device in sysfs
  - Converting register names to follow the USB4 spec.
  - Lane bonding support
  - Expose link speed and width in sysfs
  - Display Port handshake needed for Titan Ridge devices
  - Display Port pairing and resource management
  - Display Port bandwidth management

* tag 'thunderbolt-for-v5.5' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt: (21 commits)
  thunderbolt: Do not start firmware unless asked by the user
  thunderbolt: Add bandwidth management for Display Port tunnels
  thunderbolt: Add Display Port adapter pairing and resource management
  thunderbolt: Add Display Port CM handshake for Titan Ridge devices
  thunderbolt: Add downstream PCIe port mappings for Alpine and Titan Ridge
  thunderbolt: Expand controller name in tb_switch_is_xy()
  thunderbolt: Add default linking between lane adapters if not provided by DROM
  thunderbolt: Add support for lane bonding
  thunderbolt: Refactor add_switch() into two functions
  thunderbolt: Add helper macro to iterate over switch ports
  thunderbolt: Make tb_sw_write() take const parameter
  thunderbolt: Convert DP adapter register names to follow the USB4 spec
  thunderbolt: Convert PCIe adapter register names to follow the USB4 spec
  thunderbolt: Convert basic adapter register names to follow the USB4 spec
  thunderbolt: Log error if adding switch fails
  thunderbolt: Log switch route string on config read/write timeout
  thunderbolt: Introduce tb_switch_is_icm()
  thunderbolt: Add 'generation' attribute for devices
  thunderbolt: Drop unnecessary read when writing LC command in Ice Lake
  thunderbolt: Fix lockdep circular locking depedency warning
  ...
  • Loading branch information
gregkh committed Nov 7, 2019
2 parents 52f6efd + 354a7a7 commit 4180468
Show file tree
Hide file tree
Showing 16 changed files with 1,631 additions and 276 deletions.
36 changes: 36 additions & 0 deletions Documentation/ABI/testing/sysfs-bus-thunderbolt
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@ Contact: [email protected]
Description: This attribute contains 1 if Thunderbolt device was already
authorized on boot and 0 otherwise.

What: /sys/bus/thunderbolt/devices/.../generation
Date: Jan 2020
KernelVersion: 5.5
Contact: Christian Kellner <[email protected]>
Description: This attribute contains the generation of the Thunderbolt
controller associated with the device. It will contain 4
for USB4.

What: /sys/bus/thunderbolt/devices/.../key
Date: Sep 2017
KernelVersion: 4.13
Expand All @@ -104,6 +112,34 @@ Contact: [email protected]
Description: This attribute contains name of this device extracted from
the device DROM.

What: /sys/bus/thunderbolt/devices/.../rx_speed
Date: Jan 2020
KernelVersion: 5.5
Contact: Mika Westerberg <[email protected]>
Description: This attribute reports the device RX speed per lane.
All RX lanes run at the same speed.

What: /sys/bus/thunderbolt/devices/.../rx_lanes
Date: Jan 2020
KernelVersion: 5.5
Contact: Mika Westerberg <[email protected]>
Description: This attribute reports number of RX lanes the device is
using simultaneusly through its upstream port.

What: /sys/bus/thunderbolt/devices/.../tx_speed
Date: Jan 2020
KernelVersion: 5.5
Contact: Mika Westerberg <[email protected]>
Description: This attribute reports the TX speed per lane.
All TX lanes run at the same speed.

What: /sys/bus/thunderbolt/devices/.../tx_lanes
Date: Jan 2020
KernelVersion: 5.5
Contact: Mika Westerberg <[email protected]>
Description: This attribute reports number of TX lanes the device is
using simultaneusly through its upstream port.

What: /sys/bus/thunderbolt/devices/.../vendor
Date: Sep 2017
KernelVersion: 4.13
Expand Down
6 changes: 3 additions & 3 deletions drivers/thunderbolt/cap.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ static int tb_port_enable_tmu(struct tb_port *port, bool enable)
* Legacy devices need to have TMU access enabled before port
* space can be fully accessed.
*/
if (tb_switch_is_lr(sw))
if (tb_switch_is_light_ridge(sw))
offset = 0x26;
else if (tb_switch_is_er(sw))
else if (tb_switch_is_eagle_ridge(sw))
offset = 0x2a;
else
return 0;
Expand All @@ -60,7 +60,7 @@ static void tb_port_dummy_read(struct tb_port *port)
* reading stale data on next read perform one dummy read after
* port capabilities are walked.
*/
if (tb_switch_is_lr(port->sw)) {
if (tb_switch_is_light_ridge(port->sw)) {
u32 dummy;

tb_port_read(port, &dummy, TB_CFG_PORT, 0, 1);
Expand Down
8 changes: 4 additions & 4 deletions drivers/thunderbolt/ctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -962,8 +962,8 @@ int tb_cfg_read(struct tb_ctl *ctl, void *buffer, u64 route, u32 port,
return tb_cfg_get_error(ctl, space, &res);

case -ETIMEDOUT:
tb_ctl_warn(ctl, "timeout reading config space %u from %#x\n",
space, offset);
tb_ctl_warn(ctl, "%llx: timeout reading config space %u from %#x\n",
route, space, offset);
break;

default:
Expand All @@ -988,8 +988,8 @@ int tb_cfg_write(struct tb_ctl *ctl, const void *buffer, u64 route, u32 port,
return tb_cfg_get_error(ctl, space, &res);

case -ETIMEDOUT:
tb_ctl_warn(ctl, "timeout writing config space %u to %#x\n",
space, offset);
tb_ctl_warn(ctl, "%llx: timeout writing config space %u to %#x\n",
route, space, offset);
break;

default:
Expand Down
11 changes: 0 additions & 11 deletions drivers/thunderbolt/eeprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -514,17 +514,6 @@ int tb_drom_read(struct tb_switch *sw)
* no entries). Hardcode the configuration here.
*/
tb_drom_read_uid_only(sw, &sw->uid);

sw->ports[1].link_nr = 0;
sw->ports[2].link_nr = 1;
sw->ports[1].dual_link_port = &sw->ports[2];
sw->ports[2].dual_link_port = &sw->ports[1];

sw->ports[3].link_nr = 0;
sw->ports[4].link_nr = 1;
sw->ports[3].dual_link_port = &sw->ports[4];
sw->ports[4].dual_link_port = &sw->ports[3];

return 0;
}

Expand Down
Loading

0 comments on commit 4180468

Please sign in to comment.