Skip to content

Commit 434da42

Browse files
committed
Merge tag 'thunderbolt-for-v6.15-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt into usb-next
Mika writes: thunderbolt: Changes for v6.15 merge window This includes following USB4/Thunderbolt changes for the v6.15 merge window: - Move retimer scanning to happen bit later to work better with Pluggable USB4 devices. - No need to add non-active NVM for retimers if NVM upgrade is not supported. - Cleanup for tb_tunnel_alloc_usb3(). - MAINTAINERS update. All these have been in linux-next with no reported issues. * tag 'thunderbolt-for-v6.15-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt: thunderbolt: Do not add non-active NVM if NVM upgrade is disabled for retimer thunderbolt: Scan retimers after device router has been enumerated thunderbolt: Make tb_tunnel_alloc_usb3() error paths consistent with the rest MAINTAINERS: Use my kernel.org address for USB4/Thunderbolt work
2 parents 3a85c10 + ad79c27 commit 434da42

File tree

4 files changed

+29
-15
lines changed

4 files changed

+29
-15
lines changed

MAINTAINERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23633,7 +23633,7 @@ F: drivers/thunderbolt/dma_test.c
2363323633
THUNDERBOLT DRIVER
2363423634
M: Andreas Noever <andreas.noever@gmail.com>
2363523635
M: Michael Jamet <michael.jamet@intel.com>
23636-
M: Mika Westerberg <mika.westerberg@linux.intel.com>
23636+
M: Mika Westerberg <westeri@kernel.org>
2363723637
M: Yehezkel Bernat <YehezkelShB@gmail.com>
2363823638
L: linux-usb@vger.kernel.org
2363923639
S: Maintained
@@ -23644,7 +23644,7 @@ F: include/linux/thunderbolt.h
2364423644

2364523645
THUNDERBOLT NETWORK DRIVER
2364623646
M: Michael Jamet <michael.jamet@intel.com>
23647-
M: Mika Westerberg <mika.westerberg@linux.intel.com>
23647+
M: Mika Westerberg <westeri@kernel.org>
2364823648
M: Yehezkel Bernat <YehezkelShB@gmail.com>
2364923649
L: netdev@vger.kernel.org
2365023650
S: Maintained

drivers/thunderbolt/retimer.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,11 @@ static int tb_retimer_nvm_add(struct tb_retimer *rt)
9393
if (ret)
9494
goto err_nvm;
9595

96-
ret = tb_nvm_add_non_active(nvm, nvm_write);
97-
if (ret)
98-
goto err_nvm;
96+
if (!rt->no_nvm_upgrade) {
97+
ret = tb_nvm_add_non_active(nvm, nvm_write);
98+
if (ret)
99+
goto err_nvm;
100+
}
99101

100102
rt->nvm = nvm;
101103
dev_dbg(&rt->dev, "NVM version %x.%x\n", nvm->major, nvm->minor);

drivers/thunderbolt/tb.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,11 +1305,15 @@ static void tb_scan_port(struct tb_port *port)
13051305
goto out_rpm_put;
13061306
}
13071307

1308-
tb_retimer_scan(port, true);
1309-
13101308
sw = tb_switch_alloc(port->sw->tb, &port->sw->dev,
13111309
tb_downstream_route(port));
13121310
if (IS_ERR(sw)) {
1311+
/*
1312+
* Make the downstream retimers available even if there
1313+
* is no router connected.
1314+
*/
1315+
tb_retimer_scan(port, true);
1316+
13131317
/*
13141318
* If there is an error accessing the connected switch
13151319
* it may be connected to another domain. Also we allow
@@ -1359,6 +1363,14 @@ static void tb_scan_port(struct tb_port *port)
13591363
upstream_port = tb_upstream_port(sw);
13601364
tb_configure_link(port, upstream_port, sw);
13611365

1366+
/*
1367+
* Scan for downstream retimers. We only scan them after the
1368+
* router has been enumerated to avoid issues with certain
1369+
* Pluggable devices that expect the host to enumerate them
1370+
* within certain timeout.
1371+
*/
1372+
tb_retimer_scan(port, true);
1373+
13621374
/*
13631375
* CL0s and CL1 are enabled and supported together.
13641376
* Silently ignore CLx enabling in case CLx is not supported.

drivers/thunderbolt/tunnel.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2224,19 +2224,15 @@ struct tb_tunnel *tb_tunnel_alloc_usb3(struct tb *tb, struct tb_port *up,
22242224

22252225
path = tb_path_alloc(tb, down, TB_USB3_HOPID, up, TB_USB3_HOPID, 0,
22262226
"USB3 Down");
2227-
if (!path) {
2228-
tb_tunnel_put(tunnel);
2229-
return NULL;
2230-
}
2227+
if (!path)
2228+
goto err_free;
22312229
tb_usb3_init_path(path);
22322230
tunnel->paths[TB_USB3_PATH_DOWN] = path;
22332231

22342232
path = tb_path_alloc(tb, up, TB_USB3_HOPID, down, TB_USB3_HOPID, 0,
22352233
"USB3 Up");
2236-
if (!path) {
2237-
tb_tunnel_put(tunnel);
2238-
return NULL;
2239-
}
2234+
if (!path)
2235+
goto err_free;
22402236
tb_usb3_init_path(path);
22412237
tunnel->paths[TB_USB3_PATH_UP] = path;
22422238

@@ -2253,6 +2249,10 @@ struct tb_tunnel *tb_tunnel_alloc_usb3(struct tb *tb, struct tb_port *up,
22532249
}
22542250

22552251
return tunnel;
2252+
2253+
err_free:
2254+
tb_tunnel_put(tunnel);
2255+
return NULL;
22562256
}
22572257

22582258
/**

0 commit comments

Comments
 (0)