All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: hci_sync: Avoid adding default advertising on startup
@ 2025-07-28  9:08 ` Yang Li via B4 Relay
  0 siblings, 0 replies; 4+ messages in thread
From: Yang Li @ 2025-07-28  9:08 UTC (permalink / raw)
  To: Marcel Holtmann, Johan Hedberg, Luiz Augusto von Dentz
  Cc: linux-bluetooth, linux-kernel, Yang Li

list_empty(&hdev->adv_instances) is always true during startup,
so an advertising instance is added by default.

Call trace:
  dump_backtrace+0x94/0xec
  show_stack+0x18/0x24
  dump_stack_lvl+0x48/0x60
  dump_stack+0x18/0x24
  hci_setup_ext_adv_instance_sync+0x17c/0x328
  hci_powered_update_adv_sync+0xb4/0x12c
  hci_powered_update_sync+0x54/0x70
  hci_power_on_sync+0xe4/0x278
  hci_set_powered_sync+0x28/0x34
  set_powered_sync+0x40/0x58
  hci_cmd_sync_work+0x94/0x100
  process_one_work+0x168/0x444
  worker_thread+0x378/0x3f4
  kthread+0x108/0x10c
  ret_from_fork+0x10/0x20

Fixes: https://github.com/bluez/bluez/issues/1442

Signed-off-by: Yang Li <yang.li@amlogic.com>
---
 net/bluetooth/hci_sync.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index 2b4f21fbf9c1..7397b6b50ccb 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -3344,7 +3344,7 @@ static int hci_powered_update_adv_sync(struct hci_dev *hdev)
 	 * advertising data. This also applies to the case
 	 * where BR/EDR was toggled during the AUTO_OFF phase.
 	 */
-	if (hci_dev_test_flag(hdev, HCI_ADVERTISING) ||
+	if (hci_dev_test_flag(hdev, HCI_ADVERTISING) &&
 	    list_empty(&hdev->adv_instances)) {
 		if (ext_adv_capable(hdev)) {
 			err = hci_setup_ext_adv_instance_sync(hdev, 0x00);

---
base-commit: d1b3de23042b0aac0145fdf071d6ac81ec3727b4
change-id: 20250728-default_adv-c5547ad3bcd2

Best regards,
-- 
Yang Li <yang.li@amlogic.com>


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] Bluetooth: hci_sync: Avoid adding default advertising on startup
@ 2025-07-28  9:08 ` Yang Li via B4 Relay
  0 siblings, 0 replies; 4+ messages in thread
From: Yang Li via B4 Relay @ 2025-07-28  9:08 UTC (permalink / raw)
  To: Marcel Holtmann, Johan Hedberg, Luiz Augusto von Dentz
  Cc: linux-bluetooth, linux-kernel, Yang Li

From: Yang Li <yang.li@amlogic.com>

list_empty(&hdev->adv_instances) is always true during startup,
so an advertising instance is added by default.

Call trace:
  dump_backtrace+0x94/0xec
  show_stack+0x18/0x24
  dump_stack_lvl+0x48/0x60
  dump_stack+0x18/0x24
  hci_setup_ext_adv_instance_sync+0x17c/0x328
  hci_powered_update_adv_sync+0xb4/0x12c
  hci_powered_update_sync+0x54/0x70
  hci_power_on_sync+0xe4/0x278
  hci_set_powered_sync+0x28/0x34
  set_powered_sync+0x40/0x58
  hci_cmd_sync_work+0x94/0x100
  process_one_work+0x168/0x444
  worker_thread+0x378/0x3f4
  kthread+0x108/0x10c
  ret_from_fork+0x10/0x20

Fixes: https://github.com/bluez/bluez/issues/1442

Signed-off-by: Yang Li <yang.li@amlogic.com>
---
 net/bluetooth/hci_sync.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index 2b4f21fbf9c1..7397b6b50ccb 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -3344,7 +3344,7 @@ static int hci_powered_update_adv_sync(struct hci_dev *hdev)
 	 * advertising data. This also applies to the case
 	 * where BR/EDR was toggled during the AUTO_OFF phase.
 	 */
