<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/thunderbolt, branch master</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>Merge tag 'thunderbolt-for-v7.3-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt into usb-next</title>
<updated>2026-08-19T08:01:59+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2026-08-19T08:01:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=e1e6e541c5c9cf548e9fdc35fc26808c82074440'/>
<id>e1e6e541c5c9cf548e9fdc35fc26808c82074440</id>
<content type='text'>
Mika writes:

thunderbolt: Changes for v7.3 merge window

This includes following USB4/Thunderbolt changes for the v7.3 merge
window:

  - Assert Downstream Port Reset for Thunderbolt 3 devices during
    shutdown to avoid unnecessary delays over warm reset.
  - Tidy up Thunderbolt service -&gt;probe callbacks.
  - USB4STREAM improvements.
  - AMD host interface quirk to fix Tx ring hang on teardown of a DMA tunnel.
  - Minor fixes and cleanups.

All these have been in linux-next with no reported issues.

* tag 'thunderbolt-for-v7.3-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt:
  thunderbolt: Clamp DMA tunnel credits to what a hop register can hold
  thunderbolt: Use min() for the DMA path credit cap
  thunderbolt: debugfs: Replace get_zeroed_page() with kzalloc()
  thunderbolt: Add quirk to reset host interface on DMA path teardown for AMD USB4 routers
  thunderbolt: stream: Add support for busy polling
  thunderbolt: Make interrupt optional for rings
  thunderbolt: stream: Support IOCB_NOWAIT in non-blocking I/O as well
  thunderbolt: stream: Fix possible short reads/writes
  thunderbolt: stream: Restore consumer if copying from iter fails
  thunderbolt: Remove redundant dev_err_probe()
  docs: admin-guide: thunderbolt: Fix sentence structure
  thunderbolt: xdomain: Notify peers after enumeration
  thunderbolt: Drop comma after device id array terminator
  thunderbolt: Assert that a service driver has a probe callback
  thunderbolt: Stop passing matched device ID to .probe()
  thunderbolt: Assert downstream port reset on shutdown
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Mika writes:

thunderbolt: Changes for v7.3 merge window

This includes following USB4/Thunderbolt changes for the v7.3 merge
window:

  - Assert Downstream Port Reset for Thunderbolt 3 devices during
    shutdown to avoid unnecessary delays over warm reset.
  - Tidy up Thunderbolt service -&gt;probe callbacks.
  - USB4STREAM improvements.
  - AMD host interface quirk to fix Tx ring hang on teardown of a DMA tunnel.
  - Minor fixes and cleanups.

All these have been in linux-next with no reported issues.

* tag 'thunderbolt-for-v7.3-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt:
  thunderbolt: Clamp DMA tunnel credits to what a hop register can hold
  thunderbolt: Use min() for the DMA path credit cap
  thunderbolt: debugfs: Replace get_zeroed_page() with kzalloc()
  thunderbolt: Add quirk to reset host interface on DMA path teardown for AMD USB4 routers
  thunderbolt: stream: Add support for busy polling
  thunderbolt: Make interrupt optional for rings
  thunderbolt: stream: Support IOCB_NOWAIT in non-blocking I/O as well
  thunderbolt: stream: Fix possible short reads/writes
  thunderbolt: stream: Restore consumer if copying from iter fails
  thunderbolt: Remove redundant dev_err_probe()
  docs: admin-guide: thunderbolt: Fix sentence structure
  thunderbolt: xdomain: Notify peers after enumeration
  thunderbolt: Drop comma after device id array terminator
  thunderbolt: Assert that a service driver has a probe callback
  thunderbolt: Stop passing matched device ID to .probe()
  thunderbolt: Assert downstream port reset on shutdown
