]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/5.0.14/bluetooth-mediatek-fix-up-an-error-path-to-restore-bdev-tx_state.patch
Linux 5.0.14
[thirdparty/kernel/stable-queue.git] / releases / 5.0.14 / bluetooth-mediatek-fix-up-an-error-path-to-restore-bdev-tx_state.patch
CommitLineData
1e3be614
GKH
1From 77f328dbc6cf42f22c691a164958a5452142a542 Mon Sep 17 00:00:00 2001
2From: Sean Wang <sean.wang@mediatek.com>
3Date: Fri, 15 Feb 2019 07:19:35 +0800
4Subject: Bluetooth: mediatek: fix up an error path to restore bdev->tx_state
5
6From: Sean Wang <sean.wang@mediatek.com>
7
8commit 77f328dbc6cf42f22c691a164958a5452142a542 upstream.
9
10Restore bdev->tx_state with clearing bit BTMTKUART_TX_WAIT_VND_EVT
11when there is an error on waiting for the corresponding event.
12
13Fixes: 7237c4c9ec92 ("Bluetooth: mediatek: Add protocol support for MediaTek serial devices")
14Signed-off-by: Sean Wang <sean.wang@mediatek.com>
15Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
16Signed-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