Bluetooth: Fix HCI_RESET command synchronization backported to stable
PATCH 1/1 Bluetooth: Fix HCI_RESET command synchronization backported to stable
backported to stable. did not have the time to compile test this, but patch applies.
Reported-by Mikko Vinni <[email protected]>
Reported-by Justin P. Mattock <[email protected]>
Reported-by Ed Tomlinson <[email protected]>
Signed-off-by Gustavo F. Padovan <[email protected]>
Tested-by Justin P. Mattock <[email protected]>
Tested-by Mikko Vinni <[email protected]>
Tested-by Ed Tomlinson <[email protected]>
include/net/bluetooth/hci.h +1 -0
@@ -74,6 +74,7 @@HCI_AUTH ,HCI_ENCRYPT ,HCI_INQUIRY , +HCI_RESET , HCI_RAW, };
net/bluetooth/hci_core.c +3 -1
@@ -184,6 +184,7 @@BT_DBG ("%s %ld" , hdev->name, opt);/* Reset device */ +set_bit (HCI_RESET , &hdev->flags);hci_send_cmd (hdev,HCI_OP_RESET ,0 ,NULL ); }
@@ -210,7 +211,8 @@/* Mandatory initialization */ /* Reset */ -if (!test_bit (HCI_QUIRK_NO_RESET , &hdev->quirks)) +if (!test_bit (HCI_QUIRK_NO_RESET , &hdev->quirks)) { +set_bit (HCI_RESET , &hdev->flags);hci_send_cmd (hdev,HCI_OP_RESET ,0 ,NULL );/* Read Local Supported Features */
net/bluetooth/hci_event.c +3 -1
@@ -183,6 +183,8 @@BT_DBG ("%s status 0x%x" , hdev->name, status); +clear_bit (HCI_RESET , &hdev->flags); +hci_req_complete (hdev,HCI_OP_RESET , status); }
@@ -1398,7 +1400,7 @@break ; } -if (ev->ncmd) { +if (ev->ncmd && !test_bit (HCI_RESET , &hdev->flags)) {atomic_set (&hdev->cmd_cnt,1 );if (!skb_queue_empty (&hdev->cmd_q))tasklet_schedule (&hdev->cmd_task);
Quoted 1 line · Justin P. Mattock
backported to stable. did not have the time to compile test this, but patch applies.
It applies, but breaks the build.
Care to do this correctly so I can apply it?
thanks,
greg k-h