Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp193205imj; Thu, 14 Feb 2019 18:22:53 -0800 (PST) X-Google-Smtp-Source: AHgI3IbP3OTLUaLs7hKm67lp52ilAoKgc0kOpUoWIqvDXwFH8oiIkvojAJf3hUFITxaWG/F9qTEe X-Received: by 2002:a17:902:b485:: with SMTP id y5mr7598143plr.298.1550197373839; Thu, 14 Feb 2019 18:22:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550197373; cv=none; d=google.com; s=arc-20160816; b=nXpmwvy2QSfqpZ9aK9wzywyaJbSbDaO+pwLi7zoB+cJenlIG4QGuy3t60mzjJVCq3f V5Y1qF9LjpjX90yhj5t6yylqoDpQv9IC0JI/mW3JGTA5MQYYyT6XiBbAGVpn06UOarej v3ouA+OedlJaE5lq/7fNTmkCi/YS/IPVj+AEmOaLIrX5+bzEKEwWLeLNA2jxPBBvYcuf YP7/SreJw1uA0axHz8wO0FTiEk0ihBAdsfRpY1nHT0IUa8ESZOW1LeLIpST7hpEyYv+k eQB7PEXIG9lu+rgqtYnTxzw9QYsvnEXWJiemGsJbvKLOrPzTRrfP2+NMCZNkNCgoTIp9 c+Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=MJVskcncRrpX5+wgMWYZ/Phut1nFqEgpY8x9PBE8Q0k=; b=fBgG9tBHVc6Qtg6REPk5dhFBuuiJ6tPBmQ8fa0MRVWeLBNxuz0S74FBWT/s/wAWr4M UDw+rSE/6dGnrXA6MlXVkDqHMbV3z8KiwTM0J8rl1jBp9Hj1CmkFa2YHP21D57Ely8Yf ItqrDBzaaDkS4yiFi7wfd+I1BS8k2+4MQuykMfXF0CpBchgfItNHYowiS1POoro2QF9O L38GAkWKB2pHV6Sh2//U7CIfyWS+tdif4XJrS7ScOUOJ7KJQ889kK+7JJ9a7mZ3XylQj /hYr5LxdynNfxKlJ3mWqmTo02QT0Dd7Z2lss4N+8YTqlqX/BDAZAmHK7ZcmuLYBpyKEB axWA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b86si4310103pfc.217.2019.02.14.18.22.38; Thu, 14 Feb 2019 18:22:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388125AbfBNXT7 (ORCPT + 99 others); Thu, 14 Feb 2019 18:19:59 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:26456 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728936AbfBNXT6 (ORCPT ); Thu, 14 Feb 2019 18:19:58 -0500 X-UUID: 90a2c5d5097e4ca69ff77ff0f77a71f2-20190215 X-UUID: 90a2c5d5097e4ca69ff77ff0f77a71f2-20190215 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 607167023; Fri, 15 Feb 2019 07:19:50 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs01n2.mediatek.inc (172.21.101.79) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 15 Feb 2019 07:19:42 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Fri, 15 Feb 2019 07:19:42 +0800 From: To: , , , CC: , , , , , Sean Wang Subject: [PATCH 3/6] Bluetooth: mediatek: fix up an error path to restore bdev->tx_state Date: Fri, 15 Feb 2019 07:19:35 +0800 Message-ID: X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: ACAD13D1EF135519F32787DB83F81F87797C5CA104C85759C2350E3BC01C1A222000:8 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sean Wang 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 --- drivers/bluetooth/btmtkuart.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/bluetooth/btmtkuart.c b/drivers/bluetooth/btmtkuart.c index b8ea011b82d8..9f8177b216b6 100644 --- a/drivers/bluetooth/btmtkuart.c +++ b/drivers/bluetooth/btmtkuart.c @@ -115,11 +115,13 @@ static int mtk_hci_wmt_sync(struct hci_dev *hdev, u8 op, u8 flag, u16 plen, 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; } -- 2.18.0