[PW_SID:1154312] Bluetooth: Reject controller operations while powering down - #671
[PW_SID:1154312] Bluetooth: Reject controller operations while powering down#671BluezTestBot wants to merge 6 commits into
Conversation
This patch adds workflow files for ci: [sync.yml] - The workflow file for scheduled work - Sync the repo with upstream repo and rebase the workflow branch - Review the patches in the patchwork and creates the PR if needed [ci.yml] - The workflow file for CI tasks - Run CI tests when PR is created Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com>
This replaces the bzcafe action with bluez/action-ci so we can maintain everything in the github bluez organization Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This attempts to sync every 5 minutes instead of 30. Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
bluez/action-ci uses master as default branch for workflow which is incorrect for kernel Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
The CI action now creates individual GitHub Check Runs per test, which requires 'checks: write' permission on the GITHUB_TOKEN. Also make the pull_request trigger types explicit to include 'reopened', allowing CI to be retriggered by closing and reopening a PR.
When an adapter is powered off with devices still connected (e.g. a Bluetooth keyboard or mouse), the shutdown sequence issues an HCI reset which returns Command Complete while the controller firmware is still rebooting. A concurrent command sent through a raw socket during this window (e.g. periodic hciconfig queries triggered by the Bluetooth status change) can leave the firmware in a stuck state where it stops answering any HCI command. The subsequent power on then fails with 'Bluetooth: hci0: Opcode 0x0c03 failed: -110' and the adapter is lost until reboot or re-enumeration. Reject controller operations while HCI_POWERING_DOWN is set at the public entry points in hci_core.c, which covers the ioctl (HCIDEVUP, HCIDEVDOWN, HCIDEVRESET) and raw socket bind paths: - hci_dev_open(): return -EBUSY - hci_dev_close(): return -EBUSY - hci_dev_reset(): return -EBUSY In addition reject raw command transmission from an already bound socket during the power down sequence in hci_sock_sendmsg() (-ENETDOWN), and fail early in hci_sock_bind() (-EBUSY) to avoid toggling HCI_USER_CHANNEL while powering down. Signed-off-by: Chen Zhang <zhangchen01@kylinos.cn>
|
CheckPatch |
|
VerifyFixes |
|
VerifySignedoff |
|
GitLint |
|
SubjectPrefix |
|
BuildKernel |
|
CheckAllWarning |
|
CheckSparse |
|
BuildKernel32 |
|
CheckKernelLLVM |
|
TestRunnerSetup |
|
TestRunner_l2cap-tester |
|
TestRunner_iso-tester |
|
TestRunner_bnep-tester |
|
TestRunner_mgmt-tester |
|
TestRunner_rfcomm-tester |
|
TestRunner_sco-tester |
|
TestRunner_ioctl-tester |
|
TestRunner_mesh-tester |
|
TestRunner_smp-tester |
|
TestRunner_userchan-tester |
|
TestRunner_6lowpan-tester |
|
IncrementalBuild |
8f53a45 to
d690686
Compare
From: Chen Zhang zhangchen01@kylinos.cn
When an adapter is powered off with devices still connected (e.g. a
Bluetooth keyboard or mouse), the shutdown sequence issues an HCI reset
which returns Command Complete while the controller firmware is still
rebooting. A concurrent command sent through a raw socket during this
window (e.g. periodic hciconfig queries triggered by the Bluetooth
status change) can leave the firmware in a stuck state where it stops
answering any HCI command. The subsequent power on then fails with
'Bluetooth: hci0: Opcode 0x0c03 failed: -110' and the adapter is lost
until reboot or re-enumeration.
Reject controller operations while HCI_POWERING_DOWN is set at the
public entry points in hci_core.c, which covers the ioctl (HCIDEVUP,
HCIDEVDOWN, HCIDEVRESET) and raw socket bind paths:
In addition reject raw command transmission from an already bound
socket during the power down sequence in hci_sock_sendmsg()
(-ENETDOWN), and fail early in hci_sock_bind() (-EBUSY) to avoid
toggling HCI_USER_CHANNEL while powering down.
Signed-off-by: Chen Zhang zhangchen01@kylinos.cn
net/bluetooth/hci_core.c | 28 ++++++++++++++++++++++++++++
net/bluetooth/hci_sock.c | 4 +++-
2 files changed, 31 insertions(+), 1 deletion(-)