Bluetooth: Cancel sync command before suspend and power off
authorArchie Pusaka <apusaka@chromium.org>
Thu, 20 Apr 2023 12:23:36 +0000 (20:23 +0800)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Mon, 24 Apr 2023 05:06:55 +0000 (22:06 -0700)
commitf419863588217f76eaf754e1dfce21ea7fcb026d
treee03c79cf12a69f5b31edbd8eddf5688d6141b2d2
parent7948fe1c92d92313eea5453f83deb7f0141355e8
Bluetooth: Cancel sync command before suspend and power off

Some of the sync commands might take a long time to complete, e.g.
LE Create Connection when the peer device isn't responding might take
20 seconds before it times out. If suspend command is issued during
this time, it will need to wait for completion since both commands are
using the same sync lock.

This patch cancel any running sync commands before attempting to
suspend or adapter power off.

Signed-off-by: Archie Pusaka <apusaka@chromium.org>
Reviewed-by: Ying Hsu <yinghsu@chromium.org>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
net/bluetooth/hci_core.c
net/bluetooth/mgmt.c