From: Luiz Augusto von Dentz Date: Fri, 30 Sep 2022 20:12:30 +0000 (-0700) Subject: Bluetooth: hci_sync: Fix not indicating power state X-Git-Tag: v5.19.17~434 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=742e595f1949171ddcb1c6560d6619ae61c0e9db;p=thirdparty%2Fkernel%2Fstable.git Bluetooth: hci_sync: Fix not indicating power state [ Upstream commit 6abf0dae8c3c927f54e62c46faf8aba580ba0d04 ] When setting power state using legacy/non-mgmt API (e.g hcitool hci0 up) the likes of mgmt_set_powered_complete won't be called causing clients of the MGMT API to not be notified of the change of the state. Fixes: cf75ad8b41d2 ("Bluetooth: hci_sync: Convert MGMT_SET_POWERED") Signed-off-by: Luiz Augusto von Dentz Tested-by: Tedd Ho-Jeong An Signed-off-by: Sasha Levin --- diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c index 3b4cee67bbd60..a7c0cd2fabfb2 100644 --- a/net/bluetooth/hci_sync.c +++ b/net/bluetooth/hci_sync.c @@ -4033,6 +4033,7 @@ setup_failed: hci_dev_test_flag(hdev, HCI_MGMT) && hdev->dev_type == HCI_PRIMARY) { ret = hci_powered_update_sync(hdev); + mgmt_power_on(hdev, ret); } } else { /* Init failed, cleanup */