</pre>
</div>
</content>
</entry>
<entry>
<title>thunderbolt: Clamp DMA tunnel credits to what a hop register can hold</title>
<updated>2026-08-11T03:57:59+00:00</updated>
<author>
<name>Fan Ye</name>
<email>fy15309206903@gmail.com</email>
</author>
<published>2026-08-10T12:14:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=86feaba911f2f1a540a7695c8f4a98fd0fd60ac4'/>
<id>86feaba911f2f1a540a7695c8f4a98fd0fd60ac4</id>
<content type='text'>
struct tb_regs_hop::initial_credits is 7 bits wide, but neither of the
values tb_tunnel_alloc_dma() picks from is bounded by that: the
dma_credits module parameter has no upper limit, and neither does the
host router's baMaxHI. A larger count survives until tb_path_activate()
copies it into the register and keeps the low bits, leaving the path on
a credit count nobody asked for.

Clamp it in tb_tunnel_alloc_dma(), the only entry point for DMA tunnels;
every step below it can only lower the value further. Carry the count in
an unsigned int while at it.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Fan Ye &lt;fy15309206903@gmail.com&gt;
Signed-off-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
struct tb_regs_hop::initial_credits is 7 bits wide, but neither of the
values tb_tunnel_alloc_dma() picks from is bounded by that: the
dma_credits module parameter has no upper limit, and neither does the
host router's baMaxHI. A larger count survives until tb_path_activate()
copies it into the register and keeps the low bits, leaving the path on
a credit count nobody asked for.

Clamp it in tb_tunnel_alloc_dma(), the only entry point for DMA tunnels;
every step below it can only lower the value further. Carry the count in
an unsigned int while at it.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Fan Ye &lt;fy15309206903@gmail.com&gt;
Signed-off-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>thunderbolt: Use min() for the DMA path credit cap</title>
<updated>2026-08-10T11:29:23+00:00</updated>
<author>
<name>Fan Ye</name>
<email>fy15309206903@gmail.com</email>
</author>
<published>2026-08-10T09:38:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=e8158c8a6a232a70ae70c5acfaf7008a99b716c1'/>
<id>e8158c8a6a232a70ae70c5acfaf7008a99b716c1</id>
<content type='text'>
tb_dma_reserve_credits() caps the request against what the adapter has
left by decrementing one credit at a time. The other arm of the same
if() already caps with min(port-&gt;total_credits, credits); use min()
here too.

No functional change: the object code is unchanged.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Fan Ye &lt;fy15309206903@gmail.com&gt;
Signed-off-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
tb_dma_reserve_credits() caps the request against what the adapter has
left by decrementing one credit at a time. The other arm of the same
if() already caps with min(port-&gt;total_credits, credits); use min()
here too.

No functional change: the object code is unchanged.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Fan Ye &lt;fy15309206903@gmail.com&gt;
Signed-off-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>thunderbolt: debugfs: Replace get_zeroed_page() with kzalloc()</title>
<updated>2026-08-10T10:50:16+00:00</updated>
<author>
<name>Mahad Ibrahim</name>
<email>mahad.ibrahim.dev@gmail.com</email>
</author>
<published>2026-08-08T22:38:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=f7c0e02eb61284395f74424edaefbbd323f83c4e'/>
<id>f7c0e02eb61284395f74424edaefbbd323f83c4e</id>
<content type='text'>
validate_and_copy_from_user() allocates a page to store data from
userspace via get_zeroed_page(), and then returns it as a buffer.
Neither the function itself nor its callers require struct page access.

This buffer can easily be allocated with kzalloc() as there is nothing
special about it that requires going through the page allocator.
kzalloc(), which internally reduces to kmalloc() with __GFP_ZERO,
provides a better API and kfree() does not need to know the size of the
freed object. Additionally it removes the casts of (void *) and
(unsigned long) which only obfuscate the code.

Replace get_zeroed_page() with kzalloc() and free_page() with kfree().

