* [PATCH] Bluetooth: hci_ll: Sleep while waiting for the controller to power up
@ 2026-09-07 15:12 Xuhua Zhang
2026-09-08 16:30 ` patchwork-bot+bluetooth
0 siblings, 1 reply; 2+ messages in thread
From: Xuhua Zhang @ 2026-09-07 15:12 UTC (permalink / raw)
To: marcel, luiz.dentz; +Cc: linux-bluetooth, linux-kernel, Xuhua Zhang
ll_setup() busy-waits for 100 ms after asserting the controller enable
GPIO on each firmware download attempt. With retries this can occupy
the CPU for up to 400 ms.
The setup callback runs in sleepable context and already uses msleep(),
gpiod_set_value_cansleep() and synchronous firmware commands. Replace
mdelay(100) with msleep(100) so the CPU can run other work during the
power-up delay. Keep the requested delay and subsequent CTS wait.
Signed-off-by: Xuhua Zhang <zhangxuhua@kylinsec.com.cn>
---
drivers/bluetooth/hci_ll.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/bluetooth/hci_ll.c b/drivers/bluetooth/hci_ll.c
index ab744001dafc..35adf869cc1f 100644
--- a/drivers/bluetooth/hci_ll.c
+++ b/drivers/bluetooth/hci_ll.c
@@ -629,7 +629,7 @@ static int ll_setup(struct hci_uart *hu)
gpiod_set_value_cansleep(lldev->enable_gpio, 0);
msleep(5);
gpiod_set_value_cansleep(lldev->enable_gpio, 1);
- mdelay(100);
+ msleep(100);
err = serdev_device_wait_for_cts(serdev, true, 200);
if (err) {
bt_dev_err(hu->hdev, "Failed to get CTS");
--
2.43.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Bluetooth: hci_ll: Sleep while waiting for the controller to power up
2026-09-07 15:12 [PATCH] Bluetooth: hci_ll: Sleep while waiting for the controller to power up Xuhua Zhang
@ 2026-09-08 16:30 ` patchwork-bot+bluetooth
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+bluetooth @ 2026-09-08 16:30 UTC (permalink / raw)
To: Xuhua Zhang; +Cc: marcel, luiz.dentz, linux-bluetooth, linux-kernel
Hello:
This patch was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:
On Mon, 7 Sep 2026 23:12:45 +0800 you wrote:
> ll_setup() busy-waits for 100 ms after asserting the controller enable
> GPIO on each firmware download attempt. With retries this can occupy
> the CPU for up to 400 ms.
>
> The setup callback runs in sleepable context and already uses msleep(),
> gpiod_set_value_cansleep() and synchronous firmware commands. Replace
> mdelay(100) with msleep(100) so the CPU can run other work during the
> power-up delay. Keep the requested delay and subsequent CTS wait.
>
> [...]
Here is the summary with links:
- Bluetooth: hci_ll: Sleep while waiting for the controller to power up
https://git.kernel.org/bluetooth/bluetooth-next/c/1d978753498a
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:[~2026-09-08 16:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-07 15:12 [PATCH] Bluetooth: hci_ll: Sleep while waiting for the controller to power up Xuhua Zhang
2026-09-08 16:30 ` 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
all inboxes | Powered by JetHome®