Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp5832388rwn; Mon, 12 Sep 2022 15:20:27 -0700 (PDT) X-Google-Smtp-Source: AA6agR5XuAqXXGp465ChYsC94uysZpuxCwPCb2qGRDyr9OatkL0kznd6dyHdsBcCM3TcM5t/vLLs X-Received: by 2002:a17:90b:3845:b0:202:c44a:8b87 with SMTP id nl5-20020a17090b384500b00202c44a8b87mr563104pjb.115.1663021227120; Mon, 12 Sep 2022 15:20:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663021227; cv=none; d=google.com; s=arc-20160816; b=QCHVe3I1j20C0RJeYYSL9055qUNZO7F4duhKqUzZ7iW1lXWgHQHewdf9LHTcRAiTTE 88T28wPlQlMjfKck+nre3iKmBjp6btGHNgfwcjGNoXli65zmHu/4tdTrB84+T6DLtnhZ Z2g2LTXeb70AfaJk1N2btX/Jzuqaor5z/sfqejj6dbZN/R+maxXjcdwfVryHr7ORA5Hf jD3ZLlHzSCBRs+D5BmvlQHwKzxJtEBpJuTRtR1P/Yc2d9lF90bh72aatpO8jU+dTQemv KsunbojgqKwxbkuLMWBXsAXuDlMlucrGG27gd2Ne7xEVxzxfv5wx8X7YBVULP8OVMOXg MMyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=gOBWTS4xugh82iE+iVZ2feiJQnVLRL/GOJqIkU88mfM=; b=rl0fEbJJkjMtjYFPpM3rnjxqF7ElUG/weOweEjts6yqxAb7xo4urs2qTbeRKfjEgcG GHkHfxwyE5RoiMINzvN/oPx7+7/KXYrIoq63XePjw/BQIftfEsWRKtXNC6ddajlRjDaU J4g/ftqCq20XwiSDl/6PusRUNIZzGxftpj0kial63gUAtxtTRYUq9Rbb/iUtm86s1i3g Bc2j3QgUNHN7rqEGoMeDcb5+38iKkD9bEQyX7uM/BV1/sDZB97D022nXOvQlsMaS6Oik cDMCswOzP1tqPXVe5wMnGFKxkQET4e4o/l6Cp719IdiGQMY/sD2748iPGMJdYPAxE+4L MGsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=F2URJptc; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n63-20020a632742000000b0041d131d72b8si10266568pgn.629.2022.09.12.15.20.00; Mon, 12 Sep 2022 15:20:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=F2URJptc; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229785AbiILWTm (ORCPT + 99 others); Mon, 12 Sep 2022 18:19:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230358AbiILWTV (ORCPT ); Mon, 12 Sep 2022 18:19:21 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF8934F392; Mon, 12 Sep 2022 15:18:24 -0700 (PDT) X-UUID: ec645eb336884d94af667d3ba04f6aa8-20220913 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=gOBWTS4xugh82iE+iVZ2feiJQnVLRL/GOJqIkU88mfM=; b=F2URJptcaTsdutuRPbn3NGr2Z3nlw66/AhLjScg5rE++PIXC85lkPRxgWhn0xBMpNecwqKysPkPnknmN1LyhhjgfH8BNfpRSuPo+7RGTQQzzQIS0RkKoCOgBL6GE5WDb294BMfhLtrYJMS7AE5OjvtUI0kH4LMBp6svE92zQLz0=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.10,REQID:df57679e-f3f3-4363-8f17-1d6812430eb1,OB:0,L OB:0,IP:0,URL:0,TC:0,Content:0,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Release _Ham,ACTION:release,TS:95 X-CID-INFO: VERSION:1.1.10,REQID:df57679e-f3f3-4363-8f17-1d6812430eb1,OB:0,LOB :0,IP:0,URL:0,TC:0,Content:0,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Spam_GS98 1B3D,ACTION:quarantine,TS:95 X-CID-META: VersionHash:84eae18,CLOUDID:6e332bec-2856-4fce-b125-09d4c7ebe045,C OID:f0f93c5bd161,Recheck:0,SF:28|17|19|48,TC:nil,Content:0,EDM:-3,IP:nil,U RL:11|1,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 X-UUID: ec645eb336884d94af667d3ba04f6aa8-20220913 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1619271378; Tue, 13 Sep 2022 06:18:21 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by mtkmbs11n1.mediatek.inc (172.21.101.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Tue, 13 Sep 2022 06:18:20 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Tue, 13 Sep 2022 06:18:19 +0800 From: To: , , CC: , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH 3/4] Bluetooth: btusb: mediatek: reset the device as WMT failed Date: Tue, 13 Sep 2022 06:18:12 +0800 Message-ID: X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <43b68b1f48c20b1dfcd7e6663c3dcb38e4e0648c.1663020936.git.objelf@gmail.com> References: <43b68b1f48c20b1dfcd7e6663c3dcb38e4e0648c.1663020936.git.objelf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, T_SCC_BODY_TEXT_LINE,T_SPF_TEMPERROR,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Sean Wang Reset the BT device whenever the driver detected any WMT failure happened to recover such kind of system-level error as soon as possible. Signed-off-by: Sean Wang --- drivers/bluetooth/btusb.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index 653f57a98233..dc86726c8271 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -2576,6 +2576,10 @@ static int btusb_mtk_hci_wmt_sync(struct hci_dev *hdev, data->evt_skb = NULL; err_free_wc: kfree(wc); + + if (err < 0) + btmtk_reset_sync(hdev); + return err; } -- 2.25.1