public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] Bluetooth: btnxpuart: Fix driver sending truncated data
@ 2024-12-20 13:02 Neeraj Sanjay Kale
  2025-01-08 16:10 ` patchwork-bot+bluetooth
  0 siblings, 1 reply; 2+ messages in thread
From: Neeraj Sanjay Kale @ 2024-12-20 13:02 UTC (permalink / raw)
  To: marcel, luiz.dentz, ilpo.jarvinen
  Cc: linux-bluetooth, linux-kernel, amitkumar.karwar,
	neeraj.sanjaykale, sherry.sun, ziniu.wang_1

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>
---
 drivers/bluetooth/btnxpuart.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/bluetooth/btnxpuart.c b/drivers/bluetooth/btnxpuart.c
index 569f5b7d6e46..1230045d78a5 100644
--- a/drivers/bluetooth/btnxpuart.c
+++ b/drivers/bluetooth/btnxpuart.c
@@ -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);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v1] Bluetooth: btnxpuart: Fix driver sending truncated data
  2024-12-20 13:02 [PATCH v1] Bluetooth: btnxpuart: Fix driver sending truncated data Neeraj Sanjay Kale
@ 2025-01-08 16:10 ` patchwork-bot+bluetooth
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+bluetooth @ 2025-01-08 16:10 UTC (permalink / raw)
  To: Neeraj Sanjay Kale
  Cc: marcel, luiz.dentz, ilpo.jarvinen, linux-bluetooth, linux-kernel,
	amitkumar.karwar, sherry.sun, ziniu.wang_1

Hello:

This patch was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Fri, 20 Dec 2024 18:32:52 +0530 you wrote:
> 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.
> 
> [...]

Here is the summary with links:
  - [v1] Bluetooth: btnxpuart: Fix driver sending truncated data
    https://git.kernel.org/bluetooth/bluetooth-next/c/fb966c19be55

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-01-08 16:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-20 13:02 [PATCH v1] Bluetooth: btnxpuart: Fix driver sending truncated data Neeraj Sanjay Kale
2025-01-08 16:10 ` patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox