Skip to content

Commit 3d41137

Browse files
committed
Merge tag 'thunderbolt-for-v5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt into usb-next
Mika writes: thunderbolt: Changes for v5.11 merge window This includes following Thunderbolt/USB4 changes for v5.11 merge window: * DMA traffic test driver * USB4 router NVM upgrade improvements * USB4 router operations proxy implementation available in the recent Intel Connection Manager firmwares * Support for Intel Maple Ridge discrete Thunderbolt 4 controller * A couple of cleanups and minor improvements. * tag 'thunderbolt-for-v5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt: (22 commits) thunderbolt: Add support for Intel Maple Ridge thunderbolt: Add USB4 router operation proxy for firmware connection manager thunderbolt: Move constants for USB4 router operations to tb_regs.h thunderbolt: Add connection manager specific hooks for USB4 router operations thunderbolt: Pass TX and RX data directly to usb4_switch_op() thunderbolt: Pass metadata directly to usb4_switch_op() thunderbolt: Perform USB4 router NVM upgrade in two phases thunderbolt: Return -ENOTCONN when ERR_CONN is received thunderbolt: Keep the parent runtime resumed for a while on device disconnect thunderbolt: Log adapter numbers in decimal in path activation/deactivation thunderbolt: Log which connection manager implementation is used thunderbolt: Move max_boot_acl field to correct place in struct icm MAINTAINERS: Add Isaac as maintainer of Thunderbolt DMA traffic test driver thunderbolt: Add DMA traffic test driver thunderbolt: Add support for end-to-end flow control thunderbolt: Make it possible to allocate one directional DMA tunnel thunderbolt: Create debugfs directory automatically for services thunderbolt: Add functions for enabling and disabling lane bonding on XDomain thunderbolt: Add link_speed and link_width to XDomain thunderbolt: Create XDomain devices for loops back to the host ...
2 parents 08a02f9 + db0746e commit 3d41137

File tree

21 files changed

+1553
-164
lines changed

21 files changed

+1553
-164
lines changed

Documentation/ABI/testing/sysfs-bus-thunderbolt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
What: /sys/bus/thunderbolt/devices/<xdomain>/rx_speed
2+
Date: Feb 2021
3+
KernelVersion: 5.11
4+
Contact: Isaac Hazan <[email protected]>
5+
Description: This attribute reports the XDomain RX speed per lane.
6+
All RX lanes run at the same speed.
7+
8+
What: /sys/bus/thunderbolt/devices/<xdomain>/rx_lanes
9+
Date: Feb 2021
10+
KernelVersion: 5.11
11+
Contact: Isaac Hazan <[email protected]>
12+
Description: This attribute reports the number of RX lanes the XDomain
13+
is using simultaneously through its upstream port.
14+
15+
What: /sys/bus/thunderbolt/devices/<xdomain>/tx_speed
16+
Date: Feb 2021
17+
KernelVersion: 5.11
18+
Contact: Isaac Hazan <[email protected]>
19+
Description: This attribute reports the XDomain TX speed per lane.
20+
All TX lanes run at the same speed.
21+
22+
What: /sys/bus/thunderbolt/devices/<xdomain>/tx_lanes
23+
Date: Feb 2021
24+
KernelVersion: 5.11
25+
Contact: Isaac Hazan <[email protected]>
26+
Description: This attribute reports number of TX lanes the XDomain
27+
is using simultaneously through its upstream port.
28+
129
What: /sys/bus/thunderbolt/devices/.../domainX/boot_acl
230
Date: Jun 2018
331
KernelVersion: 4.17

MAINTAINERS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17372,6 +17372,12 @@ W: http://thinkwiki.org/wiki/Ibm-acpi
1737217372
T: git git://repo.or.cz/linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git
1737317373
F: drivers/platform/x86/thinkpad_acpi.c
1737417374

17375+
THUNDERBOLT DMA TRAFFIC TEST DRIVER
17376+
M: Isaac Hazan <[email protected]>
17377+
17378+
S: Maintained
17379+
F: drivers/thunderbolt/dma_test.c
17380+
1737517381
THUNDERBOLT DRIVER
1737617382
M: Andreas Noever <[email protected]>
1737717383
M: Michael Jamet <[email protected]>

drivers/net/thunderbolt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,7 @@ static int tbnet_open(struct net_device *dev)
866866
eof_mask = BIT(TBIP_PDF_FRAME_END);
867867

868868
ring = tb_ring_alloc_rx(xd->tb->nhi, -1, TBNET_RING_SIZE,
869-
RING_FLAG_FRAME, sof_mask, eof_mask,
869+
RING_FLAG_FRAME, 0, sof_mask, eof_mask,
870870
tbnet_start_poll, net);
871871
if (!ring) {
872872
netdev_err(dev, "failed to allocate Rx ring\n");

drivers/thunderbolt/Kconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,17 @@ config USB4_KUNIT_TEST
3131
bool "KUnit tests"
3232
depends on KUNIT=y
3333

34+
config USB4_DMA_TEST
35+
tristate "DMA traffic test driver"
36+
depends on DEBUG_FS
37+
help
38+
This allows sending and receiving DMA traffic through loopback
39+
connection. Loopback connection can be done by either special
40+
dongle that has TX/RX lines crossed, or by simply connecting a
41+
cable back to the host. Only enable this if you know what you
42+
are doing. Normal users and distro kernels should say N here.
43+
44+
To compile this driver a module, choose M here. The module will be
45+
called thunderbolt_dma_test.
46+
3447
endif # USB4

drivers/thunderbolt/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ thunderbolt-objs += nvm.o retimer.o quirks.o
77
thunderbolt-${CONFIG_ACPI} += acpi.o
88
thunderbolt-$(CONFIG_DEBUG_FS) += debugfs.o
99
thunderbolt-${CONFIG_USB4_KUNIT_TEST} += test.o
10+
11+
thunderbolt_dma_test-${CONFIG_USB4_DMA_TEST} += dma_test.o
12+
obj-$(CONFIG_USB4_DMA_TEST) += thunderbolt_dma_test.o

drivers/thunderbolt/ctl.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -628,8 +628,8 @@ struct tb_ctl *tb_ctl_alloc(struct tb_nhi *nhi, event_cb cb, void *cb_data)
628628
if (!ctl->tx)
629629
goto err;
630630

631-
ctl->rx = tb_ring_alloc_rx(nhi, 0, 10, RING_FLAG_NO_SUSPEND, 0xffff,
632-
0xffff, NULL, NULL);
631+
ctl->rx = tb_ring_alloc_rx(nhi, 0, 10, RING_FLAG_NO_SUSPEND, 0, 0xffff,
632+
0xffff, NULL, NULL);
633633
if (!ctl->rx)
634634
goto err;
635635

@@ -962,6 +962,9 @@ static int tb_cfg_get_error(struct tb_ctl *ctl, enum tb_cfg_space space,
962962

963963
if (res->tb_error == TB_CFG_ERROR_LOCK)
964964
return -EACCES;
965+
else if (res->tb_error == TB_CFG_ERROR_PORT_NOT_CONNECTED)
966+
return -ENOTCONN;
967+
965968
return -EIO;
966969
}
967970

drivers/thunderbolt/debugfs.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,30 @@ void tb_switch_debugfs_remove(struct tb_switch *sw)
691691
debugfs_remove_recursive(sw->debugfs_dir);
692692
}
693693

694+
/**
695+
* tb_service_debugfs_init() - Add debugfs directory for service
696+
* @svc: Thunderbolt service pointer
697+
*
698+
* Adds debugfs directory for service.
699+
*/
700+
void tb_service_debugfs_init(struct tb_service *svc)
701+
{
702+
svc->debugfs_dir = debugfs_create_dir(dev_name(&svc->dev),
703+
tb_debugfs_root);
704+
}
705+
706+
/**
707+
* tb_service_debugfs_remove() - Remove service debugfs directory
708+
* @svc: Thunderbolt service pointer
709+
*
710+
* Removes the previously created debugfs directory for @svc.
711+
*/
712+
void tb_service_debugfs_remove(struct tb_service *svc)
713+
{
714+
debugfs_remove_recursive(svc->debugfs_dir);
715+
svc->debugfs_dir = NULL;
716+
}
717+
694718
void tb_debugfs_init(void)
695719
{
696720
tb_debugfs_root = debugfs_create_dir("thunderbolt", NULL);

0 commit comments

Comments
 (0)