[PATCH] Bluetooth: hci_ll: Sleep while waiting for the controller to power up
From: Xuhua Zhang
Date: Tue Sep 08 2026 - 02:09:07 EST
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@xxxxxxxxxxxxxxx>
---
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