summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMika Westerberg <mika.westerberg@linux.intel.com>2020-10-05 17:55:24 +0200
committerMika Westerberg <mika.westerberg@linux.intel.com>2020-11-05 11:32:53 +0100
commitf8fa2c2e63c76e5d73526f38bdde59fdcfbea166 (patch)
tree8e6b3bb3b4e27c564b91abb03f8e88ad9f3266c0 /drivers
parentthunderbolt: Add uaccess dependency to debugfs interface (diff)
downloadlinux-f8fa2c2e63c76e5d73526f38bdde59fdcfbea166.tar.xz
linux-f8fa2c2e63c76e5d73526f38bdde59fdcfbea166.zip
thunderbolt: Only configure USB4 wake for lane 0 adapters
Only USB4 lane 0 adapter has the USB4 port capability for wakes so only program wakes on such adapters. Fixes: b2911a593a70 ("thunderbolt: Enable wakes from system suspend") Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/thunderbolt/usb4.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/thunderbolt/usb4.c b/drivers/thunderbolt/usb4.c
index 40f13579a3fe..f2583b4053e4 100644
--- a/drivers/thunderbolt/usb4.c
+++ b/drivers/thunderbolt/usb4.c
@@ -421,8 +421,12 @@ int usb4_switch_set_wake(struct tb_switch *sw, unsigned int flags)
* upstream USB4 port.
*/
tb_switch_for_each_port(sw, port) {
+ if (!tb_port_is_null(port))
+ continue;
if (!route && tb_is_upstream_port(port))
continue;
+ if (!port->cap_usb4)
+ continue;
ret = tb_port_read(port, &val, TB_CFG_PORT,
port->cap_usb4 + PORT_CS_19, 1);