lede/target/linux/silicon/patches-5.19/0132-dockchannel-hid-Drop-incoming-packet-sequence-requir.patch

63 lines
1.9 KiB
Diff

From 91667ca639d453c52047193fddc1c23b44dae6fc Mon Sep 17 00:00:00 2001
From: Hector Martin <marcan@marcan.st>
Date: Sun, 17 Jul 2022 18:38:54 +0900
Subject: [PATCH 132/171] dockchannel-hid: Drop incoming packet sequence
requirements
Looks like this isn't reliable (suspected race condition in MTP
firmware...)
Signed-off-by: Hector Martin <marcan@marcan.st>
---
drivers/hid/dockchannel-hid/dockchannel-hid.c | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/drivers/hid/dockchannel-hid/dockchannel-hid.c b/drivers/hid/dockchannel-hid/dockchannel-hid.c
index aaa7d357c6fa..07ac3a77c390 100644
--- a/drivers/hid/dockchannel-hid/dockchannel-hid.c
+++ b/drivers/hid/dockchannel-hid/dockchannel-hid.c
@@ -152,7 +152,6 @@ struct dchid_iface {
const struct device_node *of_node;
uint8_t tx_seq;
- uint8_t rx_seq;
bool deferred;
bool open;
@@ -858,7 +857,7 @@ static void dchid_handle_ack(struct dchid_iface *iface, struct dchid_hdr *hdr, v
}
if (shdr->flags != iface->out_flags) {
dev_err(iface->dchid->dev,
- "Received unexpected flags 0x%x on ACK channel (expected 0x%x)\n",
+ "Received unexpected flags 0x%x on ACK channel (expFected 0x%x)\n",
shdr->flags, iface->out_flags);
return;
}
@@ -869,7 +868,7 @@ static void dchid_handle_ack(struct dchid_iface *iface, struct dchid_hdr *hdr, v
}
if (iface->tx_seq != hdr->seq) {
dev_err(iface->dchid->dev, "Received ACK with bad seq (expected %d, got %d)\n",
- iface->rx_seq, hdr->seq);
+ iface->tx_seq, hdr->seq);
return;
}
if (iface->out_report != payload[0]) {
@@ -943,14 +942,6 @@ static void dchid_handle_packet(void *cookie, size_t avail)
break;
}
- if (hdr.seq != iface->rx_seq) {
- dev_err(dchid->dev, "Received packet out of sequence (expected %d, got %d)\n",
- iface->rx_seq, hdr.seq);
- goto done;
- }
-
- iface->rx_seq++;
-
work = kzalloc(sizeof(*work) + hdr.length, GFP_KERNEL);
if (!work)
return;
--
2.34.1