All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] Bluetooth: btintel: Fix spurious error on FW download error recovery
@ 2026-07-13 21:55 Ameen Al-Asady
  2026-07-13 21:55 ` [PATCH 2/2] Bluetooth: hci_sync: Skip MSFT/AOSP init when controller init failed Ameen Al-Asady
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Ameen Al-Asady @ 2026-07-13 21:55 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Marcel Holtmann, Luiz Augusto von Dentz, Ameen Al-Asady

When firmware download fails because the controller is running an
operational image whose version does not match the firmware file on
disk (the normal case for a firmware upgrade across a warm reboot,
since the operational image survives in controller RAM),
btintel_reset_to_bootloader() sends the Intel Reset vendor command to
force the controller back into bootloader mode for the download retry.

The controller acts on Intel Reset by resetting and re-enumerating on
the bus, which can happen before the command complete event is
delivered. In that case __hci_cmd_sync() fails with -ENODEV and the
driver logs a misleading error even though recovery is proceeding
exactly as intended:

  Bluetooth: hci0: Found device firmware: intel/ibt-0041-0041.sfi
  Bluetooth: hci0: Boot Address: 0x100800
  Bluetooth: hci0: Firmware Version: 202-5.26
  usb 1-6: USB disconnect, device number 4
  Bluetooth: hci0: FW download error recovery failed (-19)
  usb 1-6: new full-speed USB device number 5 using xhci_hcd
  ...
  Bluetooth: hci0: Firmware loaded in 2827613 usecs

Treat -ENODEV as the expected outcome of the reset rather than a
recovery failure, and keep the error message for genuine failures.

Signed-off-by: Ameen Al-Asady <ameenaladdin@gmail.com>
---
 drivers/bluetooth/btintel.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c
index 5e9cac090..472542bff 100644
--- a/drivers/bluetooth/btintel.c
+++ b/drivers/bluetooth/btintel.c
@@ -1363,12 +1363,22 @@ static void btintel_reset_to_bootloader(struct hci_dev *hdev)
 	skb = __hci_cmd_sync(hdev, BTINTEL_HCI_OP_RESET, sizeof(params),
 			     &params, HCI_INIT_TIMEOUT);
 	if (IS_ERR(skb)) {
-		bt_dev_err(hdev, "FW download error recovery failed (%ld)",
-			   PTR_ERR(skb));
-		return;
+		/* The controller acts on Intel Reset by resetting and
+		 * re-enumerating on the bus, which can happen before the
+		 * command complete event is delivered. The resulting
+		 * -ENODEV means the reset took effect, not that recovery
+		 * failed.
+		 */
+		if (PTR_ERR(skb) != -ENODEV) {
+			bt_dev_err(hdev,
+				   "FW download error recovery failed (%ld)",
+				   PTR_ERR(skb));
+			return;
+		}
+	} else {
+		kfree_skb(skb);
 	}
 	bt_dev_info(hdev, "Intel reset sent to retry FW download");
-	kfree_skb(skb);
 
 	/* Current Intel BT controllers(ThP/JfP) hold the USB reset
 	 * lines for 2ms when it receives Intel Reset in bootloader mode.

base-commit: eab19cb7618e5c50fd1f8c1efdc4e66e16575975
-- 
2.55.0


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

end of thread, other threads:[~2026-07-14  3:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-13 21:55 [PATCH 1/2] Bluetooth: btintel: Fix spurious error on FW download error recovery Ameen Al-Asady
2026-07-13 21:55 ` [PATCH 2/2] Bluetooth: hci_sync: Skip MSFT/AOSP init when controller init failed Ameen Al-Asady
2026-07-13 22:50 ` [1/2] Bluetooth: btintel: Fix spurious error on FW download error recovery bluez.test.bot
2026-07-14  0:00 ` [PATCH 1/2] " Paul Menzel
2026-07-14  3:09   ` Ameen Al-Asady

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.