Skip to content

Commit c77a654

Browse files
committed
Merge tag 'thunderbolt-for-v6.19-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt into usb-nextx
Mika writes: thunderbolt: Changes for v6.19 merge window This includes following USB4/Thunderbolt changes for the v6.19 merge window: - Documentation fixes - Fixes for various typos found in the driver - Replace use of system_wq with system_percpu_wq. All these have been in linux-next with no reported issues. * tag 'thunderbolt-for-v6.19-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt: thunderbolt: Fix typos in xdomain.c thunderbolt: Fix typos in usb4.c thunderbolt: Fix typos in tunnel.c thunderbolt: Fix typos in tmu.c thunderbolt: Fix typos in tb_regs.h thunderbolt: Fix typos in tb.h thunderbolt: Fix typos in tb.c thunderbolt: Fix typos in switch.c thunderbolt: Fix typos in retimer.c thunderbolt: Fix typos in nhi.c thunderbolt: Fix typos in lc.c thunderbolt: Fix typos in icm.c thunderbolt: Fix typos in domain.c thunderbolt: Fix typos in debugfs.c thunderbolt: Fix typos in ctl.c thunderbolt: Replace use of system_wq with system_percpu_wq thunderbolt: Update deprecated firmware update site in icm.c thunderbolt: Update NVM firmware upgrade documentation thunderbolt: Fix typo in tb_eeprom_ctl_read documentation
2 parents 955a48a + 479d186 commit c77a654

17 files changed

Lines changed: 92 additions & 72 deletions

File tree

Documentation/admin-guide/thunderbolt.rst

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,10 @@ host controller or a device, it is important that the firmware can be
203203
upgraded to the latest where possible bugs in it have been fixed.
204204
Typically OEMs provide this firmware from their support site.
205205

206-
There is also a central site which has links where to download firmware
207-
for some machines:
208-
209-
`Thunderbolt Updates <https://thunderbolttechnology.net/updates>`_
206+
Currently, recommended method of updating firmware is through "fwupd" tool.
207+
It uses LVFS (Linux Vendor Firmware Service) portal by default to get the
208+
latest firmware from hardware vendors and updates connected devices if found
209+
compatible. For details refer to: https://github.com/fwupd/fwupd.
210210

211211
Before you upgrade firmware on a device, host or retimer, please make
212212
sure it is a suitable upgrade. Failing to do that may render the device
@@ -215,18 +215,40 @@ tools!
215215

216216
Host NVM upgrade on Apple Macs is not supported.
217217

218-
Once the NVM image has been downloaded, you need to plug in a
219-
Thunderbolt device so that the host controller appears. It does not
220-
matter which device is connected (unless you are upgrading NVM on a
221-
device - then you need to connect that particular device).
218+
Fwupd is installed by default. If you don't have it on your system, simply
219+
use your distro package manager to get it.
220+
221+
To see possible updates through fwupd, you need to plug in a Thunderbolt
222+
device so that the host controller appears. It does not matter which
223+
device is connected (unless you are upgrading NVM on a device - then you
224+
need to connect that particular device).
222225

223226
Note an OEM-specific method to power the controller up ("force power") may
224227
be available for your system in which case there is no need to plug in a
225228
Thunderbolt device.
226229

227-
After that we can write the firmware to the non-active parts of the NVM
228-
of the host or device. As an example here is how Intel NUC6i7KYK (Skull
229-
Canyon) Thunderbolt controller NVM is upgraded::
230+
Updating firmware using fwupd is straightforward - refer to official
231+
readme on fwupd github.
232+
233+
If firmware image is written successfully, the device shortly disappears.
234+
Once it comes back, the driver notices it and initiates a full power
235+
cycle. After a while device appears again and this time it should be
236+
fully functional.
237+
238+
Device of interest should display new version under "Current version"
239+
and "Update State: Success" in fwupd's interface.
240+
241+
Upgrading firmware manually
242+
---------------------------------------------------------------
243+
If possible, use fwupd to updated the firmware. However, if your device OEM
244+
has not uploaded the firmware to LVFS, but it is available for download
245+
from their side, you can use method below to directly upgrade the
246+
firmware.
247+
248+
Manual firmware update can be done with 'dd' tool. To update firmware
249+
using this method, you need to write it to the non-active parts of NVM
250+
of the host or device. Example on how to update Intel NUC6i7KYK
251+
(Skull Canyon) Thunderbolt controller NVM::
230252

