public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/2] Bluetooth: btnxpuart: Add msleep() after changing the baudrate
@ 2025-03-27 18:25 Neeraj Sanjay Kale
  2025-03-27 18:25 ` [PATCH v1 2/2] Bluetooth: btnxpuart: Add an error message if FW dump trigger fails Neeraj Sanjay Kale
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Neeraj Sanjay Kale @ 2025-03-27 18:25 UTC (permalink / raw)
  To: marcel, luiz.dentz
  Cc: linux-bluetooth, linux-kernel, amitkumar.karwar,
	neeraj.sanjaykale, sherry.sun

This adds a 100 millisec sleep after change baudrate vendor command.

It is observed that when the baudrate change command changes the
baudrate from 3000000 to 115200, any immediate HCI command returns an
error -22 (Device Busy).

Adding a small delay after the change baudrate command complete event is
received helps fix the issue.

Signed-off-by: Neeraj Sanjay Kale <neeraj.sanjaykale@nxp.com>
---
 drivers/bluetooth/btnxpuart.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/bluetooth/btnxpuart.c b/drivers/bluetooth/btnxpuart.c
index 5091dea762a0..e26fabe8fb3d 100644
--- a/drivers/bluetooth/btnxpuart.c
+++ b/drivers/bluetooth/btnxpuart.c
@@ -1238,6 +1238,8 @@ static int nxp_set_baudrate_cmd(struct hci_dev *hdev, void *data)
 		if (*status == 0) {
 			serdev_device_set_baudrate(nxpdev->serdev, nxpdev->new_baudrate);
 			nxpdev->current_baudrate = nxpdev->new_baudrate;
+			/* Allow sufficiant time for chip to switch to new baudrate */
+			sleep(100);
 		}
 		bt_dev_dbg(hdev, "Set baudrate response: status=%d, baudrate=%d",
 			   *status, nxpdev->new_baudrate);
-- 
2.25.1


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

end of thread, other threads:[~2025-04-04  2:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-27 18:25 [PATCH v1 1/2] Bluetooth: btnxpuart: Add msleep() after changing the baudrate Neeraj Sanjay Kale
2025-03-27 18:25 ` [PATCH v1 2/2] Bluetooth: btnxpuart: Add an error message if FW dump trigger fails Neeraj Sanjay Kale
2025-03-27 19:04 ` [v1,1/2] Bluetooth: btnxpuart: Add msleep() after changing the baudrate bluez.test.bot
2025-03-27 21:52 ` [PATCH v1 1/2] " Paul Menzel
2025-03-28 19:09   ` Neeraj Sanjay Kale
2025-03-28 13:55 ` Sherry Sun
2025-04-03 20:20 ` patchwork-bot+bluetooth
2025-04-04  2:40   ` Neeraj Sanjay Kale

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