-	if (hci_dev_test_flag(hdev, HCI_ADVERTISING) ||
+	if (hci_dev_test_flag(hdev, HCI_ADVERTISING) &&
 	    list_empty(&hdev->adv_instances)) {
 		if (ext_adv_capable(hdev)) {
 			err = hci_setup_ext_adv_instance_sync(hdev, 0x00);

---
base-commit: d1b3de23042b0aac0145fdf071d6ac81ec3727b4
change-id: 20250728-default_adv-c5547ad3bcd2

Best regards,
-- 
Yang Li <yang.li@amlogic.com>



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* RE: Bluetooth: hci_sync: Avoid adding default advertising on startup
  2025-07-28  9:08 ` Yang Li via B4 Relay
  (?)
@ 2025-07-28  9:43 ` bluez.test.bot
  -1 siblings, 0 replies; 4+ messages in thread
From: bluez.test.bot @ 2025-07-28  9:43 UTC (permalink / raw)
  To: linux-bluetooth, yang.li

[-- Attachment #1: Type: text/plain, Size: 2027 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=986353

---Test result---

Test Summary:
CheckPatch                    PENDING   0.30 seconds
GitLint                       PENDING   0.22 seconds
SubjectPrefix                 PASS      0.12 seconds
BuildKernel                   PASS      24.29 seconds
CheckAllWarning               PASS      26.85 seconds
CheckSparse                   PASS      30.32 seconds
BuildKernel32                 PASS      24.24 seconds
TestRunnerSetup               PASS      479.76 seconds
TestRunner_l2cap-tester       PASS      25.20 seconds
TestRunner_iso-tester         PASS      37.78 seconds
TestRunner_bnep-tester        PASS      6.07 seconds
TestRunner_mgmt-tester        PASS      129.69 seconds
TestRunner_rfcomm-tester      PASS      9.38 seconds
TestRunner_sco-tester         PASS      14.65 seconds
TestRunner_ioctl-tester       PASS      9.96 seconds
TestRunner_mesh-tester        FAIL      11.57 seconds
TestRunner_smp-tester         PASS      8.61 seconds
TestRunner_userchan-tester    PASS      6.26 seconds
IncrementalBuild              PENDING   0.84 seconds

Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:

##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:

##############################
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.116 seconds
Mesh - Send cancel - 2                               Timed out    1.998 seconds
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:



---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Bluetooth: hci_sync: Avoid adding default advertising on startup
  2025-07-28  9:08 ` Yang Li via B4 Relay
  (?)
  (?)
@ 2025-07-28 19:50 ` patchwork-bot+bluetooth
  -1 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+bluetooth @ 2025-07-28 19:50 UTC (permalink / raw)
  To: Yang Li; +Cc: marcel, johan.hedberg, luiz.dentz, linux-bluetooth, linux-kernel

Hello:

This patch was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Mon, 28 Jul 2025 17:08:44 +0800 you wrote:
> From: Yang Li <yang.li@amlogic.com>
> 
> list_empty(&hdev->adv_instances) is always true during startup,
> so an advertising instance is added by default.
> 
> Call trace:
>   dump_backtrace+0x94/0xec
>   show_stack+0x18/0x24
>   dump_stack_lvl+0x48/0x60
>   dump_stack+0x18/0x24
>   hci_setup_ext_adv_instance_sync+0x17c/0x328
>   hci_powered_update_adv_sync+0xb4/0x12c
>   hci_powered_update_sync+0x54/0x70
>   hci_power_on_sync+0xe4/0x278
>   hci_set_powered_sync+0x28/0x34
>   set_powered_sync+0x40/0x58
>   hci_cmd_sync_work+0x94/0x100
>   process_one_work+0x168/0x444
>   worker_thread+0x378/0x3f4
>   kthread+0x108/0x10c
>   ret_from_fork+0x10/0x20
> 
> [...]

Here is the summary with links:
  - Bluetooth: hci_sync: Avoid adding default advertising on startup
    https://git.kernel.org/bluetooth/bluetooth-next/c/b88313f2a6c3

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] 4+ messages in thread

end of thread, other threads:[~2025-07-28 19:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-28  9:08 [PATCH] Bluetooth: hci_sync: Avoid adding default advertising on startup Yang Li
2025-07-28  9:08 ` Yang Li via B4 Relay
2025-07-28  9:43 ` bluez.test.bot
2025-07-28 19:50 ` [PATCH] " patchwork-bot+bluetooth

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.