Link: https://lore.kernel.org/all/635405e4-9423-4a25-a6e7-e03c8ea0bcbe@redhat.com/
Signed-off-by: Mahad Ibrahim &lt;mahad.ibrahim.dev@gmail.com&gt;
Acked-by: Mike Rapoport (Microsoft) &lt;rppt@kernel.org&gt;
Signed-off-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
validate_and_copy_from_user() allocates a page to store data from
userspace via get_zeroed_page(), and then returns it as a buffer.
Neither the function itself nor its callers require struct page access.

This buffer can easily be allocated with kzalloc() as there is nothing
special about it that requires going through the page allocator.
kzalloc(), which internally reduces to kmalloc() with __GFP_ZERO,
provides a better API and kfree() does not need to know the size of the
freed object. Additionally it removes the casts of (void *) and
(unsigned long) which only obfuscate the code.

Replace get_zeroed_page() with kzalloc() and free_page() with kfree().

Link: https://lore.kernel.org/all/635405e4-9423-4a25-a6e7-e03c8ea0bcbe@redhat.com/
Signed-off-by: Mahad Ibrahim &lt;mahad.ibrahim.dev@gmail.com&gt;
Acked-by: Mike Rapoport (Microsoft) &lt;rppt@kernel.org&gt;
Signed-off-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>thunderbolt: Add quirk to reset host interface on DMA path teardown for AMD USB4 routers</title>
<updated>2026-08-07T06:14:26+00:00</updated>
<author>
<name>Basavaraj Natikar</name>
<email>Basavaraj.Natikar@amd.com</email>
</author>
<published>2026-08-06T12:59:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=f1de1fc5f632cdeae1f5c2984572ab710d4dfcaa'/>
<id>f1de1fc5f632cdeae1f5c2984572ab710d4dfcaa</id>
<content type='text'>
Some AMD USB4 host routers have a bug in the Host Interface where
DMA path setup and teardown cycles may cause the Tx ring to hang.

Fix this by issuing a Host Interface Reset on every DMA path teardown
for affected routers. The Host Interface Reset brings the registers in
the memory BAR to their default state and clears the End-to-End Flow
Control state, preventing the hang condition.

Co-developed-by: Sanath S &lt;Sanath.S@amd.com&gt;
Signed-off-by: Sanath S &lt;Sanath.S@amd.com&gt;
Signed-off-by: Basavaraj Natikar &lt;Basavaraj.Natikar@amd.com&gt;
Signed-off-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some AMD USB4 host routers have a bug in the Host Interface where
DMA path setup and teardown cycles may cause the Tx ring to hang.

Fix this by issuing a Host Interface Reset on every DMA path teardown
for affected routers. The Host Interface Reset brings the registers in
the memory BAR to their default state and clears the End-to-End Flow
Control state, preventing the hang condition.

