From: Yang Li <yang.li@amlogic.com>
To: christian.koever-draxl@student.uibk.ac.at, marcel@holtmann.org,
luiz.dentz@gmail.com, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org
Cc: linux-bluetooth@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
"Christian Stefan Kövér-Draxl" <ckoever@outlook.de>
Subject: Re: [PATCH 1/7] Bluetooth: add a quirk for controllers that cannot enable Secure Connections
Date: Thu, 5 Nov 2026 10:19:40 +0800 [thread overview]
Message-ID: <5d5a22a5-b45e-4cf8-9066-e0e641d719bb@amlogic.com> (raw)
In-Reply-To: <20261025192338.209574-2-christian.koever-draxl@student.uibk.ac.at>
Hi,
>
> [ EXTERNAL EMAIL ]
>
> From: Christian Stefan Kövér-Draxl <ckoever@outlook.de>
>
> The Amlogic W1 (W155S2) lists BR/EDR Secure Connections among its
> extended features and then fails HCI_OP_WRITE_SC_SUPPORT with an error.
> That failure is fatal to hci_dev_open_sync(), so the adapter can never
> be powered on: every mgmt Set Powered returns Invalid Parameters and
> bluetoothd gives up on the controller.
>
> Add HCI_QUIRK_BROKEN_WRITE_SC_SUPPORT for controllers whose feature bit
> cannot be taken at face value, skip the command in both places it is
> issued, and set the quirk in hci_aml.
This appears to be an anomaly with the firmware binary. Could you
provide the FW version in use? It is logged during Bluetooth driver
initialization.
> Signed-off-by: Christian Stefan Kövér-Draxl <ckoever@outlook.de>
> ---
> drivers/bluetooth/hci_aml.c | 5 +++++
> include/net/bluetooth/hci.h | 14 ++++++++++++++
> net/bluetooth/hci_sync.c | 8 ++++++--
> 3 files changed, 25 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/bluetooth/hci_aml.c b/drivers/bluetooth/hci_aml.c
> index 067fbf278b44..990e701da4be 100644
> --- a/drivers/bluetooth/hci_aml.c
> +++ b/drivers/bluetooth/hci_aml.c
> @@ -598,6 +598,11 @@ static int aml_setup(struct hci_uart *hu)
> /* Setup bdaddr */
> hdev->set_bdaddr = aml_set_bdaddr;
>
> + /* The controller lists BR/EDR Secure Connections among its extended
> + * features and then rejects the command that turns host support on.
> + */
> + hci_set_quirk(hdev, HCI_QUIRK_BROKEN_WRITE_SC_SUPPORT);
> +
> err = aml_power_on(amldev);
> if (err)
> return err;
> diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
> index 1641d879dbda..bcbe76c84d1b 100644
> --- a/include/net/bluetooth/hci.h
> +++ b/include/net/bluetooth/hci.h
> @@ -375,6 +375,20 @@ enum {
> */
> HCI_QUIRK_BROKEN_READ_PAGE_SCAN_TYPE,
>
> + /*
> + * When this quirk is set, the HCI_OP_WRITE_SC_SUPPORT command is
> + * not supported.
> + *
> + * This quirk is intended for controllers that list BR/EDR Secure
> + * Connections among their extended features and then reject the
> + * command that turns host support on. Without it the failure takes
> + * the whole of hci_dev_open_sync() with it and the controller can
> + * never be powered on.
> + *
> + * This quirk must be set before hci_register_dev is called.
> + */
> + HCI_QUIRK_BROKEN_WRITE_SC_SUPPORT,
> +
> __HCI_NUM_QUIRKS,
> };
>
> diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
> index a92a81846e9d..f1dfef81ca96 100644
> --- a/net/bluetooth/hci_sync.c
> +++ b/net/bluetooth/hci_sync.c
> @@ -3419,7 +3419,8 @@ int hci_write_sc_support_sync(struct hci_dev *hdev, u8 val)
> {
> int err;
>
> - if (!bredr_sc_enabled(hdev) || lmp_host_sc_capable(hdev))
> + if (!bredr_sc_enabled(hdev) || lmp_host_sc_capable(hdev) ||
> + hci_test_quirk(hdev, HCI_QUIRK_BROKEN_WRITE_SC_SUPPORT))
> return 0;
>
> err = __hci_cmd_sync_status(hdev, HCI_OP_WRITE_SC_SUPPORT,
> @@ -5040,7 +5041,8 @@ static int hci_write_sc_support_1_sync(struct hci_dev *hdev)
> u8 support = 0x01;
>
> if (!hci_dev_test_flag(hdev, HCI_SSP_ENABLED) ||
> - !bredr_sc_enabled(hdev))
> + !bredr_sc_enabled(hdev) ||
> + hci_test_quirk(hdev, HCI_QUIRK_BROKEN_WRITE_SC_SUPPORT))
> return 0;
>
> return __hci_cmd_sync_status(hdev, HCI_OP_WRITE_SC_SUPPORT,
> @@ -5254,6 +5256,8 @@ static const struct {
> "HCI WRITE AUTH PAYLOAD TIMEOUT command leads "
> "to unexpected SMP errors when pairing "
> "and will not be used."),
> + HCI_QUIRK_BROKEN(WRITE_SC_SUPPORT,
> + "HCI BR/EDR Secure Connections is advertised, but cannot be enabled."),
> HCI_QUIRK_BROKEN(LE_CODED,
> "HCI LE Coded PHY feature bit is set, "
> "but its usage is not supported.")
> --
> 2.56.0
>
next prev parent reply other threads:[~2026-11-05 2:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-25 19:23 [PATCH 0/7] Bluetooth: make the Amlogic W1 (W155S2) usable christian.koever-draxl
2026-10-25 19:23 ` [PATCH 1/7] Bluetooth: add a quirk for controllers that cannot enable Secure Connections christian.koever-draxl
2026-11-05 2:19 ` Yang Li [this message]
2026-10-25 19:23 ` [PATCH 2/7] Bluetooth: add a quirk for controllers that hang on Write Current IAC LAP christian.koever-draxl
2026-11-05 2:24 ` Yang Li
2026-10-25 19:23 ` [PATCH 3/7] Bluetooth: hci_aml: cope with a controller that is already running christian.koever-draxl
2026-10-25 19:23 ` [PATCH 4/7] dt-bindings: net: bluetooth: amlogic,w155s2-bt: allow local-bd-address christian.koever-draxl
2026-10-30 11:32 ` Krzysztof Kozlowski
2026-10-25 19:23 ` [PATCH 5/7] Bluetooth: hci_aml: take the address from the firmware description christian.koever-draxl
2026-10-25 19:23 ` [PATCH 6/7] dt-bindings: net: bluetooth: amlogic,w155s2-bt: add amlogic,shared-antenna christian.koever-draxl
2026-10-30 11:40 ` Krzysztof Kozlowski
2026-10-25 19:23 ` [PATCH 7/7] Bluetooth: hci_aml: configure the RF for a shared antenna christian.koever-draxl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5d5a22a5-b45e-4cf8-9066-e0e641d719bb@amlogic.com \
--to=yang.li@amlogic.com \
--cc=christian.koever-draxl@student.uibk.ac.at \
--cc=ckoever@outlook.de \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
--cc=marcel@holtmann.org \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®