Thread (22 messages) 22 messages, 4 authors, 2025-08-27

Re: [PATCH] Bluetooth: btusb: Fixup quirk for reading ext features on some Barrot controllers

From: Arkadiusz Bokowy <hidden>
Date: 2025-08-25 20:16:57

quoted hunk ↗ jump to hunk
Could we solve this by doing:
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 3595a8bad6bd..168b07041605 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -1194,6 +1194,17 @@ static int btusb_recv_intr(struct btusb_data
*data, void *buffer, int count)
                }

                if (!hci_skb_expect(skb)) {
+                       /* Each chunk should correct to at least 1 or
more events
+                        * so if there are still bytes left that
doesn't constitute a new
+                         * event this is likely a bug in the controller.
+                        */
+                       if (count && count < HCI_EVENT_HDR_SIZE) {
+                               bt_dev_warn(data->hdev,
+                                           "Unexpected continuation: %d bytes",
+                                           count);
+                               count = 0;
+                       }
+
Yes, it should work. I was afraid that a simple patch like that, that
affects all other controllers, might break something. So, instead,
I've added a dedicated quirk only for affected controllers and only
for 0x1004 command. I can test it later, but it's simple enough that
even without testing one might tell that it will work as expected :)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help