Bluetooth: hci_qca: Only remove TX clock vote after TX is completed
authorMatthias Kaehlcke <mka@chromium.org>
Fri, 5 Jun 2020 18:46:09 +0000 (11:46 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Aug 2020 06:23:45 +0000 (08:23 +0200)
commitce21cd6ba7623d88b21261aceedfd8aafdc375f5
treeba69bd2a03ca943d14cd2b3399e3419572dd82d0
parent131f1711758f9f6788590b4d383fb160c7899270
Bluetooth: hci_qca: Only remove TX clock vote after TX is completed

[ Upstream commit eff981f6579d5797d68d27afc0eede529ac8778a ]

qca_suspend() removes the vote for the UART TX clock after
writing an IBS sleep request to the serial buffer. This is
not a good idea since there is no guarantee that the request
has been sent at this point. Instead remove the vote after
successfully entering IBS sleep. This also fixes the issue
of the vote being removed in case of an aborted suspend due
to a failure of entering IBS sleep.

Fixes: 41d5b25fed0a0 ("Bluetooth: hci_qca: add PM support")
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/bluetooth/hci_qca.c