231253
# dd if=KYK_TBT_FW_0018.bin of=/sys/bus/thunderbolt/devices/0-0/nvm_non_active0/nvmem
232254

@@ -235,10 +257,8 @@ upgrade process as follows::
235257

236258
# echo 1 > /sys/bus/thunderbolt/devices/0-0/nvm_authenticate
237259

238-
If no errors are returned, the host controller shortly disappears. Once
239-
it comes back the driver notices it and initiates a full power cycle.
240-
After a while the host controller appears again and this time it should
241-
be fully functional.
260+
If no errors are returned, device should behave as described in previous
261+
section.
242262

243263
We can verify that the new NVM firmware is active by running the following
244264
commands::

drivers/thunderbolt/ctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ static void tb_ctl_rx_submit(struct ctl_pkg *pkg)
412412
* We ignore failures during stop.
413413
* All rx packets are referenced
414414
* from ctl->rx_packets, so we do
415-
* not loose them.
415+
* not lose them.
416416
*/
417417
}
418418

drivers/thunderbolt/debugfs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ static bool parse_line(char **line, u32 *offs, u32 *val, int short_fmt_len,
201201
#if IS_ENABLED(CONFIG_USB4_DEBUGFS_WRITE)
202202
/*
203203
* Path registers need to be written in double word pairs and they both must be
204-
* read before written. This writes one double word in patch config space
204+
* read before written. This writes one double word in path config space
205205
* following the spec flow.
206206
*/
207207
static int path_write_one(struct tb_port *port, u32 val, u32 offset)
@@ -1196,7 +1196,7 @@ static int validate_margining(struct tb_margining *margining)
11961196
{
11971197
/*
11981198
* For running on RX2 the link must be asymmetric with 3
1199-
* receivers. Because this is can change dynamically, check it
1199+
* receivers. Because this can change dynamically, check it
12001200
* here before we start the margining and report back error if
12011201
* expectations are not met.
12021202
*/

drivers/thunderbolt/domain.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ struct tb *tb_domain_alloc(struct tb_nhi *nhi, int timeout_msec, size_t privsize
376376
struct tb *tb;
377377

378378
/*
379-
* Make sure the structure sizes map with that the hardware
379+
* Make sure the structure sizes map with what the hardware
380380
* expects because bit-fields are being used.
381381
*/
382382
BUILD_BUG_ON(sizeof(struct tb_regs_switch_header) != 5 * 4);

drivers/thunderbolt/eeprom.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ static int tb_eeprom_ctl_write(struct tb_switch *sw, struct tb_eeprom_ctl *ctl)
2121
}
2222

2323
/*
24-
* tb_eeprom_ctl_write() - read control word
24+
* tb_eeprom_ctl_read() - read control word
2525
*/
2626
static int tb_eeprom_ctl_read(struct tb_switch *sw, struct tb_eeprom_ctl *ctl)
2727
{

drivers/thunderbolt/icm.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ icm_fr_device_connected(struct tb *tb, const struct icm_pkg_header *hdr)
787787
* information might have changed for example by the
788788
* fact that a switch on a dual-link connection might
789789
* have been enumerated using the other link now. Make
790-
* sure our book keeping matches that.
790+
* sure our bookkeeping matches that.
791791
*/
792792
if (sw->depth == depth && sw_phy_port == phy_port &&
793793
!!sw->authorized == authorized) {
@@ -969,7 +969,7 @@ icm_fr_xdomain_connected(struct tb *tb, const struct icm_pkg_header *hdr)
969969

970970
/*
971971
* Look if there already exists an XDomain in the same place
972-
* than the new one and in that case remove it because it is
972+
* as the new one and in that case remove it because it is
973973
* most likely another host that got disconnected.
974974
*/
975975
xd = tb_xdomain_find_by_link_depth(tb, link, depth);
@@ -2000,7 +2000,7 @@ static int icm_driver_ready(struct tb *tb)
20002000
if (icm->safe_mode) {
20012001
tb_info(tb, "Thunderbolt host controller is in safe mode.\n");
20022002
tb_info(tb, "You need to update NVM firmware of the controller before it can be used.\n");
2003-
tb_info(tb, "For latest updates check https://thunderbolttechnology.net/updates.\n");
2003+
tb_info(tb, "Use fwupd tool to apply update. Check Documentation/admin-guide/thunderbolt.rst for details.\n");
20042004
return 0;
20052005
}
20062006

@@ -2171,7 +2171,7 @@ static int icm_runtime_resume_switch(struct tb_switch *sw)
21712171
static int icm_runtime_resume(struct tb *tb)
21722172
{
21732173
/*
2174-
* We can reuse the same resume functionality than with system
2174+
* We can reuse the same resume functionality as with system
21752175
* suspend.
21762176
*/
21772177
icm_complete(tb);

drivers/thunderbolt/lc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ static int tb_lc_dp_sink_available(struct tb_switch *sw, int sink)
558558
return ret;
559559

560560
/*
561-
* Sink is available for CM/SW to use if the allocation valie is
561+
* Sink is available for CM/SW to use if the allocation value is
562562
* either 0 or 1.
563563
*/
564564
if (!sink) {

drivers/thunderbolt/nhi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ void tb_ring_start(struct tb_ring *ring)
712712
ring_iowrite64desc(ring, ring->descriptors_dma, 0);
713713
if (ring->is_tx) {
714714
ring_iowrite32desc(ring, ring->size, 12);
715-
ring_iowrite32options(ring, 0, 4); /* time releated ? */
715+
ring_iowrite32options(ring, 0, 4);
716716
ring_iowrite32options(ring, flags, 0);
717717
} else {
718718
u32 sof_eof_mask = ring->sof_mask << 16 | ring->eof_mask;

drivers/thunderbolt/retimer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ static struct tb_retimer *tb_port_find_retimer(struct tb_port *port, u8 index)
501501
* @add: If true also registers found retimers
502502
*
503503
* Brings the sideband into a state where retimers can be accessed.
504-
* Then Tries to enumerate on-board retimers connected to @port. Found
504+
* Then tries to enumerate on-board retimers connected to @port. Found
505505
* retimers are registered as children of @port if @add is set. Does
506506
* not scan for cable retimers for now.
507507
*

drivers/thunderbolt/switch.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -736,9 +736,9 @@ static int tb_init_port(struct tb_port *port)
736736
port->cap_usb4 = cap;
737737

738738
/*
739-
* USB4 ports the buffers allocated for the control path
739+
* USB4 port buffers allocated for the control path
740740
* can be read from the path config space. Legacy
741-
* devices we use hard-coded value.
741+
* devices use hard-coded value.
742742
*/
743743
if (port->cap_usb4) {
744744
struct tb_regs_hop hop;
@@ -3221,7 +3221,7 @@ int tb_switch_configure_link(struct tb_switch *sw)
32213221
* @sw: Switch whose link is unconfigured
32223222
*
32233223
* Sets the link unconfigured so the @sw will be disconnected if the
3224-
* domain exists sleep.
3224+
* domain exits sleep.
32253225
*/
32263226
void tb_switch_unconfigure_link(struct tb_switch *sw)
32273227
{

0 commit comments

Comments
 (0)