Skip to contentSkip to conversation

Bluetooth: btusb: Fix Intel controller hang after shutdown

PATCH Superseded Loic Poulain 2 participants 2 messages May 21, 2015 Bluetooth drivers

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Bluetooth: btusb: Fix Intel controller hang after shutdown

The vendor command (0xfc3f) in btusb_shutdown_intel causes an internal reset with old firmware. The controller has a bug with the first HCI command sent to it. The workaround is to send HCI Reset command first which will reset the number of completed commands.

This patch adds the HCI_QUIRK_RESET_ON_CLOSE flag for Intel controller so that a HCI reset command will always follow a intel shutdown.

---
 drivers/bluetooth/btusb.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/bluetooth/btusb.c +7 -0
index d21f3b4..36881e8 100644
@@ -3140,6 +3140,13 @@ static int btusb_probe(struct usb_interface *intf,
 		hdev->set_bdaddr = btintel_set_bdaddr;
 		set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks);
 		set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks);
+
+		/* The shutdown causes an internal reset with old firmware.
+		 * In order to avoid the Bug with the first HCI command, we have
+		 * to send a HCI reset which will reset the number of completed
+		 * command.
+		 */
+		set_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks);
 	}
 
 	if (id->driver_info & BTUSB_INTEL_NEW) {
Signature · 1 line
1.9.1
maintainer
#1 lore raw

Hi Loic,

Quoted 18 lines

The vendor command (0xfc3f) in btusb_shutdown_intel causes an internal reset with old firmware. The controller has a bug with the first HCI command sent to it. The workaround is to send HCI Reset command first which will reset the number of completed commands.

This patch adds the HCI_QUIRK_RESET_ON_CLOSE flag for Intel controller so that a HCI reset command will always follow a intel shutdown.

---
drivers/bluetooth/btusb.c | 7 +++++++

1 file changed, 7 insertions(+)
drivers/bluetooth/btusb.c +0 -0
index d21f3b4..36881e8 100644

drivers/bluetooth/btusb.c static int btusb_probe(struct usb_interface *intf, · line 3149

Quoted 10 lines
drivers/bluetooth/btusb.c +7 -0
@@ -3140,6 +3140,13 @@ static int btusb_probe(struct usb_interface *intf,
 		hdev->set_bdaddr = btintel_set_bdaddr;
 		set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks);
 		set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks);
+
+		/* The shutdown causes an internal reset with old firmware.
+		 * In order to avoid the Bug with the first HCI command, we have
+		 * to send a HCI reset which will reset the number of completed
+		 * command.
+		 */
+		set_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks);

the problem with this quirk is that the HCI Reset is now never sent when brining up the controller. That is not the right fix either. I think it needs to be in the Intel specific shutdown callback.

Not sending HCI Reset as the first command should only be done for Bluetooth 1.0b controllers and some Bluetooth 1.1 controllers. For all others sending HCI Reset as first command is the right thing to do.

Regards

Marcel