Skip to content

Commit 93c311a

Browse files
holtmannjhedberg
authored andcommitted
Bluetooth: Make mgmt power down notification for BR/EDR explicit
The management interface only operates on BR/EDR controllers. The check for the power down notification is a bit intermixed with the check if controller auto power off is active. Since there are more than just BR/EDR controllers supported, make this check explicit since the auto power off check also applies to AMP controllers and it has to happen in this exact order. Otherwise the bit will not be cleared. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
1 parent 004b025 commit 93c311a

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

‎net/bluetooth/hci_core.c‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1393,11 +1393,12 @@ static int hci_dev_do_close(struct hci_dev *hdev)
13931393
hdev->flags = 0;
13941394
hdev->dev_flags &= ~HCI_PERSISTENT_MASK;
13951395

1396-
if (!test_and_clear_bit(HCI_AUTO_OFF, &hdev->dev_flags) &&
1397-
hdev->dev_type == HCI_BREDR) {
1398-
hci_dev_lock(hdev);
1399-
mgmt_powered(hdev, 0);
1400-
hci_dev_unlock(hdev);
1396+
if (!test_and_clear_bit(HCI_AUTO_OFF, &hdev->dev_flags)) {
1397+
if (hdev->dev_type == HCI_BREDR) {
1398+
hci_dev_lock(hdev);
1399+
mgmt_powered(hdev, 0);
1400+
hci_dev_unlock(hdev);
1401+
}
14011402
}
14021403

14031404
/* Controller radio is available but is currently powered down */

0 commit comments

Comments
 (0)