Patch "Bluetooth: btusb: Fix not handling ZPL/short-transfer" has been added to the 5.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    Bluetooth: btusb: Fix not handling ZPL/short-transfer

to the 5.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     bluetooth-btusb-fix-not-handling-zpl-short-transfer.patch
and it can be found in the queue-5.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 41b7b7b2061d763749874a076f3f5d75c9d270e0
Author: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>
Date:   Mon Sep 9 16:51:52 2024 -0400

    Bluetooth: btusb: Fix not handling ZPL/short-transfer
    
    [ Upstream commit 7b05933340f4490ef5b09e84d644d12484b05fdf ]
    
    Requesting transfers of the exact same size of wMaxPacketSize may result
    in ZPL/short-transfer since the USB stack cannot handle it as we are
    limiting the buffer size to be the same as wMaxPacketSize.
    
    Also, in terms of throughput this change has the same effect to
    interrupt endpoint as 290ba200815f "Bluetooth: Improve USB driver throughput
    by increasing the frame size" had for the bulk endpoint, so users of the
    advertisement bearer (e.g. BT Mesh) may benefit from this change.
    
    Fixes: 5e23b923da03 ("[Bluetooth] Add generic driver for Bluetooth USB devices")
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>
    Tested-by: Kiran K <kiran.k@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index b9752625c88b4..87392ceee3dba 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -834,7 +834,10 @@ static int btusb_submit_intr_urb(struct hci_dev *hdev, gfp_t mem_flags)
 	if (!urb)
 		return -ENOMEM;
 
-	size = le16_to_cpu(data->intr_ep->wMaxPacketSize);
+	/* Use maximum HCI Event size so the USB stack handles
+	 * ZPL/short-transfer automatically.
+	 */
+	size = HCI_MAX_EVENT_SIZE;
 
 	buf = kmalloc(size, mem_flags);
 	if (!buf) {




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux