* [PATCH v4] Bluetooth: HCI: Introduce HCI_QUIRK_BROKEN_LE_CODED
@ 2023-08-23 19:41 Luiz Augusto von Dentz
2023-08-23 20:37 ` [v4] " bluez.test.bot
2023-08-23 21:20 ` [PATCH v4] " patchwork-bot+bluetooth
0 siblings, 2 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2023-08-23 19:41 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This introduces HCI_QUIRK_BROKEN_LE_CODED which is used to indicate
that LE Coded PHY shall not be used, it is then set for some Intel
models that claim to support it but when used causes many problems.
Cc: stable@vger.kernel.org # 6.4.y+
Link: https://github.com/bluez/bluez/issues/577
Link: https://github.com/bluez/bluez/issues/582
Link: https://lore.kernel.org/linux-bluetooth/CABBYNZKco-v7wkjHHexxQbgwwSz-S=GZ=dZKbRE1qxT1h4fFbQ@mail.gmail.com/T/#
Fixes: 288c90224eec ("Bluetooth: Enable all supported LE PHY by default")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
drivers/bluetooth/btintel.c | 6 ++++++
include/net/bluetooth/hci.h | 10 ++++++++++
include/net/bluetooth/hci_core.h | 4 +++-
net/bluetooth/hci_sync.c | 5 ++++-
4 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c
index 9b239ce96fa4..2462796a512a 100644
--- a/drivers/bluetooth/btintel.c
+++ b/drivers/bluetooth/btintel.c
@@ -2787,6 +2787,9 @@ static int btintel_setup_combined(struct hci_dev *hdev)
set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED,
&hdev->quirks);
+ /* These variants don't seem to support LE Coded PHY */
+ set_bit(HCI_QUIRK_BROKEN_LE_CODED, &hdev->quirks);
+
/* Setup MSFT Extension support */
btintel_set_msft_opcode(hdev, ver.hw_variant);
@@ -2858,6 +2861,9 @@ static int btintel_setup_combined(struct hci_dev *hdev)
*/
set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, &hdev->quirks);
+ /* These variants don't seem to support LE Coded PHY */
+ set_bit(HCI_QUIRK_BROKEN_LE_CODED, &hdev->quirks);
+
/* Set Valid LE States quirk */
set_bit(HCI_QUIRK_VALID_LE_STATES, &hdev->quirks);
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index c58425d4c592..87d92accc26e 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -319,6 +319,16 @@ enum {
* This quirk must be set before hci_register_dev is called.
*/
HCI_QUIRK_USE_MSFT_EXT_ADDRESS_FILTER,
+
+ /*
+ * When this quirk is set, LE Coded PHY shall not be used. This is
+ * required for some Intel controllers which erroneously claim to
+ * support it but it causes problems with extended scanning.
+ *
+ * This quirk can be set before hci_register_dev is called or
+ * during the hdev->setup vendor callback.
+ */
+ HCI_QUIRK_BROKEN_LE_CODED,
};
/* HCI device flags */
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 6e2988b11f99..e6359f7346f1 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -1817,7 +1817,9 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
#define scan_2m(dev) (((dev)->le_tx_def_phys & HCI_LE_SET_PHY_2M) || \
((dev)->le_rx_def_phys & HCI_LE_SET_PHY_2M))
-#define le_coded_capable(dev) (((dev)->le_features[1] & HCI_LE_PHY_CODED))
+#define le_coded_capable(dev) (((dev)->le_features[1] & HCI_LE_PHY_CODED) && \
+ !test_bit(HCI_QUIRK_BROKEN_LE_CODED, \
+ &(dev)->quirks))
#define scan_coded(dev) (((dev)->le_tx_def_phys & HCI_LE_SET_PHY_CODED) || \
((dev)->le_rx_def_phys & HCI_LE_SET_PHY_CODED))
diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index 0cb780817198..9b93653c6197 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -4668,7 +4668,10 @@ static const struct {
"advertised, but not supported."),
HCI_QUIRK_BROKEN(SET_RPA_TIMEOUT,
"HCI LE Set Random Private Address Timeout command is "
- "advertised, but not supported.")
+ "advertised, but not supported."),
+ HCI_QUIRK_BROKEN(LE_CODED,
+ "HCI LE Coded PHY feature bit is set, "
+ "but its usage is not supported.")
};
/* This function handles hdev setup stage:
--
2.41.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [v4] Bluetooth: HCI: Introduce HCI_QUIRK_BROKEN_LE_CODED
2023-08-23 19:41 [PATCH v4] Bluetooth: HCI: Introduce HCI_QUIRK_BROKEN_LE_CODED Luiz Augusto von Dentz
@ 2023-08-23 20:37 ` bluez.test.bot
2023-08-23 21:20 ` [PATCH v4] " patchwork-bot+bluetooth
1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2023-08-23 20:37 UTC (permalink / raw)
To: linux-bluetooth, luiz.dentz
[-- Attachment #1: Type: text/plain, Size: 3052 bytes --]
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=778730
---Test result---
Test Summary:
CheckPatch FAIL 1.58 seconds
GitLint FAIL 0.57 seconds
SubjectPrefix PASS 0.14 seconds
BuildKernel PASS 34.33 seconds
CheckAllWarning PASS 38.12 seconds
CheckSparse PASS 43.27 seconds
CheckSmatch PASS 114.92 seconds
BuildKernel32 PASS 33.57 seconds
TestRunnerSetup PASS 499.15 seconds
TestRunner_l2cap-tester PASS 29.11 seconds
TestRunner_iso-tester PASS 52.60 seconds
TestRunner_bnep-tester PASS 11.65 seconds
TestRunner_mgmt-tester PASS 229.14 seconds
TestRunner_rfcomm-tester PASS 17.24 seconds
TestRunner_sco-tester PASS 20.59 seconds
TestRunner_ioctl-tester PASS 19.43 seconds
TestRunner_mesh-tester PASS 14.61 seconds
TestRunner_smp-tester PASS 15.51 seconds
TestRunner_userchan-tester PASS 12.19 seconds
IncrementalBuild PASS 31.26 seconds
Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script
Output:
[v4] Bluetooth: HCI: Introduce HCI_QUIRK_BROKEN_LE_CODED
WARNING: quoted string split across lines
#167: FILE: net/bluetooth/hci_sync.c:4671:
"HCI LE Set Random Private Address Timeout command is "
+ "advertised, but not supported."),
WARNING: quoted string split across lines
#170: FILE: net/bluetooth/hci_sync.c:4674:
+ "HCI LE Coded PHY feature bit is set, "
+ "but its usage is not supported.")
total: 0 errors, 2 warnings, 0 checks, 55 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
/github/workspace/src/src/13363067.patch has style problems, please review.
NOTE: Ignored message types: UNKNOWN_COMMIT_ID
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
##############################
Test: GitLint - FAIL
Desc: Run gitlint
Output:
[v4] Bluetooth: HCI: Introduce HCI_QUIRK_BROKEN_LE_CODED
WARNING: I3 - ignore-body-lines: gitlint will be switching from using Python regex 'match' (match beginning) to 'search' (match anywhere) semantics. Please review your ignore-body-lines.regex option accordingly. To remove this warning, set general.regex-style-search=True. More details: https://jorisroovers.github.io/gitlint/configuration/#regex-style-search
12: B1 Line exceeds max length (116>80): "Link: https://lore.kernel.org/linux-bluetooth/CABBYNZKco-v7wkjHHexxQbgwwSz-S=GZ=dZKbRE1qxT1h4fFbQ@mail.gmail.com/T/#"
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v4] Bluetooth: HCI: Introduce HCI_QUIRK_BROKEN_LE_CODED
2023-08-23 19:41 [PATCH v4] Bluetooth: HCI: Introduce HCI_QUIRK_BROKEN_LE_CODED Luiz Augusto von Dentz
2023-08-23 20:37 ` [v4] " bluez.test.bot
@ 2023-08-23 21:20 ` patchwork-bot+bluetooth
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+bluetooth @ 2023-08-23 21:20 UTC (permalink / raw)
To: Luiz Augusto von Dentz; +Cc: linux-bluetooth
Hello:
This patch was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:
On Wed, 23 Aug 2023 12:41:28 -0700 you wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>
> This introduces HCI_QUIRK_BROKEN_LE_CODED which is used to indicate
> that LE Coded PHY shall not be used, it is then set for some Intel
> models that claim to support it but when used causes many problems.
>
> Cc: stable@vger.kernel.org # 6.4.y+
> Link: https://github.com/bluez/bluez/issues/577
> Link: https://github.com/bluez/bluez/issues/582
> Link: https://lore.kernel.org/linux-bluetooth/CABBYNZKco-v7wkjHHexxQbgwwSz-S=GZ=dZKbRE1qxT1h4fFbQ@mail.gmail.com/T/#
> Fixes: 288c90224eec ("Bluetooth: Enable all supported LE PHY by default")
> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>
> [...]
Here is the summary with links:
- [v4] Bluetooth: HCI: Introduce HCI_QUIRK_BROKEN_LE_CODED
https://git.kernel.org/bluetooth/bluetooth-next/c/1098ecdb96b2
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-08-23 21:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-23 19:41 [PATCH v4] Bluetooth: HCI: Introduce HCI_QUIRK_BROKEN_LE_CODED Luiz Augusto von Dentz
2023-08-23 20:37 ` [v4] " bluez.test.bot
2023-08-23 21:20 ` [PATCH v4] " patchwork-bot+bluetooth
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).