mirror of
https://github.com/torvalds/linux.git
synced 2024-11-11 06:31:49 +00:00
thunderbolt: Fixes for v6.2-rc5
This includes fixes for: - on-board retimer scan return value - runtime PM during tb_retimer_scan() - USB3 link rate calculation - XDomain lane bonding. All these have been in linux-next with no reported issues. -----BEGIN PGP SIGNATURE----- iQJUBAABCgA+FiEEVTdhRGBbNzLrSUBaAP2fSd+ZWKAFAmPFFDkgHG1pa2Eud2Vz dGVyYmVyZ0BsaW51eC5pbnRlbC5jb20ACgkQAP2fSd+ZWKBFEBAAl3gLtejSnbO3 Qjh+ep8wHpOP+MMf4LEYF4xY3431prHSjvY4GpdO/s4Ym6G2yjYf2Dn/L+HYlbDJ ykOs5DA7YJDQZHaZbVmQrI9Zrwhh6lzAuseDtPLPqNPuQw56WsSbCLkEV7MC9Yvn CQ6Flv4isLPLlZL2YaFXLhzmGqh0dyAg9CmwwcwXl/4BYwz0gAtlVNvz6DEql7r6 Y8M1Eo47DNiO9VhD0fQ9eCPpEmWxI4S+AKGngb67ormK8EaK9HE9RujFgUovbHbc /tIlFxTjT0/9nmR9S71j6sDmFkEW3YT4lRHZVMumQ2VIEqBjvt1xYxn++JNSUBRL LTcaR1+HilsRXfQA+Uz7W3bsoK5XpcuYqqJh6wo0KMBdCVxjB+RU4Kg7LjZqN9IS RGVn06dg7y9uzqZmrGD2RETvc/4NLg2m8BJH4PaZ4fw/2E8G6IgnJtwD6K/YD0Ad 2uEGDy1fLXsko80ZvSf8QPvde5BL88oEfGeuwJZKkqm3eKNpP2Grp5yq6UyY5Hju CHcYEnH/oFGGjzqHI2EbCTQVwobeR9QETBY9miTjIW78b44BS04hsJ4ocX35O42a N0vj+VV7znyaRoMq6R+zVwZt+YU8QUxIWcuFqtLQfDvq9obx2sPTT4voaQRkDgHc KsE25mxtCQS4ePHUKTswV7cCvMnolIc= =2bPr -----END PGP SIGNATURE----- Merge tag 'thunderbolt-for-v6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt into usb-linus Mika writes: "thunderbolt: Fixes for v6.2-rc5 This includes fixes for: - on-board retimer scan return value - runtime PM during tb_retimer_scan() - USB3 link rate calculation - XDomain lane bonding. All these have been in linux-next with no reported issues." * tag 'thunderbolt-for-v6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt: thunderbolt: Disable XDomain lane 1 only in software connection manager thunderbolt: Use correct function to calculate maximum USB3 link rate thunderbolt: Do not call PM runtime functions in tb_retimer_scan() thunderbolt: Do not report errors if on-board retimers are found
This commit is contained in:
commit
b1f02c6a26
@ -427,13 +427,6 @@ int tb_retimer_scan(struct tb_port *port, bool add)
|
||||
{
|
||||
u32 status[TB_MAX_RETIMER_INDEX + 1] = {};
|
||||
int ret, i, last_idx = 0;
|
||||
struct usb4_port *usb4;
|
||||
|
||||
usb4 = port->usb4;
|
||||
if (!usb4)
|
||||
return 0;
|
||||
|
||||
pm_runtime_get_sync(&usb4->dev);
|
||||
|
||||
/*
|
||||
* Send broadcast RT to make sure retimer indices facing this
|
||||
@ -441,7 +434,7 @@ int tb_retimer_scan(struct tb_port *port, bool add)
|
||||
*/
|
||||
ret = usb4_port_enumerate_retimers(port);
|
||||
if (ret)
|
||||
goto out;
|
||||
return ret;
|
||||
|
||||
/*
|
||||
* Enable sideband channel for each retimer. We can do this
|
||||
@ -471,12 +464,11 @@ int tb_retimer_scan(struct tb_port *port, bool add)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!last_idx) {
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
if (!last_idx)
|
||||
return 0;
|
||||
|
||||
/* Add on-board retimers if they do not exist already */
|
||||
ret = 0;
|
||||
for (i = 1; i <= last_idx; i++) {
|
||||
struct tb_retimer *rt;
|
||||
|
||||
@ -490,10 +482,6 @@ int tb_retimer_scan(struct tb_port *port, bool add)
|
||||
}
|
||||
}
|
||||
|
||||
out:
|
||||
pm_runtime_mark_last_busy(&usb4->dev);
|
||||
pm_runtime_put_autosuspend(&usb4->dev);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -628,11 +628,15 @@ static void tb_scan_port(struct tb_port *port)
|
||||
* Downstream switch is reachable through two ports.
|
||||
* Only scan on the primary port (link_nr == 0).
|
||||
*/
|
||||
|
||||
if (port->usb4)
|
||||
pm_runtime_get_sync(&port->usb4->dev);
|
||||
|
||||
if (tb_wait_for_port(port, false) <= 0)
|
||||
return;
|
||||
goto out_rpm_put;
|
||||
if (port->remote) {
|
||||
tb_port_dbg(port, "port already has a remote\n");
|
||||
return;
|
||||
goto out_rpm_put;
|
||||
}
|
||||
|
||||
tb_retimer_scan(port, true);
|
||||
@ -647,12 +651,12 @@ static void tb_scan_port(struct tb_port *port)
|
||||
*/
|
||||
if (PTR_ERR(sw) == -EIO || PTR_ERR(sw) == -EADDRNOTAVAIL)
|
||||
tb_scan_xdomain(port);
|
||||
return;
|
||||
goto out_rpm_put;
|
||||
}
|
||||
|
||||
if (tb_switch_configure(sw)) {
|
||||
tb_switch_put(sw);
|
||||
return;
|
||||
goto out_rpm_put;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -681,7 +685,7 @@ static void tb_scan_port(struct tb_port *port)
|
||||
|
||||
if (tb_switch_add(sw)) {
|
||||
tb_switch_put(sw);
|
||||
return;
|
||||
goto out_rpm_put;
|
||||
}
|
||||
|
||||
/* Link the switches using both links if available */
|
||||
@ -733,6 +737,12 @@ static void tb_scan_port(struct tb_port *port)
|
||||
|
||||
tb_add_dp_resources(sw);
|
||||
tb_scan_switch(sw);
|
||||
|
||||
out_rpm_put:
|
||||
if (port->usb4) {
|
||||
pm_runtime_mark_last_busy(&port->usb4->dev);
|
||||
pm_runtime_put_autosuspend(&port->usb4->dev);
|
||||
}
|
||||
}
|
||||
|
||||
static void tb_deactivate_and_free_tunnel(struct tb_tunnel *tunnel)
|
||||
|
@ -1275,7 +1275,7 @@ static void tb_usb3_reclaim_available_bandwidth(struct tb_tunnel *tunnel,
|
||||
return;
|
||||
} else if (!ret) {
|
||||
/* Use maximum link rate if the link valid is not set */
|
||||
ret = usb4_usb3_port_max_link_rate(tunnel->src_port);
|
||||
ret = tb_usb3_max_link_rate(tunnel->dst_port, tunnel->src_port);
|
||||
if (ret < 0) {
|
||||
tb_tunnel_warn(tunnel, "failed to read maximum link rate\n");
|
||||
return;
|
||||
|
@ -1419,12 +1419,19 @@ static int tb_xdomain_get_properties(struct tb_xdomain *xd)
|
||||
* registered, we notify the userspace that it has changed.
|
||||
*/
|
||||
if (!update) {
|
||||
struct tb_port *port;
|
||||
/*
|
||||
* Now disable lane 1 if bonding was not enabled. Do
|
||||
* this only if bonding was possible at the beginning
|
||||
* (that is we are the connection manager and there are
|
||||
* two lanes).
|
||||
*/
|
||||
if (xd->bonding_possible) {
|
||||
struct tb_port *port;
|
||||
|
||||
/* Now disable lane 1 if bonding was not enabled */
|
||||
port = tb_port_at(xd->route, tb_xdomain_parent(xd));
|
||||
if (!port->bonded)
|
||||
tb_port_disable(port->dual_link_port);
|
||||
port = tb_port_at(xd->route, tb_xdomain_parent(xd));
|
||||
if (!port->bonded)
|
||||
tb_port_disable(port->dual_link_port);
|
||||
}
|
||||
|
||||
if (device_add(&xd->dev)) {
|
||||
dev_err(&xd->dev, "failed to add XDomain device\n");
|
||||
|
Loading…
Reference in New Issue
Block a user