]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
Bluetooth: btnxpuart: Fix driver sending truncated data
authorNeeraj Sanjay Kale <neeraj.sanjaykale@nxp.com>
Fri, 20 Dec 2024 13:02:52 +0000 (18:32 +0530)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Wed, 8 Jan 2025 16:14:02 +0000 (11:14 -0500)
This fixes the apparent controller hang issue seen during stress test
where the host sends a truncated payload, followed by HCI commands. The
controller treats these HCI commands as a part of previously truncated
payload, leading to command timeouts.

Adding a serdev_device_wait_until_sent() call after
serdev_device_write_buf() fixed the issue.

Fixes: 689ca16e5232 ("Bluetooth: NXP: Add protocol support for NXP Bluetooth chipsets")
Signed-off-by: Neeraj Sanjay Kale <neeraj.sanjaykale@nxp.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
drivers/bluetooth/btnxpuart.c

index 569f5b7d6e46f2b61c792e7b7beea5f9af7ca217..1230045d78a5f06b8beb623d73e2c54a2d78a65c 100644 (file)
@@ -1381,6 +1381,7 @@ static void btnxpuart_tx_work(struct work_struct *work)
 
        while ((skb = nxp_dequeue(nxpdev))) {
                len = serdev_device_write_buf(serdev, skb->data, skb->len);
+               serdev_device_wait_until_sent(serdev, 0);
                hdev->stat.byte_tx += len;
 
                skb_pull(skb, len);