summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorShuai Zhang <shuai.zhang@oss.qualcomm.com>2026-08-18 19:41:16 +0800
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2026-08-18 14:13:10 -0400
commitb03f74d42e24970bb20a3044ad8ccfe04ead61a7 (patch)
tree9133642b109df57fd40ab27496a22c06fdbdd2df /scripts
parent762385e8620095062238d5ce527905a68c552a85 (diff)
downloadlinux-next-b03f74d42e24970bb20a3044ad8ccfe04ead61a7.tar.gz
linux-next-b03f74d42e24970bb20a3044ad8ccfe04ead61a7.zip
Bluetooth: mgmt: reply to cancelled mgmt commands instead of silently dropping
The kernel sets HCI_AUTO_OFF when a controller is first registered and starts a 2-second timer. On slower boots bluetoothd and the HCI_AUTO_OFF timer can race: hci_power_off() is already queued while bluetoothd is still in the middle of its adapter setup sequence. hci_cmd_sync_clear() then cancels any pending mgmt commands with -ECANCELED, including the MGMT_OP_REMOVE_ADV_MONITOR sent by reset_adv_monitors() early in the setup sequence. When auto_off=1, hci_dev_close_sync() skips __mgmt_power_off() entirely, so there is no fallback path to reply to the cancelled commands. mgmt_remove_adv_monitor_complete() silently returns on -ECANCELED, leaving the command with no reply. Since bluez's mgmt queue is strictly serialised, this stalls all subsequent commands indefinitely, leaving bluetoothd unable to register the adapter. Fix by mapping -ECANCELED to MGMT_STATUS_CANCELLED in mgmt_errno_status() and replying to the cancelled command in mgmt_remove_adv_monitor_complete() instead of returning early. Signed-off-by: Shuai Zhang <shuai.zhang@oss.qualcomm.com> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions