From: Sean Wang <sean.w...@mediatek.com>

commit 77f328dbc6cf42f22c691a164958a5452142a542 upstream.

Restore bdev->tx_state with clearing bit BTMTKUART_TX_WAIT_VND_EVT
when there is an error on waiting for the corresponding event.

Fixes: 7237c4c9ec92 ("Bluetooth: mediatek: Add protocol support for MediaTek 
serial devices")
Signed-off-by: Sean Wang <sean.w...@mediatek.com>
Signed-off-by: Marcel Holtmann <mar...@holtmann.org>
Signed-off-by: Greg Kroah-Hartman <gre...@linuxfoundation.org>

---
 drivers/bluetooth/btmtkuart.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/drivers/bluetooth/btmtkuart.c
+++ b/drivers/bluetooth/btmtkuart.c
@@ -115,11 +115,13 @@ static int mtk_hci_wmt_sync(struct hci_d
                                  TASK_INTERRUPTIBLE, HCI_INIT_TIMEOUT);
        if (err == -EINTR) {
                bt_dev_err(hdev, "Execution of wmt command interrupted");
+               clear_bit(BTMTKUART_TX_WAIT_VND_EVT, &bdev->tx_state);
                return err;
        }
 
        if (err) {
                bt_dev_err(hdev, "Execution of wmt command timed out");
+               clear_bit(BTMTKUART_TX_WAIT_VND_EVT, &bdev->tx_state);
                return -ETIMEDOUT;
        }
 


Reply via email to