Message ID | 20250222050439.1494-1-nishiyama.pedro@gmail.com |
---|---|
State | Superseded |
Headers | show |
Series | [v2,1/2] Bluetooth: Add new quirks for fake Bluetooth dongles | expand |
Dear Pedro, Thank you for your patch. Am 22.02.25 um 06:04 schrieb Pedro Nishiyama: > This adds quirks for broken READ_VOICE_SETTING and READ_PAGE_SCAN_TYPE. > > Signed-off-by: Pedro Nishiyama <nishiyama.pedro@gmail.com> > --- > include/net/bluetooth/hci.h | 16 ++++++++++++++++ > net/bluetooth/hci_sync.c | 6 ++++++ > 2 files changed, 22 insertions(+) […] I’d make one commit per quirk. The diff looks good. Kind regards, Paul
Dear Pedro, Am 22.02.25 um 06:04 schrieb Pedro Nishiyama: > Set HCI_OP_READ_VOICE_SETTING and HCI_OP_READ_PAGE_SCAN_TYPE as broken. > These features are falsely reported as supported. Please list the affected controllers. > Fixes: d0b137062b2d ("Bluetooth: hci_sync: Rework init stages") As the summary/title says, that it’s a regression, could you please elaborate, that it worked before, and how it regressed? Were these quirks present before? > Signed-off-by: Pedro Nishiyama <nishiyama.pedro@gmail.com> > --- > drivers/bluetooth/btusb.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c > index 8149e53fd0a7..903361456acf 100644 > --- a/drivers/bluetooth/btusb.c > +++ b/drivers/bluetooth/btusb.c > @@ -2436,6 +2436,8 @@ static int btusb_setup_csr(struct hci_dev *hdev) > set_bit(HCI_QUIRK_BROKEN_ERR_DATA_REPORTING, &hdev->quirks); > set_bit(HCI_QUIRK_BROKEN_FILTER_CLEAR_ALL, &hdev->quirks); > set_bit(HCI_QUIRK_NO_SUSPEND_NOTIFIER, &hdev->quirks); > + set_bit(HCI_QUIRK_BROKEN_READ_VOICE_SETTING, &hdev->quirks); > + set_bit(HCI_QUIRK_BROKEN_READ_PAGE_SCAN_TYPE, &hdev->quirks); > > /* Clear the reset quirk since this is not an actual > * early Bluetooth 1.1 device from CSR. Kind regards, Paul
This is automated email and please do not reply to this email! Dear submitter, Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series: PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=936668 ---Test result--- Test Summary: CheckPatch PENDING 0.25 seconds GitLint PENDING 0.16 seconds SubjectPrefix PASS 0.19 seconds BuildKernel PASS 24.35 seconds CheckAllWarning PASS 26.54 seconds CheckSparse PASS 29.96 seconds BuildKernel32 PASS 23.91 seconds TestRunnerSetup PASS 429.56 seconds TestRunner_l2cap-tester PASS 21.38 seconds TestRunner_iso-tester PASS 37.91 seconds TestRunner_bnep-tester PASS 4.75 seconds TestRunner_mgmt-tester FAIL 123.99 seconds TestRunner_rfcomm-tester PASS 7.81 seconds TestRunner_sco-tester PASS 9.70 seconds TestRunner_ioctl-tester PASS 8.38 seconds TestRunner_mesh-tester FAIL 6.35 seconds TestRunner_smp-tester PASS 7.35 seconds TestRunner_userchan-tester PASS 4.97 seconds IncrementalBuild PENDING 0.51 seconds Details ############################## Test: CheckPatch - PENDING Desc: Run checkpatch.pl script Output: ############################## Test: GitLint - PENDING Desc: Run gitlint Output: ############################## Test: TestRunner_mgmt-tester - FAIL Desc: Run mgmt-tester with test-runner Output: Total: 490, Passed: 485 (99.0%), Failed: 1, Not Run: 4 Failed Test Cases LL Privacy - Set Flags 3 (2 Devices to RL) Failed 0.174 seconds ############################## Test: TestRunner_mesh-tester - FAIL Desc: Run mesh-tester with test-runner Output: Total: 10, Passed: 9 (90.0%), Failed: 1, Not Run: 0 Failed Test Cases Mesh - Send cancel - 2 Failed 0.124 seconds ############################## Test: IncrementalBuild - PENDING Desc: Incremental build with the patches in the series Output: --- Regards, Linux Bluetooth
Hello Paul, On Sat, Feb 22, 2025 at 2:29 AM Paul Menzel <pmenzel@molgen.mpg.de> wrote: > > Dear Pedro, > > > Am 22.02.25 um 06:04 schrieb Pedro Nishiyama: > > Set HCI_OP_READ_VOICE_SETTING and HCI_OP_READ_PAGE_SCAN_TYPE as broken. > > These features are falsely reported as supported. > > Please list the affected controllers. > > > Fixes: d0b137062b2d ("Bluetooth: hci_sync: Rework init stages") > > As the summary/title says, that it’s a regression, could you please > elaborate, that it worked before, and how it regressed? Were these > quirks present before? > Sorry, I realized I put the wrong commit in the fixes tag. The error originated after commit c8992cffbe74 (“Bluetooth: hci_event: Use of a function table to handle Command Complete”). When the min/max length of the commands began to be checked. The clone I have here returns a smaller buffer than expected by the command. Since I'll need to fix the version tag, I'll put this information in the description in the next version. > > Signed-off-by: Pedro Nishiyama <nishiyama.pedro@gmail.com> > > --- > > drivers/bluetooth/btusb.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c > > index 8149e53fd0a7..903361456acf 100644 > > --- a/drivers/bluetooth/btusb.c > > +++ b/drivers/bluetooth/btusb.c > > @@ -2436,6 +2436,8 @@ static int btusb_setup_csr(struct hci_dev *hdev) > > set_bit(HCI_QUIRK_BROKEN_ERR_DATA_REPORTING, &hdev->quirks); > > set_bit(HCI_QUIRK_BROKEN_FILTER_CLEAR_ALL, &hdev->quirks); > > set_bit(HCI_QUIRK_NO_SUSPEND_NOTIFIER, &hdev->quirks); > > + set_bit(HCI_QUIRK_BROKEN_READ_VOICE_SETTING, &hdev->quirks); > > + set_bit(HCI_QUIRK_BROKEN_READ_PAGE_SCAN_TYPE, &hdev->quirks); > > > > /* Clear the reset quirk since this is not an actual > > * early Bluetooth 1.1 device from CSR. > > > Kind regards, > > Paul Best regards, Pedro
Dear Pedro, Am 22.02.25 um 07:35 schrieb Pedro Nishiyama: > On Sat, Feb 22, 2025 at 2:29 AM Paul Menzel <pmenzel@molgen.mpg.de> wrote: >> Am 22.02.25 um 06:04 schrieb Pedro Nishiyama: >>> Set HCI_OP_READ_VOICE_SETTING and HCI_OP_READ_PAGE_SCAN_TYPE as broken. >>> These features are falsely reported as supported. >> >> Please list the affected controllers. >> >>> Fixes: d0b137062b2d ("Bluetooth: hci_sync: Rework init stages") >> >> As the summary/title says, that it’s a regression, could you please >> elaborate, that it worked before, and how it regressed? Were these >> quirks present before? > > Sorry, I realized I put the wrong commit in the fixes tag. The error > originated after > commit c8992cffbe74 (“Bluetooth: hci_event: Use of a function table to > handle Command Complete”). > When the min/max length of the commands began to be checked. The clone > I have here returns > a smaller buffer than expected by the command. > Since I'll need to fix the version tag, I'll put this information in > the description in the next version. Thank you for the reply and explanation. I also saw your v3 already. Awesome. >>> Signed-off-by: Pedro Nishiyama <nishiyama.pedro@gmail.com> >>> --- >>> drivers/bluetooth/btusb.c | 2 ++ >>> 1 file changed, 2 insertions(+) >>> >>> diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c >>> index 8149e53fd0a7..903361456acf 100644 >>> --- a/drivers/bluetooth/btusb.c >>> +++ b/drivers/bluetooth/btusb.c >>> @@ -2436,6 +2436,8 @@ static int btusb_setup_csr(struct hci_dev *hdev) >>> set_bit(HCI_QUIRK_BROKEN_ERR_DATA_REPORTING, &hdev->quirks); >>> set_bit(HCI_QUIRK_BROKEN_FILTER_CLEAR_ALL, &hdev->quirks); >>> set_bit(HCI_QUIRK_NO_SUSPEND_NOTIFIER, &hdev->quirks); >>> + set_bit(HCI_QUIRK_BROKEN_READ_VOICE_SETTING, &hdev->quirks); >>> + set_bit(HCI_QUIRK_BROKEN_READ_PAGE_SCAN_TYPE, &hdev->quirks); >>> >>> /* Clear the reset quirk since this is not an actual >>> * early Bluetooth 1.1 device from CSR. Kind regards, Paul
Hello: This series was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>: On Sat, 22 Feb 2025 02:04:38 -0300 you wrote: > This adds quirks for broken READ_VOICE_SETTING and READ_PAGE_SCAN_TYPE. > > Signed-off-by: Pedro Nishiyama <nishiyama.pedro@gmail.com> > --- > include/net/bluetooth/hci.h | 16 ++++++++++++++++ > net/bluetooth/hci_sync.c | 6 ++++++ > 2 files changed, 22 insertions(+) Here is the summary with links: - [v2,1/2] Bluetooth: Add new quirks for fake Bluetooth dongles (no matching commit) - [v2,2/2] Bluetooth: btusb: Fix regression in the initialization of fake Bluetooth controllers https://git.kernel.org/bluetooth/bluetooth-next/c/c2fe96fc96f7 You are awesome, thank you!
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index 0d51970d809f..b99818df8ee7 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h @@ -354,6 +354,22 @@ enum { * during the hdev->setup vendor callback. */ HCI_QUIRK_FIXUP_LE_EXT_ADV_REPORT_PHY, + + /* When this quirk is set, the HCI_OP_READ_VOICE_SETTING command is + * skipped. This is required for a subset of the CSR controller clones + * which erroneously claim to support it. + * + * This quirk must be set before hci_register_dev is called. + */ + HCI_QUIRK_BROKEN_READ_VOICE_SETTING, + + /* When this quirk is set, the HCI_OP_READ_PAGE_SCAN_TYPE command is + * skipped. This is required for a subset of the CSR controller clones + * which erroneously claim to support it. + * + * This quirk must be set before hci_register_dev is called. + */ + HCI_QUIRK_BROKEN_READ_PAGE_SCAN_TYPE, }; /* HCI device flags */ diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c index dd770ef5ec36..e76012956020 100644 --- a/net/bluetooth/hci_sync.c +++ b/net/bluetooth/hci_sync.c @@ -3696,6 +3696,9 @@ static int hci_read_local_name_sync(struct hci_dev *hdev) /* Read Voice Setting */ static int hci_read_voice_setting_sync(struct hci_dev *hdev) { + if (test_bit(HCI_QUIRK_BROKEN_READ_VOICE_SETTING, &hdev->quirks)) + return 0; + return __hci_cmd_sync_status(hdev, HCI_OP_READ_VOICE_SETTING, 0, NULL, HCI_CMD_TIMEOUT); } @@ -4132,6 +4135,9 @@ static int hci_read_page_scan_type_sync(struct hci_dev *hdev) if (!(hdev->commands[13] & 0x01)) return 0; + if (test_bit(HCI_QUIRK_BROKEN_READ_PAGE_SCAN_TYPE, &hdev->quirks)) + return 0; + return __hci_cmd_sync_status(hdev, HCI_OP_READ_PAGE_SCAN_TYPE, 0, NULL, HCI_CMD_TIMEOUT); }
This adds quirks for broken READ_VOICE_SETTING and READ_PAGE_SCAN_TYPE. Signed-off-by: Pedro Nishiyama <nishiyama.pedro@gmail.com> --- include/net/bluetooth/hci.h | 16 ++++++++++++++++ net/bluetooth/hci_sync.c | 6 ++++++ 2 files changed, 22 insertions(+)