diff options
author | Szymon Janc <szymon@janc.net.pl> | 2011-07-26 16:46:54 -0400 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-08-11 18:50:27 -0400 |
commit | 7bdb8a5cf17f66614a9897645efcd4ccc27535ee (patch) | |
tree | 21ad289a5ee0b6d7f7d4cc1522528ac7352aaabf /net | |
parent | 6be6b11f006840ba7d8d4b959b3fa0c522f8468a (diff) |
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
6bd32326cda(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: Szymon Janc <szymon@janc.net.pl>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net')
-rw-r--r-- | net/bluetooth/hci_core.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index fca62dcd7f1b..56943add45cc 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c | |||
@@ -1209,7 +1209,6 @@ static void hci_cmd_timer(unsigned long arg) | |||
1209 | 1209 | ||
1210 | BT_ERR("%s command tx timeout", hdev->name); | 1210 | BT_ERR("%s command tx timeout", hdev->name); |
1211 | atomic_set(&hdev->cmd_cnt, 1); | 1211 | atomic_set(&hdev->cmd_cnt, 1); |
1212 | clear_bit(HCI_RESET, &hdev->flags); | ||
1213 | tasklet_schedule(&hdev->cmd_task); | 1212 | tasklet_schedule(&hdev->cmd_task); |
1214 | } | 1213 | } |
1215 | 1214 | ||
@@ -2408,7 +2407,10 @@ static void hci_cmd_task(unsigned long arg) | |||
2408 | if (hdev->sent_cmd) { | 2407 | if (hdev->sent_cmd) { |
2409 | atomic_dec(&hdev->cmd_cnt); | 2408 | atomic_dec(&hdev->cmd_cnt); |
2410 | hci_send_frame(skb); | 2409 | hci_send_frame(skb); |
2411 | mod_timer(&hdev->cmd_timer, | 2410 | if (test_bit(HCI_RESET, &hdev->flags)) |
2411 | del_timer(&hdev->cmd_timer); | ||
2412 | else | ||
2413 | mod_timer(&hdev->cmd_timer, | ||
2412 | jiffies + msecs_to_jiffies(HCI_CMD_TIMEOUT)); | 2414 | jiffies + msecs_to_jiffies(HCI_CMD_TIMEOUT)); |
2413 | } else { | 2415 | } else { |
2414 | skb_queue_head(&hdev->cmd_q, skb); | 2416 | skb_queue_head(&hdev->cmd_q, skb); |