[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<DB9PR04MB8429BC22B2C984ABE68350E492A02@DB9PR04MB8429.eurprd04.prod.outlook.com>
Date: Fri, 28 Mar 2025 13:55:45 +0000
From: Sherry Sun <sherry.sun@....com>
To: Neeraj Sanjay Kale <neeraj.sanjaykale@....com>, "marcel@...tmann.org"
<marcel@...tmann.org>, "luiz.dentz@...il.com" <luiz.dentz@...il.com>
CC: "linux-bluetooth@...r.kernel.org" <linux-bluetooth@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, Amitkumar
Karwar <amitkumar.karwar@....com>
Subject: RE: [PATCH v1 1/2] Bluetooth: btnxpuart: Add msleep() after changing
the baudrate
> -----Original Message-----
> From: Neeraj Sanjay Kale <neeraj.sanjaykale@....com>
> Sent: Friday, March 28, 2025 2:25 AM
> To: marcel@...tmann.org; luiz.dentz@...il.com
> Cc: linux-bluetooth@...r.kernel.org; linux-kernel@...r.kernel.org;
> Amitkumar Karwar <amitkumar.karwar@....com>; Neeraj Sanjay Kale
> <neeraj.sanjaykale@....com>; Sherry Sun <sherry.sun@....com>
> Subject: [PATCH v1 1/2] Bluetooth: btnxpuart: Add msleep() after changing the
> baudrate
>
> 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@....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);
Hi Neeraj,
Assuming that msleep() should be used here, sleep (100) means 100 seconds of sleep, too crazy :)
Best Regards
Sherry
> }
> bt_dev_dbg(hdev, "Set baudrate response: status=%d,
> baudrate=%d",
> *status, nxpdev->new_baudrate);
> --
> 2.25.1
Powered by blists - more mailing lists