Bluetooth: hci_ll: Add DT control for enhanced SCO setup erratum
Subsystems (2)
cover Bluetooth: hci_ll: Add DT control for enhanced SCO setup erratum
While validating SCO audio on a platform using TI WL183x Bluetooth modules with the hci_ll driver, we observed failures when the HCI Enhanced Setup Synchronous Connection command was used.
Although the controller advertises support for the command, SCO setup fails in certain configurations (e.g. BT_VOICE_TRANSPARENT/mSBC). This matches the scenario described in commit 05abad857277 ("Bluetooth: HCI: Add HCI_QUIRK_BROKEN_ENHANCED_SETUP_SYNC_CONN quirk").
Initially, we considered setting the HCI_QUIRK_BROKEN_ENHANCED_SETUP_SYNC_CONN quirk unconditionally in hci_ll. However, this would affect all TI controllers handled by the driver, including configurations where the enhanced setup command works correctly.
To avoid hardcoding the quirk globally, this series introduces an optional DT property that describes the controller limitation and allows enabling the quirk on affected boards only.
Patch 1 updates the TI Bluetooth DT binding.
Patch 2 adds support for the property in hci_ll and sets the quirk during controller setup when requested.
Tested on VAR-SOM-MX6 using TI WL183x modules where SCO audio was previously failing.
Comments welcome.
Stefano Radaelli (2):
dt-bindings: net: bluetooth: ti: Add property for enhanced SCO setup
erratum
Bluetooth: hci_ll: Add DT property to disable enhanced SCO setup
.../devicetree/bindings/net/bluetooth/ti,bluetooth.yaml | 7 +++++++ drivers/bluetooth/hci_ll.c | 9 +++++++++ 2 files changed, 16 insertions(+)
base-commit: 6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f
Signature · 1 line
2.47.3
PATCH 1/2 dt-bindings: net: bluetooth: ti: Add property for enhanced SCO setup erratum
From: Stefano Radaelli <[email protected]>
Some Bluetooth controller/firmware combinations advertise support for the HCI Enhanced Setup Synchronous Connection command but do not handle it correctly for SCO setup in certain configurations (e.g. BT_VOICE_TRANSPARENT/mSBC). This results in SCO audio not working unless the enhanced setup path is avoided.
Add an optional boolean property, ti,no-enhanced-setup-sync-conn, to describe this controller limitation.
--- .../devicetree/bindings/net/bluetooth/ti,bluetooth.yaml | 7 +++++++ 1 file changed, 7 insertions(+)
Documentation/devicetree/bindings/net/bluetooth/ti,bluetooth.yaml +7 -0
@@ -71,6 +71,13 @@ properties: items: - const: bd-address + ti,no-enhanced-setup-sync-conn: + type: boolean + description: + Indicates that the Bluetooth controller/firmware does not correctly + handle the HCI Enhanced Setup Synchronous Connection command for SCO + setup, despite advertising support for it. + required: - compatible
Signature · 1 line
2.47.3
Re: [PATCH v1 1/2] dt-bindings: net: bluetooth: ti: Add property for enhanced SCO setup erratum
Quoted 3 lines · Stefano Radaelli
From: Stefano Radaelli <[email protected]>
Some Bluetooth controller/firmware combinations advertise support for the
Which ones?
Quoted 18 lines
HCI Enhanced Setup Synchronous Connection command but do not handle it correctly for SCO setup in certain configurations (e.g. BT_VOICE_TRANSPARENT/mSBC). This results in SCO audio not working unless the enhanced setup path is avoided.
Add an optional boolean property, ti,no-enhanced-setup-sync-conn, to describe this controller limitation.
Signed-off-by Stefano Radaelli <[email protected]>--- .../devicetree/bindings/net/bluetooth/ti,bluetooth.yaml | 7 +++++++ 1 file changed, 7 insertions(+)Documentation/devicetree/bindings/net/bluetooth/ti,bluetooth.yaml +0
-0
Documentation/devicetree/bindings/net/bluetooth/ti,bluetooth.yaml properties: · line 79
Quoted 9 lines
Documentation/devicetree/bindings/net/bluetooth/ti,bluetooth.yaml +6
-0@@ -71,6 +71,13 @@ properties: items: - const: bd-address + ti,no-enhanced-setup-sync-conn: + type: boolean + description: + Indicates that the Bluetooth controller/firmware does not correctly + handle the HCI Enhanced Setup Synchronous Connection command for SCO + setup, despite advertising support for it.
This looks a lot like controller issue, thus deducible from the compatible. And even if particular firmware has problem, how do you see changing static DTS on linux-firmware update?
Best regards,
Krzysztof
Re: [PATCH v1 1/2] dt-bindings: net: bluetooth: ti: Add property for enhanced SCO setup erratum
Quoted 8 lines · Krzysztof Kozlowski
Quoted 3 lines · Stefano Radaelli
From: Stefano Radaelli <[email protected]>
Some Bluetooth controller/firmware combinations advertise support for the
Which ones?
Quoted 6 lines
This looks a lot like controller issue, thus deducible from the compatible. And even if particular firmware has problem, how do you see changing static DTS on linux-firmware update?
Best regards,
Krzysztof
Hi Krzysztof,
thank you for your review!
We have observed this behaviour specifically on TI WL1831 modules.
When using the HCI Enhanced Setup Synchronous Connection command, SCO setup fails even though the controller reports the command as supported. The only working path for this controller is to fall back to the legacy HCI Setup Synchronous Connection (0x0028). The behaviour matches the scenario described in commit 05abad857277, which introduced HCI_QUIRK_BROKEN_ENHANCED_SETUP_SYNC_CONN for that reason.
We are using the latest firmware available from TI for the wl18xx family (from the official TI repository), so this is not related to an outdated firmware version.
The reason for proposing a DT property was to keep the workaround flexible and avoid forcing the quirk on all TI controllers handled by hci_ll without confirmation.
However, since this may be considered deducible from the compatible, would you prefer enabling HCI_QUIRK_BROKEN_ENHANCED_SETUP_SYNC_CONN automatically for "ti,wl1831-st" instead of using a DT property?
Thanks for the feedback.
Best regards,
Stefano
Re: [PATCH v1 1/2] dt-bindings: net: bluetooth: ti: Add property for enhanced SCO setup erratum
Quoted 30 lines · Stefano Radaelli
Quoted 8 lines · Krzysztof Kozlowski
Quoted 3 lines · Stefano Radaelli
From: Stefano Radaelli <[email protected]>
Some Bluetooth controller/firmware combinations advertise support for the
Which ones?
Quoted 6 lines
This looks a lot like controller issue, thus deducible from the compatible. And even if particular firmware has problem, how do you see changing static DTS on linux-firmware update?
Best regards,
KrzysztofHi Krzysztof,
thank you for your review!
We have observed this behaviour specifically on TI WL1831 modules.
When using the HCI Enhanced Setup Synchronous Connection command, SCO setup fails even though the controller reports the command as supported. The only working path for this controller is to fall back to the legacy HCI Setup Synchronous Connection (
0x0028). The behaviour matches the scenario described in commit05abad857277, which introducedHCI_QUIRK_BROKEN_ENHANCED_SETUP_SYNC_CONNfor that reason.
Quoted 7 lines
We are using the latest firmware available from TI for the wl18xx family (from the official TI repository), so this is not related to an outdated firmware version.
The reason for proposing a DT property was to keep the workaround flexible and avoid forcing the quirk on all TI controllers handled by
hci_llwithout confirmation.
I did not propose to enable it on ALL TI controllers. I asked to deduce it from given compatible, so to enable it on affected devices.
Quoted 5 lines
However, since this may be considered deducible from the compatible, would you prefer enabling
HCI_QUIRK_BROKEN_ENHANCED_SETUP_SYNC_CONNautomatically for "ti,wl1831-st" instead of using a DT property?
Yes
Best regards,
Krzysztof
Re: [PATCH v1 1/2] dt-bindings: net: bluetooth: ti: Add property for enhanced SCO setup erratum
Hi Krzysztof,
Quoted 8 lines · Krzysztof Kozlowski
Quoted 5 lines
However, since this may be considered deducible from the compatible, would you prefer enabling
HCI_QUIRK_BROKEN_ENHANCED_SETUP_SYNC_CONNautomatically for "ti,wl1831-st" instead of using a DT property?Yes
We have now tested the WL183x family and observed the same behaviour across WL1831, WL1835 and WL1837 modules.
Since this affects the WL183x family and is therefore deducible from the compatible, I will respin the patch to enable HCI_QUIRK_BROKEN_ENHANCED_SETUP_SYNC_CONN automatically for:
- "ti,wl1831-st"
- "ti,wl1835-st"
- "ti,wl1837-st"
Thanks for the guidance.
Best regards,
Stefano
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=1056461
---Test result---
Test Summary:
CheckPatch PENDING 0.30 seconds GitLint PENDING 0.27 seconds SubjectPrefix FAIL 0.54 seconds BuildKernel PASS 25.55 seconds CheckAllWarning PASS 28.47 seconds CheckSparse PASS 32.15 seconds BuildKernel32 PASS 25.25 seconds TestRunnerSetup PASS 558.65 seconds TestRunner_l2cap-tester PASS 28.27 seconds TestRunner_iso-tester PASS 96.32 seconds TestRunner_bnep-tester PASS 6.34 seconds TestRunner_mgmt-tester FAIL 114.13 seconds TestRunner_rfcomm-tester PASS 9.54 seconds TestRunner_sco-tester FAIL 14.50 seconds TestRunner_ioctl-tester PASS 10.29 seconds TestRunner_mesh-tester FAIL 12.51 seconds TestRunner_smp-tester PASS 8.74 seconds TestRunner_userchan-tester PASS 6.66 seconds IncrementalBuild PENDING 0.75 seconds
Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:
##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:
##############################
Test: SubjectPrefix - FAIL
Desc: Check subject contains "Bluetooth" prefix Output:
"Bluetooth: " prefix is not specified in the subject
##############################
Test: TestRunner_mgmt-tester - FAIL
Desc: Run mgmt-tester with test-runner Output:
Total: 494, Passed: 489 (99.0%), Failed: 1, Not Run: 4
Failed Test Cases
Read Exp Feature - Success Failed 0.107 seconds
##############################
Test: TestRunner_sco-tester - FAIL
Desc: Run sco-tester with test-runner
Output:
WARNING: possible circular locking dependency detected
BUG: sleeping function called from invalid context at net/core/sock.c:3782
Total: 30, Passed: 30 (100.0%), Failed: 0, Not Run: 0
##############################
Test: TestRunner_mesh-tester - FAIL
Desc: Run mesh-tester with test-runner Output:
Total: 10, Passed: 8 (80.0%), Failed: 2, Not Run: 0
Failed Test Cases
Mesh - Send cancel - 1 Timed out 2.667 seconds Mesh - Send cancel - 2 Timed out 1.992 seconds
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series Output:
---
Regards,
Linux Bluetooth
PATCH 2/2 Bluetooth: hci_ll: Add DT property to disable enhanced SCO setup
In reply to Stefano RadaelliThe HCI_QUIRK_BROKEN_ENHANCED_SETUP_SYNC_CONN quirk was introduced by commit 05abad857277 ("Bluetooth: HCI: Add HCI_QUIRK_BROKEN_ENHANCED_SETUP_SYNC_CONN quirk") to handle controllers that advertise support for the HCI Enhanced Setup Synchronous Connection command but fail to use it properly with some SCO configurations (e.g. BT_VOICE_TRANSPARENT/mSBC).
This behavior has been observed on TI controllers used with the hci_ll driver, where SCO setup can fail unless the enhanced setup path is avoided.
Add support for the optional DT property "ti,no-enhanced-setup-sync-conn" and, when present, set HCI_QUIRK_BROKEN_ENHANCED_SETUP_SYNC_CONN during controller setup, as intended by the quirk documentation.
--- drivers/bluetooth/hci_ll.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/bluetooth/hci_ll.c +9 -0
@@ -68,6 +68,7 @@ struct ll_device {struct gpio_desc *enable_gpio;struct clk *ext_clk;bdaddr_t bdaddr; +bool broken_enhanced_setup; };struct ll_struct {
@@ -656,6 +657,10 @@ static int ll_setup(struct hci_uart *hu)hci_set_quirk (hu->hdev,HCI_QUIRK_INVALID_BDADDR ); } +if (lldev->broken_enhanced_setup) +hci_set_quirk (hu->hdev, +HCI_QUIRK_BROKEN_ENHANCED_SETUP_SYNC_CONN ); +/* Operational speed if any */ if (hu->oper_speed) speed = hu->oper_speed;
@@ -710,6 +715,10 @@ static int hci_ti_probe(struct serdev_device *serdev)of_property_read_u32 (serdev->dev.of_node,"max-speed" , &max_speed);hci_uart_set_speeds (hu,115200 , max_speed); + lldev->broken_enhanced_setup = +of_property_read_bool (serdev->dev.of_node, +"ti,no-enhanced-setup-sync-conn" ); +/* optional BD address from nvram */ bdaddr_cell =nvmem_cell_get (&serdev->dev,"bd-address" );if (IS_ERR (bdaddr_cell)) {
Signature · 1 line
2.47.3