Co-developed-by: Sanath S &lt;Sanath.S@amd.com&gt;
Signed-off-by: Sanath S &lt;Sanath.S@amd.com&gt;
Signed-off-by: Basavaraj Natikar &lt;Basavaraj.Natikar@amd.com&gt;
Signed-off-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>thunderbolt: stream: Add support for busy polling</title>
<updated>2026-08-05T03:53:57+00:00</updated>
<author>
<name>Mika Westerberg</name>
<email>mika.westerberg@linux.intel.com</email>
</author>
<published>2026-06-18T04:27:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=e120d14d03b3db5f4ac049f32328c4951a532a90'/>
<id>e120d14d03b3db5f4ac049f32328c4951a532a90</id>
<content type='text'>
Using interrupts and scheduling workers increase latency so latency
critical applications may want to avoid that. Make this possible in
USB4STREAM by adding a new ConfigFS attribute: busy_poll that, when
activated switches the rings to polling mode. The cost for lower latency
is that this burns more CPU cycles and things like poll(2) cannot be
used.

Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Using interrupts and scheduling workers increase latency so latency
critical applications may want to avoid that. Make this possible in
USB4STREAM by adding a new ConfigFS attribute: busy_poll that, when
activated switches the rings to polling mode. The cost for lower latency
is that this burns more CPU cycles and things like poll(2) cannot be
used.

Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>thunderbolt: Make interrupt optional for rings</title>
<updated>2026-08-05T03:53:57+00:00</updated>
<author>
<name>Mika Westerberg</name>
<email>mika.westerberg@linux.intel.com</email>
</author>
<published>2026-06-18T04:22:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=f5cb175ed728488aacd8a631cb0a815bfb06664e'/>
<id>f5cb175ed728488aacd8a631cb0a815bfb06664e</id>
<content type='text'>
For some use-cases it does make sense to poll the rings directly instead
of relying on the interrupt. For this reason add a new flag RING_FLAG_NO_INTERRUPT
that can be used to allocate ring in polled mode.

Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For some use-cases it does make sense to poll the rings directly instead
of relying on the interrupt. For this reason add a new flag RING_FLAG_NO_INTERRUPT
that can be used to allocate ring in polled mode.

Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>thunderbolt: stream: Support IOCB_NOWAIT in non-blocking I/O as well</title>
<updated>2026-08-05T03:53:57+00:00</updated>
<author>
<name>Mika Westerberg</name>
<email>mika.westerberg@linux.intel.com</email>
</author>
<published>2026-06-17T04:42:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=42bc6935339b913d424331a62f9e965bc72ca3df'/>
<id>42bc6935339b913d424331a62f9e965bc72ca3df</id>
<content type='text'>
For read_iter/write_iter() it is also possible to pass IOCB_NOWAIT with
the kiocb to indicate non-blocking read/write. For instance io_uring
does this. So take this into account on read and write paths.

Signed-off-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For read_iter/write_iter() it is also possible to pass IOCB_NOWAIT with
the kiocb to indicate non-blocking read/write. For instance io_uring
does this. So take this into account on read and write paths.

Signed-off-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>thunderbolt: stream: Fix possible short reads/writes</title>
<updated>2026-08-05T03:53:57+00:00</updated>
<author>
<name>Mika Westerberg</name>
<email>mika.westerberg@linux.intel.com</email>
</author>
<published>2026-07-28T10:27:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=af73a21a8eb460744d733fa5e2627935ed125081'/>
<id>af73a21a8eb460744d733fa5e2627935ed125081</id>
<content type='text'>
Since copy_page_{to|from}_iter() advances the iterator and makes
iov_iter_count() reflect the remaining bytes, subtracting nbytes from it
makes it count it twice resulting in possible short reads/writes on a
read/write spanning multiple frames.

Fix this by using iov_iter_count() directly.

Fixes: 6db21d817b43 ("thunderbolt: Add support for USB4STREAM")
Signed-off-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since copy_page_{to|from}_iter() advances the iterator and makes
iov_iter_count() reflect the remaining bytes, subtracting nbytes from it
makes it count it twice resulting in possible short reads/writes on a
read/write spanning multiple frames.

Fix this by using iov_iter_count() directly.

Fixes: 6db21d817b43 ("thunderbolt: Add support for USB4STREAM")
Signed-off-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>thunderbolt: stream: Restore consumer if copying from iter fails</title>
<updated>2026-08-05T03:53:57+00:00</updated>
<author>
<name>Mika Westerberg</name>
<email>mika.westerberg@linux.intel.com</email>
</author>
<published>2026-07-28T10:24:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=039701ea3d76ec004863fd7437fb56a9146cb094'/>
<id>039701ea3d76ec004863fd7437fb56a9146cb094</id>
<content type='text'>
In tbstream_dev_alloc_tx() if copying data from iterator fails we leave
the consumer pointer as is wasting one entry in the ring. Fix this by
restoring the consumer back in case of failure.

Fixes: 6db21d817b43 ("thunderbolt: Add support for USB4STREAM")
Signed-off-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In tbstream_dev_alloc_tx() if copying data from iterator fails we leave
the consumer pointer as is wasting one entry in the ring. Fix this by
restoring the consumer back in case of failure.

Fixes: 6db21d817b43 ("thunderbolt: Add support for USB4STREAM")
Signed-off-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
