* [PATCH v1] Bluetooth: btusb: Fix enable failure for a CSR BT dongle
@ 2022-10-27 11:06 Zijun Hu
2022-10-27 11:18 ` Paul Menzel
0 siblings, 1 reply; 3+ messages in thread
From: Zijun Hu @ 2022-10-27 11:06 UTC (permalink / raw)
To: marcel, johan.hedberg, luiz.dentz, luiz.von.dentz
Cc: linux-kernel, linux-bluetooth, netdev, Zijun Hu
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(-)
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 */
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH v1] Bluetooth: btusb: Fix enable failure for a CSR BT dongle
2022-10-27 11:06 [PATCH v1] Bluetooth: btusb: Fix enable failure for a CSR BT dongle Zijun Hu
@ 2022-10-27 11:18 ` Paul Menzel
2022-10-28 2:57 ` quic_zijuhu
0 siblings, 1 reply; 3+ messages in thread
From: Paul Menzel @ 2022-10-27 11:18 UTC (permalink / raw)
To: Zijun Hu
Cc: marcel, johan.hedberg, luiz.dentz, luiz.von.dentz, linux-kernel,
linux-bluetooth, netdev, Zijun Hu
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 */
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v1] Bluetooth: btusb: Fix enable failure for a CSR BT dongle
2022-10-27 11:18 ` Paul Menzel
@ 2022-10-28 2:57 ` quic_zijuhu
0 siblings, 0 replies; 3+ messages in thread
From: quic_zijuhu @ 2022-10-28 2:57 UTC (permalink / raw)
To: Paul Menzel
Cc: marcel, johan.hedberg, luiz.dentz, luiz.von.dentz, linux-kernel,
linux-bluetooth, netdev, Zijun Hu
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-10-28 2:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-27 11:06 [PATCH v1] Bluetooth: btusb: Fix enable failure for a CSR BT dongle Zijun Hu
2022-10-27 11:18 ` Paul Menzel
2022-10-28 2:57 ` quic_zijuhu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®