Bluetooth: hci_sync: Fix attempting to suspend with unfiltered passive scan
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Thu, 12 May 2022 22:31:34 +0000 (15:31 -0700)
committerMarcel Holtmann <marcel@holtmann.org>
Fri, 13 May 2022 11:22:29 +0000 (13:22 +0200)
commit3b42055388c30f2761a2d9cd9af2c99611dfe457
tree3c07105547157330cc0f4fb4a7c45a39135ea063
parenta9a347655d224fa2841877957b34fc9d491fc2d7
Bluetooth: hci_sync: Fix attempting to suspend with unfiltered passive scan

When suspending the passive scanning _must_ have its filter_policy set
to 0x01 to use the accept list otherwise _any_ advertise report would
end up waking up the system.

In order to fix the filter_policy the code now checks for
hdev->suspended && HCI_CONN_FLAG_REMOTE_WAKEUP
first, since the MGMT_OP_SET_DEVICE_FLAGS will reject any attempt to
set HCI_CONN_FLAG_REMOTE_WAKEUP when it cannot be programmed in the
acceptlist, so it can return success causing the proper filter_policy
to be used.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=215768
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/hci_sync.c