* [PATCH] thunderbolt: Process xdomain response packets synchronously
@ 2025-06-25 6:25 zhangjianrong
2025-06-25 6:40 ` Mika Westerberg
0 siblings, 1 reply; 2+ messages in thread
From: zhangjianrong @ 2025-06-25 6:25 UTC (permalink / raw)
To: andreas.noever, michael.jamet, mika.westerberg, YehezkelShB,
linux-usb, linux-kernel
Cc: guhengsheng, caiyadong, xuetao09, lixinghang1
Xdomain response packets don't belong to async event. It seems
no harm now but better to be fixed.
Signed-off-by: zhangjianrong <zhangjianrong5@huawei.com>
---
drivers/thunderbolt/ctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/thunderbolt/ctl.c b/drivers/thunderbolt/ctl.c
index 4bdb2d45e0bf..1873b64caf7c 100644
--- a/drivers/thunderbolt/ctl.c
+++ b/drivers/thunderbolt/ctl.c
@@ -461,6 +461,7 @@ static void tb_ctl_rx_callback(struct tb_ring *ring, struct ring_frame *frame,
case TB_CFG_PKG_ERROR:
case TB_CFG_PKG_OVERRIDE:
case TB_CFG_PKG_RESET:
+ case TB_CFG_PKG_XDOMAIN_RESP:
if (*(__be32 *)(pkg->buffer + frame->size) != crc32) {
tb_ctl_err(pkg->ctl,
"RX: checksum mismatch, dropping packet\n");
@@ -474,7 +475,6 @@ static void tb_ctl_rx_callback(struct tb_ring *ring, struct ring_frame *frame,
break;
case TB_CFG_PKG_EVENT:
- case TB_CFG_PKG_XDOMAIN_RESP:
case TB_CFG_PKG_XDOMAIN_REQ:
if (*(__be32 *)(pkg->buffer + frame->size) != crc32) {
tb_ctl_err(pkg->ctl,
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] thunderbolt: Process xdomain response packets synchronously
2025-06-25 6:25 [PATCH] thunderbolt: Process xdomain response packets synchronously zhangjianrong
@ 2025-06-25 6:40 ` Mika Westerberg
0 siblings, 0 replies; 2+ messages in thread
From: Mika Westerberg @ 2025-06-25 6:40 UTC (permalink / raw)
To: zhangjianrong
Cc: andreas.noever, michael.jamet, YehezkelShB, linux-usb,
linux-kernel, guhengsheng, caiyadong, xuetao09, lixinghang1
On Wed, Jun 25, 2025 at 02:25:05PM +0800, zhangjianrong wrote:
> Xdomain response packets don't belong to async event. It seems
> no harm now but better to be fixed.
It seems odd but the protocol actually uses RESP packets also with requests
(probably a typo in the original specs but this is what Apple also
implemented so we need to support it). So we need to deal with them.
Did you try if this patch works against macOS for example?
>
> Signed-off-by: zhangjianrong <zhangjianrong5@huawei.com>
> ---
> drivers/thunderbolt/ctl.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/thunderbolt/ctl.c b/drivers/thunderbolt/ctl.c
> index 4bdb2d45e0bf..1873b64caf7c 100644
> --- a/drivers/thunderbolt/ctl.c
> +++ b/drivers/thunderbolt/ctl.c
> @@ -461,6 +461,7 @@ static void tb_ctl_rx_callback(struct tb_ring *ring, struct ring_frame *frame,
> case TB_CFG_PKG_ERROR:
> case TB_CFG_PKG_OVERRIDE:
> case TB_CFG_PKG_RESET:
> + case TB_CFG_PKG_XDOMAIN_RESP:
> if (*(__be32 *)(pkg->buffer + frame->size) != crc32) {
> tb_ctl_err(pkg->ctl,
> "RX: checksum mismatch, dropping packet\n");
> @@ -474,7 +475,6 @@ static void tb_ctl_rx_callback(struct tb_ring *ring, struct ring_frame *frame,
> break;
>
> case TB_CFG_PKG_EVENT:
> - case TB_CFG_PKG_XDOMAIN_RESP:
> case TB_CFG_PKG_XDOMAIN_REQ:
> if (*(__be32 *)(pkg->buffer + frame->size) != crc32) {
> tb_ctl_err(pkg->ctl,
> --
> 2.34.1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-06-25 6:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-25 6:25 [PATCH] thunderbolt: Process xdomain response packets synchronously zhangjianrong
2025-06-25 6:40 ` Mika Westerberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox