Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2537001yba; Mon, 6 May 2019 07:40:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqyD2FklaCKyPR3+nX88W1tePlbbccYYAqTZnQMiN5J2KvXARUhMtU7e8loaXnqcAZbV7LDB X-Received: by 2002:a17:902:e287:: with SMTP id cf7mr32856037plb.217.1557153618313; Mon, 06 May 2019 07:40:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557153618; cv=none; d=google.com; s=arc-20160816; b=MOWMxYcYtbLuVxm3yheA/fbXrMAxFlhzP6FDqSoiVVYcydGc6w2F6le/S7JIYkMGm1 fM5m9Ehexq4xfZOpZHAyhTJV7GR+Q3WCn+AxPOE2ZItpNdifLw1zOcz33VybuzTaob4S DdzwtZSruGYMnlQ1RtlJosR0KEuM4EehC/c1Y3pboiS0Xgl4nag04enbAAQr+cSrNtGu GcXcoGku2ojMxY0WBzZ3NYH9bXD2LZQ7WBXKTo1Jo6EBag67usnFXQgfXgnQ7SQvHZep jF9RulDgrCEbgX2aVePcizXAFJua1hKcaKfYR7LFRoo2CyPx65Efe23w1E9MNdp/TXUz S5BA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=CU1r6M5MrOCcsN/nW+MkVcRgzMcAWut06aGW1sIP8gg=; b=sbjFFXASC+iGKmZ4Ndnmk9GQIQJx/sdJQz2EfPRVVnRnNGgXcwofppEEZeUNgzKoXe KBXb1rKdPTYOqWcBMGeJ6dXghO84Vu57TQYzTJkP05zErvRh9FVED2IV3X02mKclGUst P9Z5xYHRMIuwv+NFi+mpKMMNIRIHR1/VqahhxHPGQF9FUOvSrBYKh4S9QRPIXsdkf6QU wMcFAZGHrt5YPzB3tK3+z90WYU7DoBWqgiUtRO9Aa6+h2NHjXryVltKIs3CB606331ir 5/ZaajxMOgZ49geoXLd6SkanMZO6iYuFyY88neFJasjppK50gGSz4fOkV7nqChhWuh64 0Pew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zYSCoCpl; 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 o4si16193086plb.312.2019.05.06.07.40.02; Mon, 06 May 2019 07:40:18 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b=zYSCoCpl; 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 S1727337AbfEFOhJ (ORCPT + 99 others); Mon, 6 May 2019 10:37:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:57718 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727291AbfEFOhH (ORCPT ); Mon, 6 May 2019 10:37:07 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 772FC206A3; Mon, 6 May 2019 14:37:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557153427; bh=d7uNJrLitMhqX15euf0F9ce9ER6b9bWi/IESkGcFvrc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zYSCoCplaRbHfcaptlwaYEffAQsjU6P7/H7ZF8ar69xMz1nC/ogECRbqkS1kWNyg4 z34FInmwuHvZHjKnvudONtOJQrcDQqN4FWGhwrqinMGRJtQKmpS5Wd7Vng0eFCZHer NrswbGXJJg2AC0qWeVZt+c4fmOOiySDyaFd/0klY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sean Wang , Marcel Holtmann Subject: [PATCH 5.0 085/122] Bluetooth: mediatek: fix up an error path to restore bdev->tx_state Date: Mon, 6 May 2019 16:32:23 +0200 Message-Id: <20190506143102.378302993@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190506143054.670334917@linuxfoundation.org> References: <20190506143054.670334917@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sean Wang 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 Signed-off-by: Marcel Holtmann Signed-off-by: Greg Kroah-Hartman --- 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; }