]> git.ipfire.org Git - thirdparty/linux.git/commit
thunderbolt: icm: Preserve USB4 proxy data-valid bit
authorXu Rao <raoxu@uniontech.com>
Mon, 13 Jul 2026 09:32:37 +0000 (17:32 +0800)
committerMika Westerberg <mika.westerberg@linux.intel.com>
Mon, 27 Jul 2026 11:04:09 +0000 (13:04 +0200)
commite48844ece5e3ed1d1eb865f6da2b16f62cd9f86d
tree995bcc6ffb2fbca30ca6628c213941b6b05798b7
parentd6764992f17b23d91ff93ce905ab53c2aa7191f0
thunderbolt: icm: Preserve USB4 proxy data-valid bit

The ICM USB4 switch operation request encodes two values in
request.data_len_valid: bit 4 marks the data payload valid, while bits
3:0 hold the payload length in dwords.  A zero length with the valid bit
set represents the full 16-dword data array.

icm_usb4_switch_op() sets the valid bit when a transmit payload is
present.  For payloads shorter than the full 16 dwords, it then assigns
the length to the whole field and clears the valid bit that was just set.
The payload is still copied into the request, but the descriptor sent to
firmware marks that data as invalid.

This affects USB4 router operations that send short payloads through the
firmware connection manager.  In particular, USB4 NVM writes can send a
short final block when the image size is not aligned to the 64-byte proxy
payload size.  Firmware may then ignore or reject that final block, while
full 16-dword blocks are unaffected because they are encoded as length 0
with the valid bit set.

OR the short payload length into data_len_valid so the valid bit is
preserved.

Fixes: 9039387e166e ("thunderbolt: Add USB4 router operation proxy for firmware connection manager")
Cc: stable@vger.kernel.org
Signed-off-by: Xu Rao <raoxu@uniontech.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
drivers/thunderbolt/icm.c