Message ID | 20220928130027.v3.1.Ia168b651a69b253059f2bbaa60b98083e619545c@changeid (mailing list archive) |
---|---|
State | Accepted |
Commit | 4b8af331bb4d4cc8bb91c284b11b98dd1e265185 |
Headers | show |
Series | [v3] Bluetooth: Prevent double register of suspend | expand |
Context | Check | Description |
---|---|---|
tedd_an/pre-ci_am | success | Success |
tedd_an/checkpatch | success | Checkpatch PASS |
tedd_an/gitlint | success | Gitlint PASS |
tedd_an/subjectprefix | success | PASS |
tedd_an/buildkernel | success | Build Kernel PASS |
tedd_an/buildkernel32 | success | Build Kernel32 PASS |
tedd_an/incremental_build | success | Pass |
tedd_an/testrunnersetup | success | Test Runner Setup PASS |
tedd_an/testrunnerl2cap-tester | success | Total: 40, Passed: 40 (100.0%), Failed: 0, Not Run: 0 |
tedd_an/testrunneriso-tester | success | Total: 55, Passed: 55 (100.0%), Failed: 0, Not Run: 0 |
tedd_an/testrunnerbnep-tester | success | Total: 1, Passed: 1 (100.0%), Failed: 0, Not Run: 0 |
tedd_an/testrunnermgmt-tester | success | Total: 494, Passed: 494 (100.0%), Failed: 0, Not Run: 0 |
tedd_an/testrunnerrfcomm-tester | success | Total: 11, Passed: 11 (100.0%), Failed: 0, Not Run: 0 |
tedd_an/testrunnersco-tester | success | Total: 12, Passed: 12 (100.0%), Failed: 0, Not Run: 0 |
tedd_an/testrunnerioctl-tester | success | Total: 28, Passed: 28 (100.0%), Failed: 0, Not Run: 0 |
tedd_an/testrunnersmp-tester | success | Total: 8, Passed: 8 (100.0%), Failed: 0, Not Run: 0 |
tedd_an/testrunneruserchan-tester | success | Total: 4, Passed: 4 (100.0%), Failed: 0, Not Run: 0 |
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=681622 ---Test result--- Test Summary: CheckPatch PASS 2.36 seconds GitLint PASS 1.10 seconds SubjectPrefix PASS 1.15 seconds BuildKernel PASS 33.87 seconds BuildKernel32 PASS 30.14 seconds Incremental Build with patchesPASS 44.32 seconds TestRunner: Setup PASS 505.43 seconds TestRunner: l2cap-tester PASS 16.76 seconds TestRunner: iso-tester PASS 15.59 seconds TestRunner: bnep-tester PASS 6.35 seconds TestRunner: mgmt-tester PASS 100.48 seconds TestRunner: rfcomm-tester PASS 9.99 seconds TestRunner: sco-tester PASS 9.31 seconds TestRunner: ioctl-tester PASS 10.57 seconds TestRunner: smp-tester PASS 9.50 seconds TestRunner: userchan-tester PASS 6.53 seconds --- Regards, Linux Bluetooth
Hello: This patch was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>: On Wed, 28 Sep 2022 13:00:30 -0700 you wrote: > From: Abhishek Pandit-Subedi <abhishekpandit@chromium.org> > > Suspend notifier should only be registered and unregistered once per > hdev. Simplify this by only registering during driver registration and > simply exiting early when HCI_USER_CHANNEL is set. > > Reported-by: syzbot <syzkaller@googlegroups.com> > Fixes: 359ee4f834f5 (Bluetooth: Unregister suspend with userchannel) > Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org> > > [...] Here is the summary with links: - [v3] Bluetooth: Prevent double register of suspend https://git.kernel.org/bluetooth/bluetooth-next/c/4b8af331bb4d You are awesome, thank you!
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 66c7cdba0d32..86ce2dd1c7fb 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -2406,6 +2406,10 @@ static int hci_suspend_notifier(struct notifier_block *nb, unsigned long action, container_of(nb, struct hci_dev, suspend_notifier); int ret = 0; + /* Userspace has full control of this device. Do nothing. */ + if (hci_dev_test_flag(hdev, HCI_USER_CHANNEL)) + return NOTIFY_DONE; + if (action == PM_SUSPEND_PREPARE) ret = hci_suspend_dev(hdev); else if (action == PM_POST_SUSPEND) diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c index b2a33a05c93e..06581223238c 100644 --- a/net/bluetooth/hci_sock.c +++ b/net/bluetooth/hci_sock.c @@ -887,7 +887,6 @@ static int hci_sock_release(struct socket *sock) */ hci_dev_do_close(hdev); hci_dev_clear_flag(hdev, HCI_USER_CHANNEL); - hci_register_suspend_notifier(hdev); mgmt_index_added(hdev); } @@ -1216,7 +1215,6 @@ static int hci_sock_bind(struct socket *sock, struct sockaddr *addr, } mgmt_index_removed(hdev); - hci_unregister_suspend_notifier(hdev); err = hci_dev_open(hdev->id); if (err) { @@ -1231,7 +1229,6 @@ static int hci_sock_bind(struct socket *sock, struct sockaddr *addr, err = 0; } else { hci_dev_clear_flag(hdev, HCI_USER_CHANNEL); - hci_register_suspend_notifier(hdev); mgmt_index_added(hdev); hci_dev_put(hdev); goto done;