Skip to contentSkip to conversation

FAILED: patch "[PATCH] Bluetooth: Skip the shutdown routine if the interface is not" failed to apply to 4.0-stable tree

PATCH [email protected] 1 participant 1 message Jun 3, 2015

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 4.0-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

Quoted 1 line

From d24d81444f8caf1895256ef2d2e89ae8202a17e4 Mon Sep 17 00:00:00 2001

From: Gabriele Mazzotta <[email protected]>
Date: Sun, 26 Apr 2015 20:51:50 +0200
Subject: [PATCH] Bluetooth: Skip the shutdown routine if the interface is not
up

Most likely, the shutdown routine requires the interface to be up. This is the case for BTUSB_INTEL: the routine tries to send a command to the interface, but since this one is down, it fails and exits once HCI_INIT_TIMEOUT has expired.

net/bluetooth/hci_core.c +2 -1
index 476709bd068a..4663c3dad3f5 100644
@@ -1557,7 +1557,8 @@ static int hci_dev_do_close(struct hci_dev *hdev)
 {
 	BT_DBG("%s %p", hdev->name, hdev);
 
-	if (!hci_dev_test_flag(hdev, HCI_UNREGISTER)) {
+	if (!hci_dev_test_flag(hdev, HCI_UNREGISTER) &&
+	    test_bit(HCI_UP, &hdev->flags)) {
 		/* Execute vendor specific shutdown routine */
 		if (hdev->shutdown)
 			hdev->shutdown(hdev);