]>
Commit | Line | Data |
---|---|---|
1e3be614 GKH |
1 | From 77f328dbc6cf42f22c691a164958a5452142a542 Mon Sep 17 00:00:00 2001 |
2 | From: Sean Wang <sean.wang@mediatek.com> | |
3 | Date: Fri, 15 Feb 2019 07:19:35 +0800 | |
4 | Subject: Bluetooth: mediatek: fix up an error path to restore bdev->tx_state | |
5 | ||
6 | From: Sean Wang <sean.wang@mediatek.com> | |
7 | ||
8 | commit 77f328dbc6cf42f22c691a164958a5452142a542 upstream. | |
9 | ||
10 | Restore bdev->tx_state with clearing bit BTMTKUART_TX_WAIT_VND_EVT | |
11 | when there is an error on waiting for the corresponding event. | |
12 | ||
13 | Fixes: 7237c4c9ec92 ("Bluetooth: mediatek: Add protocol support for MediaTek serial devices") | |
14 | Signed-off-by: Sean Wang <sean.wang@mediatek.com> | |
15 | Signed-off-by: Marcel Holtmann <marcel@holtmann.org> | |
16 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
17 | ||
18 | --- | |
19 | drivers/bluetooth/btmtkuart.c | 2 ++ | |
20 | 1 file changed, 2 insertions(+) | |
21 | ||
22 | --- a/drivers/bluetooth/btmtkuart.c | |
23 | +++ b/drivers/bluetooth/btmtkuart.c | |
24 | @@ -115,11 +115,13 @@ static int mtk_hci_wmt_sync(struct hci_d | |
25 | TASK_INTERRUPTIBLE, HCI_INIT_TIMEOUT); | |
26 | if (err == -EINTR) { | |
27 | bt_dev_err(hdev, "Execution of wmt command interrupted"); | |
28 | + clear_bit(BTMTKUART_TX_WAIT_VND_EVT, &bdev->tx_state); | |
29 | return err; | |
30 | } | |
31 | ||
32 | if (err) { | |
33 | bt_dev_err(hdev, "Execution of wmt command timed out"); | |
34 | + clear_bit(BTMTKUART_TX_WAIT_VND_EVT, &bdev->tx_state); | |
35 | return -ETIMEDOUT; | |
36 | } | |
37 |