From: Mika Westerberg Date: Mon, 5 Oct 2020 15:55:24 +0000 (+0300) Subject: thunderbolt: Only configure USB4 wake for lane 0 adapters X-Git-Tag: v5.10.7~1158^2~5^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f8fa2c2e63c76e5d73526f38bdde59fdcfbea166;p=platform%2Fkernel%2Flinux-rpi.git 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 --- diff --git a/drivers/thunderbolt/usb4.c b/drivers/thunderbolt/usb4.c index 40f1357..f2583b4 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);