[PATCH v1 1/2] Bluetooth: btnxpuart: Add msleep() after changing the baudrate
From: Neeraj Sanjay Kale
Date: Thu Mar 27 2025 - 14:23:48 EST
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@xxxxxxx>
---
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