Bluetooth: btrtl: HCI reset on close for Realtek BT chip
authorJian-Hong Pan <jian-hong@endlessm.com>
Tue, 25 Jun 2019 08:30:51 +0000 (16:30 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Oct 2019 06:26:11 +0000 (08:26 +0200)
commit46beb6eacef54d50e436c89e5ae70df5895ab97c
treeb8d03dd3ee252649d9b546279f9ab311482f69fa
parent8ffd7ba9ffb1e332c092a7523dc76de9d0958bd1
Bluetooth: btrtl: HCI reset on close for Realtek BT chip

[ Upstream commit 7af3f558aca74f2ee47b173f1c27f6bb9a5b5561 ]

Realtek RTL8822BE BT chip on ASUS X420FA cannot be turned on correctly
after on-off several times. Bluetooth daemon sets BT mode failed when
this issue happens. Scanning must be active while turning off for this
bug to be hit.

bluetoothd[1576]: Failed to set mode: Failed (0x03)

If BT is turned off, then turned on again, it works correctly again.

According to the vendor driver, the HCI_QUIRK_RESET_ON_CLOSE flag is set
during probing. So, this patch makes Realtek's BT reset on close to fix
this issue.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=203429
Signed-off-by: Jian-Hong Pan <jian-hong@endlessm.com>
Reviewed-by: Daniel Drake <drake@endlessm.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/bluetooth/btrtl.c
drivers/bluetooth/btrtl.h
drivers/bluetooth/btusb.c