Parent: 73b301372b21d56a6c8902659fbfd1c352ad55de
Author: Archie Pusaka <apusaka@chromium.org>
Committer: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: 2022-08-25 00:32:04
Tree: 8c37caddde01c34f850d2e54904ae348ea186ce0
adapter: Reset pending settings when receiving MGMT error We set the pending settings flag when sending MGMT_SETTING_* commands to the MGMT layer and clear them when receiving a successful reply, but we don't clear them when receiving an error reply. This might cause a setting to be stuck in pending state. Therefore, also clear the pending flag when receiving error. Furthermore, this patch also postpones setting the pending flag until we queue the MGMT command in order to avoid setting it too soon but we return early. This was caught during power off test, where MGMT_OP_SET_POWERED returns Authentication Failed because disconnection takes too long. Future attempts to switch power will then be ignored. < HCI Command: Disconnect (0x01|0x0006) plen 3 #17916 [hci0] 12.502908 Handle: 512 Reason: Remote Device Terminated due to Power Off (0x15) > HCI Event: Command Status (0x0f) plen 4 #17917 [hci0] 12.503185 Disconnect (0x01|0x0006) ncmd 1 Status: Success (0x00) @ MGMT Event: Command Status (0x0002) plen 3 {0x0001} [hci0] 14.519491 Set Powered (0x0005) Status: Authentication Failed (0x05) = bluetoothd: Failed to set mode: Authentication Failed (0x05) 14.520042 = bluetoothd: adapter /org/bluez/hci0 set power to 0 14.813533 > HCI Event: Disconnect Complete (0x05) plen 4 #17918 [hci0] 16.509043 Status: Success (0x00) Handle: 512 Reason: Connection Timeout (0x08) Reviewed-by: Sonny Sasaka <sonnysasaka@chromium.org>
Diffstat
| M | src/adapter.c | | | 39 | +++++++++++++++++++++++++++++++- - - - - - - - |
1 files changed, 31 insertions(+), 8 deletions(-)