Commit 7bdb8a5c authored by Szymon Janc's avatar Szymon Janc Committed by Gustavo F. Padovan

Bluetooth: Don't use cmd_timer to timeout HCI reset command

No command should be send before Command Complete event for HCI
reset is received. This fix regression introduced by commit
6bd32326(Bluetooth: Use proper timer for hci command timout)
for chips whose reset command takes longer to complete (e.g. CSR)
resulting in next command being send before HCI reset completed.
Signed-off-by: default avatarSzymon Janc <szymon@janc.net.pl>
Signed-off-by: default avatarGustavo F. Padovan <padovan@profusion.mobi>
parent 6be6b11f
...@@ -1209,7 +1209,6 @@ static void hci_cmd_timer(unsigned long arg) ...@@ -1209,7 +1209,6 @@ static void hci_cmd_timer(unsigned long arg)
BT_ERR("%s command tx timeout", hdev->name); BT_ERR("%s command tx timeout", hdev->name);
atomic_set(&hdev->cmd_cnt, 1); atomic_set(&hdev->cmd_cnt, 1);
clear_bit(HCI_RESET, &hdev->flags);
tasklet_schedule(&hdev->cmd_task); tasklet_schedule(&hdev->cmd_task);
} }
...@@ -2408,6 +2407,9 @@ static void hci_cmd_task(unsigned long arg) ...@@ -2408,6 +2407,9 @@ static void hci_cmd_task(unsigned long arg)
if (hdev->sent_cmd) { if (hdev->sent_cmd) {
atomic_dec(&hdev->cmd_cnt); atomic_dec(&hdev->cmd_cnt);
hci_send_frame(skb); hci_send_frame(skb);
if (test_bit(HCI_RESET, &hdev->flags))
del_timer(&hdev->cmd_timer);
else
mod_timer(&hdev->cmd_timer, mod_timer(&hdev->cmd_timer,
jiffies + msecs_to_jiffies(HCI_CMD_TIMEOUT)); jiffies + msecs_to_jiffies(HCI_CMD_TIMEOUT));
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment