* [PATCH] Bluetooth: hci_sync: fix LE init stage 3 failure
@ 2024-11-18 15:19 André Groenewald
2024-11-18 15:28 ` Luiz Augusto von Dentz
2024-11-18 15:58 ` bluez.test.bot
0 siblings, 2 replies; 3+ messages in thread
From: André Groenewald @ 2024-11-18 15:19 UTC (permalink / raw)
To: marcel, johan.hedberg, luiz.dentz, linux-bluetooth, linux-kernel
Cc: André Groenewald
A controller may indicate support for the extended advertising feature but
doesn't support the HCI_LE_Read_Number_of_Supported_Advertising_Sets
command, which will cause the initialization to fail.
Signed-off-by: André Groenewald <andre.groenewald@streamunlimited.com>
---
net/bluetooth/hci_sync.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index c86f4e42e69c..c07be5813113 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -4416,6 +4416,15 @@ static int hci_le_read_num_support_adv_sets_sync(struct hci_dev *hdev)
if (!ext_adv_capable(hdev))
return 0;
+ /* Checking for extended advertising capabilities is not enough; refine
+ * by checking if the HCI_LE_Read_Number_of_Supported_Advertising_Sets
+ * command is supported. Since this command is part of the LE init
+ * stage 3, the initialization will fail whenever the command is not
+ * supported for devices that indicate extended advertising features.
+ */
+ if (!(hdev->commands[36] & 0x80))
+ return 0;
+
return __hci_cmd_sync_status(hdev,
HCI_OP_LE_READ_NUM_SUPPORTED_ADV_SETS,
0, NULL, HCI_CMD_TIMEOUT);
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Bluetooth: hci_sync: fix LE init stage 3 failure
2024-11-18 15:19 [PATCH] Bluetooth: hci_sync: fix LE init stage 3 failure André Groenewald
@ 2024-11-18 15:28 ` Luiz Augusto von Dentz
2024-11-18 15:58 ` bluez.test.bot
1 sibling, 0 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2024-11-18 15:28 UTC (permalink / raw)
To: André Groenewald
Cc: marcel, johan.hedberg, linux-bluetooth, linux-kernel
Hi André,
On Mon, Nov 18, 2024 at 10:19 AM André Groenewald
<andre.groenewald@streamunlimited.com> wrote:
>
> A controller may indicate support for the extended advertising feature but
> doesn't support the HCI_LE_Read_Number_of_Supported_Advertising_Sets
> command, which will cause the initialization to fail.
It might be a good idea to mention the model and include the HCI trace
so it is easier for others to find out there is a fix for this
controller.
> Signed-off-by: André Groenewald <andre.groenewald@streamunlimited.com>
> ---
> net/bluetooth/hci_sync.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
> index c86f4e42e69c..c07be5813113 100644
> --- a/net/bluetooth/hci_sync.c
> +++ b/net/bluetooth/hci_sync.c
> @@ -4416,6 +4416,15 @@ static int hci_le_read_num_support_adv_sets_sync(struct hci_dev *hdev)
> if (!ext_adv_capable(hdev))
> return 0;
>
> + /* Checking for extended advertising capabilities is not enough; refine
> + * by checking if the HCI_LE_Read_Number_of_Supported_Advertising_Sets
> + * command is supported. Since this command is part of the LE init
> + * stage 3, the initialization will fail whenever the command is not
> + * supported for devices that indicate extended advertising features.
> + */
> + if (!(hdev->commands[36] & 0x80))
> + return 0;
Is this enough though? How can we figure the number of sets supported?
Or we shall assume it is just 1? Otherwise it might be better to just
revert to using legacy advertising commands instead.
> return __hci_cmd_sync_status(hdev,
> HCI_OP_LE_READ_NUM_SUPPORTED_ADV_SETS,
> 0, NULL, HCI_CMD_TIMEOUT);
> --
> 2.34.1
>
--
Luiz Augusto von Dentz
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: Bluetooth: hci_sync: fix LE init stage 3 failure
2024-11-18 15:19 [PATCH] Bluetooth: hci_sync: fix LE init stage 3 failure André Groenewald
2024-11-18 15:28 ` Luiz Augusto von Dentz
@ 2024-11-18 15:58 ` bluez.test.bot
1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2024-11-18 15:58 UTC (permalink / raw)
To: linux-bluetooth, andre.groenewald
[-- Attachment #1: Type: text/plain, Size: 1903 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=910673
---Test result---
Test Summary:
CheckPatch PENDING 0.34 seconds
GitLint PENDING 0.28 seconds
SubjectPrefix PASS 0.06 seconds
BuildKernel PASS 25.54 seconds
CheckAllWarning PASS 27.96 seconds
CheckSparse PASS 31.11 seconds
BuildKernel32 PASS 25.11 seconds
TestRunnerSetup PASS 447.44 seconds
TestRunner_l2cap-tester PASS 20.94 seconds
TestRunner_iso-tester FAIL 35.16 seconds
TestRunner_bnep-tester PASS 4.95 seconds
TestRunner_mgmt-tester PASS 120.28 seconds
TestRunner_rfcomm-tester PASS 7.78 seconds
TestRunner_sco-tester PASS 11.63 seconds
TestRunner_ioctl-tester PASS 8.33 seconds
TestRunner_mesh-tester PASS 7.08 seconds
TestRunner_smp-tester PASS 7.16 seconds
TestRunner_userchan-tester PASS 5.10 seconds
IncrementalBuild PENDING 0.80 seconds
Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:
##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:
##############################
Test: TestRunner_iso-tester - FAIL
Desc: Run iso-tester with test-runner
Output:
WARNING: possible circular locking dependency detected
Total: 124, Passed: 120 (96.8%), Failed: 0, Not Run: 4
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-11-18 15:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-18 15:19 [PATCH] Bluetooth: hci_sync: fix LE init stage 3 failure André Groenewald
2024-11-18 15:28 ` Luiz Augusto von Dentz
2024-11-18 15:58 ` bluez.test.bot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.