diff mbox series

[v1,1/4] Bluetooth: Keep MSFT extension info throughout a hci_dev's life cycle

Message ID 20201216231652.v1.1.Id9bc5434114de07512661f002cdc0ada8b3d6d02@changeid (mailing list archive)
State New, archived
Headers show
Series [v1,1/4] Bluetooth: Keep MSFT extension info throughout a hci_dev's life cycle | expand

Commit Message

Miao-chen Chou Dec. 17, 2020, 7:17 a.m. UTC
This moves msft_do_close() from hci_dev_do_close() to
hci_unregister_dev() to avoid clearing MSFT extension info. This also
avoids retrieving MSFT info upon every msft_do_open() if MSFT extension
has been initialized.

The following test steps were performed.
(1) boot the test device and verify the MSFT support debug log in syslog
(2) restart bluetoothd and verify msft_do_close() doesn't get invoked

Signed-off-by: Miao-chen Chou <mcchou@chromium.org>
Reviewed-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
Reviewed-by: Archie Pusaka <apusaka@chromium.org>
---

 net/bluetooth/hci_core.c | 4 ++--
 net/bluetooth/msft.c     | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

Comments

bluez.test.bot@gmail.com Dec. 17, 2020, 8:12 a.m. UTC | #1
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=403409

---Test result---

##############################
    Test: CheckPatch - PASS
    

    ##############################
    Test: CheckGitLint - FAIL
    workflow: Add workflow files for ci
1: T1 Title exceeds max length (92>72): "Merge 4f717a84dceaeea9f22efc590ad1b1e23f7fb108 into a8db91a9984ac432df442c4312e9459052e498f2"
3: B6 Body message is missing

Bluetooth: Keep MSFT extension info throughout a hci_dev's life cycle
1: T1 Title exceeds max length (92>72): "Merge 4f717a84dceaeea9f22efc590ad1b1e23f7fb108 into a8db91a9984ac432df442c4312e9459052e498f2"
3: B6 Body message is missing

Bluetooth: btqca: Enable MSFT extension for Qualcomm WCN399x
1: T1 Title exceeds max length (92>72): "Merge 4f717a84dceaeea9f22efc590ad1b1e23f7fb108 into a8db91a9984ac432df442c4312e9459052e498f2"
3: B6 Body message is missing

Bluetooth: btusb: Enable MSFT extension for Intel controllers
1: T1 Title exceeds max length (92>72): "Merge 4f717a84dceaeea9f22efc590ad1b1e23f7fb108 into a8db91a9984ac432df442c4312e9459052e498f2"
3: B6 Body message is missing

Bluetooth: btrtl: Enable MSFT extension for RTL8822CE controller
1: T1 Title exceeds max length (92>72): "Merge 4f717a84dceaeea9f22efc590ad1b1e23f7fb108 into a8db91a9984ac432df442c4312e9459052e498f2"
3: B6 Body message is missing


    ##############################
    Test: CheckBuildK - PASS
    

    ##############################
    Test: CheckTestRunner: Setup - PASS
    

    ##############################
    Test: CheckTestRunner: l2cap-tester - PASS
    Total: 40, Passed: 34 (85.0%), Failed: 0, Not Run: 6

    ##############################
    Test: CheckTestRunner: bnep-tester - PASS
    Total: 1, Passed: 1 (100.0%), Failed: 0, Not Run: 0

    ##############################
    Test: CheckTestRunner: mgmt-tester - FAIL
    Total: 416, Passed: 394 (94.7%), Failed: 8, Not Run: 14

    ##############################
    Test: CheckTestRunner: rfcomm-tester - PASS
    Total: 9, Passed: 9 (100.0%), Failed: 0, Not Run: 0

    ##############################
    Test: CheckTestRunner: sco-tester - PASS
    Total: 8, Passed: 8 (100.0%), Failed: 0, Not Run: 0

    ##############################
    Test: CheckTestRunner: smp-tester - PASS
    Total: 8, Passed: 8 (100.0%), Failed: 0, Not Run: 0

    ##############################
    Test: CheckTestRunner: userchan-tester - PASS
    Total: 3, Passed: 3 (100.0%), Failed: 0, Not Run: 0

    

---
Regards,
Linux Bluetooth
diff mbox series

Patch

diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 9d2c9a1c552fd..8471be105a2ac 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1780,8 +1780,6 @@  int hci_dev_do_close(struct hci_dev *hdev)
 
 	hci_sock_dev_event(hdev, HCI_DEV_DOWN);
 
-	msft_do_close(hdev);
-
 	if (hdev->flush)
 		hdev->flush(hdev);
 
@@ -3869,6 +3867,8 @@  void hci_unregister_dev(struct hci_dev *hdev)
 	unregister_pm_notifier(&hdev->suspend_notifier);
 	cancel_work_sync(&hdev->suspend_prepare);
 
+	msft_do_close(hdev);
+
 	hci_dev_do_close(hdev);
 
 	if (!test_bit(HCI_INIT, &hdev->flags) &&
diff --git a/net/bluetooth/msft.c b/net/bluetooth/msft.c
index 4b39534a14a18..d9d2269bc93ef 100644
--- a/net/bluetooth/msft.c
+++ b/net/bluetooth/msft.c
@@ -76,7 +76,8 @@  void msft_do_open(struct hci_dev *hdev)
 {
 	struct msft_data *msft;
 
-	if (hdev->msft_opcode == HCI_OP_NOP)
+	/* Skip if opcode is not supported or MSFT has been initiatlized */
+	if (hdev->msft_opcode == HCI_OP_NOP || hdev->msft_data)
 		return;
 
 	bt_dev_dbg(hdev, "Initialize MSFT extension");