<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/thunderbolt/ctl.c, branch v6.1.168</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.1.168</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.1.168'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-06-27T10:07:06+00:00</updated>
<entry>
<title>thunderbolt: Do not double dequeue a configuration request</title>
<updated>2025-06-27T10:07:06+00:00</updated>
<author>
<name>Sergey Senozhatsky</name>
<email>senozhatsky@chromium.org</email>
</author>
<published>2025-03-27T15:03:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=85286e634ebbaf9c0fb1cdf580add2f33fc7628c'/>
<id>urn:sha1:85286e634ebbaf9c0fb1cdf580add2f33fc7628c</id>
<content type='text'>
commit 0f73628e9da1ee39daf5f188190cdbaee5e0c98c upstream.

Some of our devices crash in tb_cfg_request_dequeue():

 general protection fault, probably for non-canonical address 0xdead000000000122

 CPU: 6 PID: 91007 Comm: kworker/6:2 Tainted: G U W 6.6.65
 RIP: 0010:tb_cfg_request_dequeue+0x2d/0xa0
 Call Trace:
 &lt;TASK&gt;
 ? tb_cfg_request_dequeue+0x2d/0xa0
 tb_cfg_request_work+0x33/0x80
 worker_thread+0x386/0x8f0
 kthread+0xed/0x110
 ret_from_fork+0x38/0x50
 ret_from_fork_asm+0x1b/0x30

The circumstances are unclear, however, the theory is that
tb_cfg_request_work() can be scheduled twice for a request:
first time via frame.callback from ring_work() and second
time from tb_cfg_request().  Both times kworkers will execute
tb_cfg_request_dequeue(), which results in double list_del()
from the ctl-&gt;request_queue (the list poison deference hints
at it: 0xdead000000000122).

Do not dequeue requests that don't have TB_CFG_REQUEST_ACTIVE
bit set.

Signed-off-by: Sergey Senozhatsky &lt;senozhatsky@chromium.org&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>thunderbolt: Use the actual buffer in tb_async_error()</title>
<updated>2022-08-18T08:55:46+00:00</updated>
<author>
<name>Mika Westerberg</name>
<email>mika.westerberg@linux.intel.com</email>
</author>
<published>2022-04-29T14:10:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=eb100b8fa8e8b59eb3e5fc7a5fd4a1e3c5950f64'/>
<id>urn:sha1:eb100b8fa8e8b59eb3e5fc7a5fd4a1e3c5950f64</id>
<content type='text'>
The received notification packet is held in pkg-&gt;buffer and not in pkg
itself. Fix this by using the correct buffer.

Fixes: 81a54b5e1986 ("thunderbolt: Let the connection manager handle all notifications")
Cc: stable@vger.kernel.org
Signed-off-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>thunderbolt: Fix some kernel-doc comments</title>
<updated>2022-06-06T09:28:56+00:00</updated>
<author>
<name>Yang Li</name>
<email>yang.lee@linux.alibaba.com</email>
</author>
<published>2022-05-26T13:01:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e173b7d46c0413f004450bfc48f45bfc0f0f2fc2'/>
<id>urn:sha1:e173b7d46c0413f004450bfc48f45bfc0f0f2fc2</id>
<content type='text'>
Remove some warnings found by running scripts/kernel-doc,
which is caused by using 'make W=1'.

  drivers/thunderbolt/ctl.c:701: warning: expecting prototype for tb_cfg_start().
    Prototype was for tb_ctl_start() instead
  drivers/thunderbolt/ctl.c:722: warning: expecting prototype for tb_ctrl_stop().
    Prototype was for tb_ctl_stop() instead
  drivers/thunderbolt/ctl.c:930: warning: expecting prototype for tb_cfg_write().
    Prototype was for tb_cfg_write_raw() instead

Reported-by: Abaci Robot &lt;abaci@linux.alibaba.com&gt;
Signed-off-by: Yang Li &lt;yang.lee@linux.alibaba.com&gt;
Signed-off-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>thunderbolt: Replace usage of found with dedicated list iterator variable</title>
<updated>2022-04-04T09:31:50+00:00</updated>
<author>
<name>Jakob Koschel</name>
<email>jakobkoschel@gmail.com</email>
</author>
<published>2022-03-24T07:27:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=03941ed91c7231e4973fb50de6c349974405df4e'/>
<id>urn:sha1:03941ed91c7231e4973fb50de6c349974405df4e</id>
<content type='text'>
To move the list iterator variable into the list_for_each_entry_*()
macro in the future it should be avoided to use the list iterator
variable after the loop body.

To *never* use the list iterator variable after the loop it was
concluded to use a separate iterator variable instead of a
found boolean [1].

This removes the need to use a found variable and simply checking if
the variable was set, can determine if the break/goto was hit.

Link: https://lore.kernel.org/all/CAHk-=wgRr_D8CB-D9Kg-c=EHreAsk5SqXPwr9Y7k9sA6cWXJ6w@mail.gmail.com/
Signed-off-by: Jakob Koschel &lt;jakobkoschel@gmail.com&gt;
Signed-off-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>thunderbolt: Enable retry logic for intra-domain control packets</title>
<updated>2021-09-27T10:47:36+00:00</updated>
<author>
<name>Sanjay R Mehta</name>
<email>sanju.mehta@amd.com</email>
</author>
<published>2021-09-24T07:44:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=641cdbea7635be3a177dbdf81356ccb16f3769e3'/>
<id>urn:sha1:641cdbea7635be3a177dbdf81356ccb16f3769e3</id>
<content type='text'>
In case of software connection manager, the response packets are lost
sometimes within the stipulated time. Hence resending the control
packets in such scenario by increasing the retry count TB_CTL_RETRIES
value.

