Message ID | 1666868760-4680-1-git-send-email-quic_zijuhu@quicinc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp168048wru; Thu, 27 Oct 2022 04:17:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5JnJOMHDIx7Ofgvl+/ZFxcloY3XK4i8tvLK/gJSaXaHvH4MREqDFbvDixJ4xZS+XRWySSC X-Received: by 2002:a17:907:970d:b0:7ad:9195:da86 with SMTP id jg13-20020a170907970d00b007ad9195da86mr1648816ejc.117.1666869452529; Thu, 27 Oct 2022 04:17:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666869452; cv=none; d=google.com; s=arc-20160816; b=QPpSo37+tui0mCKt1PatICHpv1aA22Y4Hbxp756ai8N3FY9jGzLF80MO+kaiSR5Okl 2i3YCPzFfGr5L5ex+NPPmpWIXho+GP+c54MC512PcFw+q0Lbl3DuX4f8BSPWTjxs4nxB 71zOWoBALpsQvBIv3Y1u42rIWj3SMR117E96ziGzWy12SdFbr7icERTCWThr+oZeKADr 9xLgHJ9tE782UWJrzZiM2MKHXde1HmsnzyNqAUUeHGIOug1q0q1xCbGaA8aMTZBxvLtF m3DzYfpzZ5VLHXLl6b6B230eiFvXMnbFSCJYGVZQni52gvC9ABHk22niSHseC6f+llHT qDLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=9vDsFDWsTM0HLzYvJtlR+FkhaxKdyM61nwfYVVJDHfs=; b=AuPOfODVT3f2fhM6ROgbZl3TloB6MfGcVYP4OVHCv/0T108K2y3IX2Fj/rEBnRnEkz tkQoy0iOrVTV7+s4L/8iTJgf3sfSmn/jaE2XzOVTKoS9C7ciRxzyuGj/u9e9KE7Xv4af LTbDLhFgyvBamslvqed7V5WfBs1vbtd3qj3sKL2hSEdPtbyKnloq7Yx58yIWXs90Uc5r LC0aiWq28uh+cfg3IBRNP1GTG5zeNvsAQIkXgGLQtaAUmbNruFTyv1qaS+62I0/Db8rI Oc04/mfhxPbznkKFhNXfa8HQ+VykpIf9yFUflZj7qsGEpuqSWipqxTBe//zm+KYFLwhN VACg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b="q/YD47Ef"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sh36-20020a1709076ea400b007ad4a555cb6si1263345ejc.878.2022.10.27.04.17.06; Thu, 27 Oct 2022 04:17:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@quicinc.com header.s=qcdkim header.b="q/YD47Ef"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234309AbiJ0LGM (ORCPT <rfc822;chrisfriedt@gmail.com> + 99 others); Thu, 27 Oct 2022 07:06:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234759AbiJ0LGK (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 27 Oct 2022 07:06:10 -0400 Received: from alexa-out-sd-02.qualcomm.com (alexa-out-sd-02.qualcomm.com [199.106.114.39]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C43CDE0706; Thu, 27 Oct 2022 04:06:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1666868767; x=1698404767; h=from:to:cc:subject:date:message-id:mime-version; bh=9vDsFDWsTM0HLzYvJtlR+FkhaxKdyM61nwfYVVJDHfs=; b=q/YD47EfZ24rAElSea5YNfe1GAz6V0idmC/rXu13Ef4V+eMb8v3RXHr0 Rzt+sGwgfYC0Lq9XpM2LFLjaFBiuSlxvTam7f+SfAEUbXYow6mdizd0rH Ef15ybKtN8acLjjYTiYhpdHpMsolvnuhkCyhzHdfCR1FXx8ruAu6a2GKS Y=; Received: from unknown (HELO ironmsg-SD-alpha.qualcomm.com) ([10.53.140.30]) by alexa-out-sd-02.qualcomm.com with ESMTP; 27 Oct 2022 04:06:07 -0700 X-QCInternal: smtphost Received: from unknown (HELO nasanex01a.na.qualcomm.com) ([10.52.223.231]) by ironmsg-SD-alpha.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Oct 2022 04:06:07 -0700 Received: from zijuhu-gv.qualcomm.com (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Thu, 27 Oct 2022 04:06:05 -0700 From: Zijun Hu <quic_zijuhu@quicinc.com> To: <marcel@holtmann.org>, <johan.hedberg@gmail.com>, <luiz.dentz@gmail.com>, <luiz.von.dentz@intel.com> CC: <linux-kernel@vger.kernel.org>, <linux-bluetooth@vger.kernel.org>, <netdev@vger.kernel.org>, Zijun Hu <zijuhu@qti.qualcomm.com> Subject: [PATCH v1] Bluetooth: btusb: Fix enable failure for a CSR BT dongle Date: Thu, 27 Oct 2022 19:06:00 +0800 Message-ID: <1666868760-4680-1-git-send-email-quic_zijuhu@quicinc.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01a.na.qualcomm.com (10.52.223.231) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747839303179084825?= X-GMAIL-MSGID: =?utf-8?q?1747839303179084825?= |
Series |
[v1] Bluetooth: btusb: Fix enable failure for a CSR BT dongle
|
|
Commit Message
quic_zijuhu
Oct. 27, 2022, 11:06 a.m. UTC
From: Zijun Hu <zijuhu@qti.qualcomm.com> A CSR BT dongle fails to be enabled bcz it is not detected as fake rightly, fixed by correcting fake detection condition. below btmon error log says HCI_QUIRK_BROKEN_FILTER_CLEAR_ALL is not set. < HCI Command: Set Event Filter (0x03|0x0005) plen 1 #23 [hci0] Type: Clear All Filters (0x00) > HCI Event: Command Complete (0x0e) plen 4 #24 [hci0] Set Event Filter (0x03|0x0005) ncmd 1 Status: Invalid HCI Command Parameters (0x12) the quirk is not set bcz current fake detection does not mark the dongle as fake with below version info. < HCI Command: Read Local Version In.. (0x04|0x0001) plen 0 #1 [hci0] > HCI Event: Command Complete (0x0e) plen 12 #2 [hci0] Read Local Version Information (0x04|0x0001) ncmd 1 Status: Success (0x00) HCI version: Bluetooth 4.0 (0x06) - Revision 12576 (0x3120) LMP version: Bluetooth 4.0 (0x06) - Subversion 8891 (0x22bb) Manufacturer: Cambridge Silicon Radio (10) Link: https://bugzilla.kernel.org/show_bug.cgi?id=60824 Signed-off-by: Zijun Hu <zijuhu@qti.qualcomm.com> --- drivers/bluetooth/btusb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Dear Zijun, Thank you for the patch. Am 27.10.22 um 13:06 schrieb Zijun Hu: > From: Zijun Hu <zijuhu@qti.qualcomm.com> I‘d be more specific in the summary/title. Maybe: Correct quirk check to include BT 4.0 > A CSR BT dongle fails to be enabled bcz it is not detected as fake I’d write *because*. > rightly, fixed by correcting fake detection condition. > > below btmon error log says HCI_QUIRK_BROKEN_FILTER_CLEAR_ALL is not set. > > < HCI Command: Set Event Filter (0x03|0x0005) plen 1 #23 [hci0] > Type: Clear All Filters (0x00) >> HCI Event: Command Complete (0x0e) plen 4 #24 [hci0] > Set Event Filter (0x03|0x0005) ncmd 1 > Status: Invalid HCI Command Parameters (0x12) > > the quirk is not set bcz current fake detection does not mark the dongle > as fake with below version info. > > < HCI Command: Read Local Version In.. (0x04|0x0001) plen 0 #1 [hci0] >> HCI Event: Command Complete (0x0e) plen 12 #2 [hci0] > Read Local Version Information (0x04|0x0001) ncmd 1 > Status: Success (0x00) > HCI version: Bluetooth 4.0 (0x06) - Revision 12576 (0x3120) > LMP version: Bluetooth 4.0 (0x06) - Subversion 8891 (0x22bb) > Manufacturer: Cambridge Silicon Radio (10) > > Link: https://bugzilla.kernel.org/show_bug.cgi?id=60824 > Signed-off-by: Zijun Hu <zijuhu@qti.qualcomm.com> Please add a Fixes: tag. Kind regards, Paul > --- > drivers/bluetooth/btusb.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c > index 420be2ee2acf..727469d073f9 100644 > --- a/drivers/bluetooth/btusb.c > +++ b/drivers/bluetooth/btusb.c > @@ -2155,7 +2155,7 @@ static int btusb_setup_csr(struct hci_dev *hdev) > is_fake = true; > > else if (le16_to_cpu(rp->lmp_subver) <= 0x22bb && > - le16_to_cpu(rp->hci_ver) > BLUETOOTH_VER_4_0) > + le16_to_cpu(rp->hci_ver) >= BLUETOOTH_VER_4_0) > is_fake = true; > > /* Other clones which beat all the above checks */
On 10/27/2022 7:18 PM, Paul Menzel wrote: > Dear Zijun, > > > Thank you for the patch. > > > Am 27.10.22 um 13:06 schrieb Zijun Hu: >> From: Zijun Hu <zijuhu@qti.qualcomm.com> > > I‘d be more specific in the summary/title. Maybe: > > Correct quirk check to include BT 4.0 > >> A CSR BT dongle fails to be enabled bcz it is not detected as fake > > I’d write *because*. > >> rightly, fixed by correcting fake detection condition. >> >> below btmon error log says HCI_QUIRK_BROKEN_FILTER_CLEAR_ALL is not set. >> >> < HCI Command: Set Event Filter (0x03|0x0005) plen 1 #23 [hci0] >> Type: Clear All Filters (0x00) >>> HCI Event: Command Complete (0x0e) plen 4 #24 [hci0] >> Set Event Filter (0x03|0x0005) ncmd 1 >> Status: Invalid HCI Command Parameters (0x12) >> >> the quirk is not set bcz current fake detection does not mark the dongle >> as fake with below version info. >> >> < HCI Command: Read Local Version In.. (0x04|0x0001) plen 0 #1 [hci0] >>> HCI Event: Command Complete (0x0e) plen 12 #2 [hci0] >> Read Local Version Information (0x04|0x0001) ncmd 1 >> Status: Success (0x00) >> HCI version: Bluetooth 4.0 (0x06) - Revision 12576 (0x3120) >> LMP version: Bluetooth 4.0 (0x06) - Subversion 8891 (0x22bb) >> Manufacturer: Cambridge Silicon Radio (10) >> >> Link: https://bugzilla.kernel.org/show_bug.cgi?id=60824 >> Signed-off-by: Zijun Hu <zijuhu@qti.qualcomm.com> > > Please add a Fixes: tag. > > > Kind regards, > > Paul > > >> --- >> drivers/bluetooth/btusb.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c >> index 420be2ee2acf..727469d073f9 100644 >> --- a/drivers/bluetooth/btusb.c >> +++ b/drivers/bluetooth/btusb.c >> @@ -2155,7 +2155,7 @@ static int btusb_setup_csr(struct hci_dev *hdev) >> is_fake = true; >> else if (le16_to_cpu(rp->lmp_subver) <= 0x22bb && >> - le16_to_cpu(rp->hci_ver) > BLUETOOTH_VER_4_0) >> + le16_to_cpu(rp->hci_ver) >= BLUETOOTH_VER_4_0) >> is_fake = true; >> /* Other clones which beat all the above checks */ thank you Paul for your code review. i am sorry, please Ignore this wrong fix. the enable failure should be caused that below fix is not be picked up https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git/commit/?id=b3cf94c8b6b2f1a2b94825a025db291da2b151fd
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index 420be2ee2acf..727469d073f9 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -2155,7 +2155,7 @@ static int btusb_setup_csr(struct hci_dev *hdev) is_fake = true; else if (le16_to_cpu(rp->lmp_subver) <= 0x22bb && - le16_to_cpu(rp->hci_ver) > BLUETOOTH_VER_4_0) + le16_to_cpu(rp->hci_ver) >= BLUETOOTH_VER_4_0) is_fake = true; /* Other clones which beat all the above checks */