thunderbolt: Use the actual buffer in tb_async_error()
Subsystems (2)
PATCH 1/2 thunderbolt: Use the actual buffer in tb_async_error()
The received notification packet is held in pkg->buffer and not in pkg itself. Fix this by using the correct buffer.
Fixes 81a54b5e1986 ("thunderbolt: Let the connection manager handle all notifications")
Signed-off-by Mika Westerberg <[email protected]>
--- drivers/thunderbolt/ctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thunderbolt/ctl.c +1 -1
@@ -407,7 +407,7 @@ static void tb_ctl_rx_submit(struct ctl_pkg *pkg)static int tb_async_error (const struct ctl_pkg *pkg) { -const struct cfg_error_pkg *error = (const struct cfg_error_pkg *)pkg; +const struct cfg_error_pkg *error = pkg->buffer;if (pkg->frame.eof !=TB_CFG_PKG_ERROR )return false;
Signature · 1 line
2.35.1
PATCH 2/2 thunderbolt: Check router generation before connecting xHCI
Only Thunderbolt 3 routers need the xHCI connection flow. This also ensures the router actually has both lane adapters (1 and 3). While there move declaration of the boolean variables inside the block where they are being used.
Fixes 30a4eca69b76 ("thunderbolt: Add internal xHCI connect flows for Thunderbolt 3 devices")
Signed-off-by Mika Westerberg <[email protected]>
--- drivers/thunderbolt/switch.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/thunderbolt/switch.c +5 -1
@@ -3786,14 +3786,18 @@ int tb_switch_pcie_l1_enable(struct tb_switch *sw)*/ int tb_switch_xhci_connect (struct tb_switch *sw) { -bool usb_port1, usb_port3, xhci_port1, xhci_port3;struct tb_port *port1, *port3;int ret; +if (sw->generation !=3 ) +return 0 ; + port1 = &sw->ports[1 ]; port3 = &sw->ports[3 ];if (tb_switch_is_alpine_ridge (sw)) { +bool usb_port1, usb_port3, xhci_port1, xhci_port3; + usb_port1 =tb_lc_is_usb_plugged (port1); usb_port3 =tb_lc_is_usb_plugged (port3); xhci_port1 =tb_lc_is_xhci_connected (port1);
Signature · 1 line
2.35.1
Quoted 6 lines · Mika Westerberg
The received notification packet is held in
pkg->bufferand not in pkg itself. Fix this by using the correct buffer.Fixes 81a54b5e1986 ("thunderbolt: Let the connection manager handle all notifications")Signed-off-by Mika Westerberg <[email protected]>
Both applied to thunderbolt.git/fixes.