Signed-off-by: Sanjay R Mehta &lt;sanju.mehta@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>
</entry>
<entry>
<title>thunderbolt: Decrease control channel timeout for software connection manager</title>
<updated>2021-03-18T15:25:30+00:00</updated>
<author>
<name>Mika Westerberg</name>
<email>mika.westerberg@linux.intel.com</email>
</author>
<published>2020-12-29T11:44:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7f0a34d7900b8403d3068755856b86bcc790c5a3'/>
<id>urn:sha1:7f0a34d7900b8403d3068755856b86bcc790c5a3</id>
<content type='text'>
When the firmware connection manager is not proxying between the
software and the hardware we can decrease the timeout for control
packets significantly. The USB4 spec recommends 10 ms +- 1 ms but we use
slightly larger value (100 ms) which is recommendation from Intel
Thunderbolt firmware folks. When firmware connection manager is running
then we keep using the existing 5000 ms.

To implement this we move the control channel allocation to
tb_domain_alloc(), and pass the timeout from that function to the
tb_ctl_alloc(). Then make both connection manager implementations pass
the timeout when they alloc the domain structure.

While there update kernel-doc of struct tb_ctl to match the reality.

Signed-off-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>thunderbolt: Do not pass timeout for tb_cfg_reset()</title>
<updated>2021-03-18T15:25:30+00:00</updated>
<author>
<name>Mika Westerberg</name>
<email>mika.westerberg@linux.intel.com</email>
</author>
<published>2020-12-22T11:40:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=bda83aeca3cfa8a5aacfe93ba4baf1be81c21f61'/>
<id>urn:sha1:bda83aeca3cfa8a5aacfe93ba4baf1be81c21f61</id>
<content type='text'>
There is only one user for this function and it passes the default
timeout to it anyway, so remove the parameter completely. This is also
needed in the subsequent patch where we allow connection manager
implementations to use different timeout for non-raw control channel
messages.

Signed-off-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>thunderbolt: Disable retry logic for intra-domain control packets</title>
<updated>2021-03-18T15:25:30+00:00</updated>
<author>
<name>Mika Westerberg</name>
<email>mika.westerberg@linux.intel.com</email>
</author>
<published>2020-12-28T11:17:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=61ec15e5534b1adcfc30cb2cf408144c6cd621f2'/>
<id>urn:sha1:61ec15e5534b1adcfc30cb2cf408144c6cd621f2</id>
<content type='text'>
In most cases the response packet is lost because the router in question
was disconnected by the user. Resending the control packet in that case
just adds unnecessary delays, so disable that for intra-domain control
packets. For inter-domain (XDomain) packets we continue retrying.

This also aligns the driver better what the Intel connection manager
firmware is doing.

Signed-off-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>thunderbolt: ctl: Fix kernel-doc descriptions of non-static functions</title>
<updated>2021-02-04T07:38:37+00:00</updated>
<author>
<name>Mika Westerberg</name>
<email>mika.westerberg@linux.intel.com</email>
</author>
<published>2021-01-28T10:05:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9c3db0b7b29a5078f34b1e41c76d22a736f95c24'/>
<id>urn:sha1:9c3db0b7b29a5078f34b1e41c76d22a736f95c24</id>
<content type='text'>
Fix kernel-doc descriptions of all non-static functions and struct
tb_cfg. Gets rid of several warnings on W=1 builds too.

Reported-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Signed-off-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
Reviewed-by: Lee Jones &lt;lee.jones@linaro.org&gt;
</content>
</entry>
<entry>
<title>thunderbolt: ctl: Demote non-conformant kernel-doc headers</title>
<updated>2021-01-28T09:55:28+00:00</updated>
<author>
<name>Lee Jones</name>
<email>lee.jones@linaro.org</email>
</author>
<published>2021-01-27T11:25:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=aa60825391b6b7b6b65fb72676145db4befcc6f9'/>
<id>urn:sha1:aa60825391b6b7b6b65fb72676145db4befcc6f9</id>
<content type='text'>
Fixes the following W=1 kernel build warning(s):

 drivers/thunderbolt/ctl.c:38: warning: expecting prototype for struct tb_cfg. Prototype was for struct tb_ctl instead
 drivers/thunderbolt/ctl.c:350: warning: Function parameter or member 'ctl' not described in 'tb_ctl_tx'
 drivers/thunderbolt/ctl.c:350: warning: Function parameter or member 'data' not described in 'tb_ctl_tx'
 drivers/thunderbolt/ctl.c:350: warning: Function parameter or member 'len' not described in 'tb_ctl_tx'
 drivers/thunderbolt/ctl.c:350: warning: Function parameter or member 'type' not described in 'tb_ctl_tx'
 drivers/thunderbolt/ctl.c:350: warning: expecting prototype for tb_cfg_tx(). Prototype was for tb_ctl_tx() instead
 drivers/thunderbolt/ctl.c:383: warning: Function parameter or member 'ctl' not described in 'tb_ctl_handle_event'
 drivers/thunderbolt/ctl.c:383: warning: Function parameter or member 'type' not described in 'tb_ctl_handle_event'
 drivers/thunderbolt/ctl.c:383: warning: Function parameter or member 'pkg' not described in 'tb_ctl_handle_event'
 drivers/thunderbolt/ctl.c:383: warning: Function parameter or member 'size' not described in 'tb_ctl_handle_event'

Cc: Andreas Noever &lt;andreas.noever@gmail.com&gt;
Cc: Michael Jamet &lt;michael.jamet@intel.com&gt;
Cc: Yehezkel Bernat &lt;YehezkelShB@gmail.com&gt;
Cc: linux-usb@vger.kernel.org
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
[ mw: Demote only static functions ]
Signed-off-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
</content>
</entry>
</feed>
