Skip to content

[PW_SID:1104423] [v2] Bluetooth: hci_event: fix simultaneous discovery stuck in FINDING#272

Open
BluezTestBot wants to merge 1 commit into
workflowfrom
1104423
Open

[PW_SID:1104423] [v2] Bluetooth: hci_event: fix simultaneous discovery stuck in FINDING#272
BluezTestBot wants to merge 1 commit into
workflowfrom
1104423

Conversation

@BluezTestBot
Copy link
Copy Markdown

When hci_inquiry_complete_evt is called between le_scan_disable and
le_set_scan_enable_complete and no remote name needs to be resolved,
the interleaved discovery with SIMULTANEOUS quirk gets stuck in
DISCOVERY_FINDING. le_set_scan_enable_complete does not check inquiry
state. No one sets DISCOVERY_STOPPED in this process.

Add state check in le_set_scan_enable_complete and change state if
the state is DISCOVERY_FINDING. Tested with AX201 (8087:0026) in Dell
Vostro 13. Discovering disabled MGMT Event below is reported when
running into the above condition.

@ MGMT Command: Start Discovery (0x0023) {0x0001} [hci0] 10885.970873
Address type: 0x07
BR/EDR
LE Public
LE Random
...
< HCI Command: LE Set Extended Scan Enable #38205 [hci0] 10886.131438
Extended scan: Enabled (0x01)
Filter duplicates: Enabled (0x01)
Duration: 0 msec (0x0000)
Period: 0.00 sec (0x0000)

HCI Event: Command Complete (0x0e) plen 4 #38206 [hci0] 10886.133295
LE Set Extended Scan Enable (0x08|0x0042) ncmd 2
Status: Success (0x00)
@ MGMT Event: Discovering (0x0013) plen 2 {0x0001} [hci0] 10886.133414
Address type: 0x07
BR/EDR
LE Public
LE Random
Discovery: Enabled (0x01)
< HCI Command: Inquiry (0x01|0x0001) plen 5 #38207 [hci0] 10886.133528
Access code: 0x9e8b33 (General Inquiry)
Length: 10.24s (0x08)
Num responses: 0
HCI Event: Command Status (0x0f) plen 4 #38208 [hci0] 10886.141333
Inquiry (0x01|0x0001) ncmd 2
Status: Success (0x00)
...
< HCI Command: LE Set Extended Scan Enable #38242 [hci0] 10896.381802
Extended scan: Disabled (0x00)
Filter duplicates: Disabled (0x00)
Duration: 0 msec (0x0000)
Period: 0.00 sec (0x0000)
HCI Event: Inquiry Complete (0x01) plen 1 #38243 [hci0] 10896.383419
Status: Success (0x00)
HCI Event: Command Complete (0x0e) plen 4 #38244 [hci0] 10896.394378
LE Set Extended Scan Enable (0x08|0x0042) ncmd 2
Status: Success (0x00)
@ MGMT Event: Device Found (0x0012) plen 22 {0x0001} [hci0] 10896.394497
LE Address: 88:12:AC:92:43:69
RSSI: -101 dBm (0x9b)
Flags: 0x00000004
Not Connectable
Data length: 8
Company: Xiaomi Inc. (911)
Data[0]:
16-bit Service UUIDs (complete): 1 entry
Xiaomi Inc. (0xfdaa)
@ MGMT Event: Discovering (0x0013) plen 2 {0x0001} [hci0] 10896.394506
Address type: 0x07
BR/EDR
LE Public
LE Random
Discovery: Disabled (0x00)

Fixes: 8ffde2a ("Bluetooth: Convert le_scan_disable timeout to hci_sync")
Signed-off-by: Jiajia Liu liujiajia@kylinos.cn

Changes in v2:

  • move the handler to hci_event.c
  • remove unnecessary bt_dev_dbg
  • update commit message

net/bluetooth/hci_event.c | 7 +++++++
1 file changed, 7 insertions(+)

When hci_inquiry_complete_evt is called between le_scan_disable and
le_set_scan_enable_complete and no remote name needs to be resolved,
the interleaved discovery with SIMULTANEOUS quirk gets stuck in
DISCOVERY_FINDING. le_set_scan_enable_complete does not check inquiry
state. No one sets DISCOVERY_STOPPED in this process.

Add state check in le_set_scan_enable_complete and change state if
the state is DISCOVERY_FINDING. Tested with AX201 (8087:0026) in Dell
Vostro 13. Discovering disabled MGMT Event below is reported when
running into the above condition.

 @ MGMT Command: Start Discovery (0x0023)    {0x0001} [hci0] 10885.970873
         Address type: 0x07
           BR/EDR
           LE Public
           LE Random
 ...
 < HCI Command: LE Set Extended Scan Enable    #38205 [hci0] 10886.131438
         Extended scan: Enabled (0x01)
         Filter duplicates: Enabled (0x01)
         Duration: 0 msec (0x0000)
         Period: 0.00 sec (0x0000)
 > HCI Event: Command Complete (0x0e) plen 4   #38206 [hci0] 10886.133295
       LE Set Extended Scan Enable (0x08|0x0042) ncmd 2
         Status: Success (0x00)
 @ MGMT Event: Discovering (0x0013) plen 2   {0x0001} [hci0] 10886.133414
         Address type: 0x07
           BR/EDR
           LE Public
           LE Random
         Discovery: Enabled (0x01)
 < HCI Command: Inquiry (0x01|0x0001) plen 5   #38207 [hci0] 10886.133528
         Access code: 0x9e8b33 (General Inquiry)
         Length: 10.24s (0x08)
         Num responses: 0
 > HCI Event: Command Status (0x0f) plen 4     #38208 [hci0] 10886.141333
       Inquiry (0x01|0x0001) ncmd 2
         Status: Success (0x00)
 ...
 < HCI Command: LE Set Extended Scan Enable    #38242 [hci0] 10896.381802
         Extended scan: Disabled (0x00)
         Filter duplicates: Disabled (0x00)
         Duration: 0 msec (0x0000)
         Period: 0.00 sec (0x0000)
 > HCI Event: Inquiry Complete (0x01) plen 1   #38243 [hci0] 10896.383419
         Status: Success (0x00)
 > HCI Event: Command Complete (0x0e) plen 4   #38244 [hci0] 10896.394378
       LE Set Extended Scan Enable (0x08|0x0042) ncmd 2
         Status: Success (0x00)
 @ MGMT Event: Device Found (0x0012) plen 22 {0x0001} [hci0] 10896.394497
         LE Address: 88:12:AC:92:43:69
         RSSI: -101 dBm (0x9b)
         Flags: 0x00000004
           Not Connectable
         Data length: 8
         Company: Xiaomi Inc. (911)
           Data[0]:
         16-bit Service UUIDs (complete): 1 entry
           Xiaomi Inc. (0xfdaa)
 @ MGMT Event: Discovering (0x0013) plen 2   {0x0001} [hci0] 10896.394506
         Address type: 0x07
           BR/EDR
           LE Public
           LE Random
         Discovery: Disabled (0x00)

Fixes: 8ffde2a ("Bluetooth: Convert le_scan_disable timeout to hci_sync")
Signed-off-by: Jiajia Liu <liujiajia@kylinos.cn>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

CheckPatch
Desc: Run checkpatch.pl script
Duration: 0.76 seconds
Result: PASS

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

VerifyFixes
Desc: Verify Fixes tag format and validity
Duration: 0.14 seconds
Result: PASS

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

VerifySignedoff
Desc: Verify Signed-off-by chain
Duration: 0.14 seconds
Result: PASS

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

GitLint
Desc: Run gitlint
Duration: 0.37 seconds
Result: PASS

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

SubjectPrefix
Desc: Check subject contains "Bluetooth" prefix
Duration: 0.13 seconds
Result: PASS

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

BuildKernel
Desc: Build Kernel for Bluetooth
Duration: 26.13 seconds
Result: PASS

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

CheckAllWarning
Desc: Run linux kernel with all warning enabled
Duration: 27.92 seconds
Result: PASS

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

CheckSparse
Desc: Run sparse tool with linux kernel
Duration: 27.22 seconds
Result: PASS

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

BuildKernel32
Desc: Build 32bit Kernel for Bluetooth
Duration: 25.43 seconds
Result: PASS

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

TestRunnerSetup
Desc: Setup kernel and bluez for test-runner
Duration: 522.36 seconds
Result: PASS

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

TestRunner_l2cap-tester
Desc: Run l2cap-tester with test-runner
Duration: 57.70 seconds
Result: PASS

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

TestRunner_iso-tester
Desc: Run iso-tester with test-runner
Duration: 76.39 seconds
Result: PASS

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

TestRunner_bnep-tester
Desc: Run bnep-tester with test-runner
Duration: 19.10 seconds
Result: PASS

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

TestRunner_mgmt-tester
Desc: Run mgmt-tester with test-runner
Duration: 208.55 seconds
Result: FAIL
Output:

Total: 494, Passed: 489 (99.0%), Failed: 1, Not Run: 4

Failed Test Cases
Read Exp Feature - Success                           Failed       0.237 seconds

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

TestRunner_rfcomm-tester
Desc: Run rfcomm-tester with test-runner
Duration: 25.54 seconds
Result: PASS

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

TestRunner_sco-tester
Desc: Run sco-tester with test-runner
Duration: 32.18 seconds
Result: PASS

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

TestRunner_ioctl-tester
Desc: Run ioctl-tester with test-runner
Duration: 25.97 seconds
Result: PASS

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

TestRunner_mesh-tester
Desc: Run mesh-tester with test-runner
Duration: 26.03 seconds
Result: FAIL
Output:

Total: 10, Passed: 8 (80.0%), Failed: 2, Not Run: 0

Failed Test Cases
Mesh - Send cancel - 1                               Timed out    2.593 seconds
Mesh - Send cancel - 2                               Timed out    1.993 seconds

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

TestRunner_smp-tester
Desc: Run smp-tester with test-runner
Duration: 23.19 seconds
Result: PASS

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

TestRunner_userchan-tester
Desc: Run userchan-tester with test-runner
Duration: 20.07 seconds
Result: PASS

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

TestRunner_6lowpan-tester
Desc: Run 6lowpan-tester with test-runner
Duration: 22.58 seconds
Result: PASS

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

IncrementalBuild
Desc: Incremental build with the patches in the series
Duration: 24.00 seconds
Result: PASS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant