lkml.org 
[lkml]   [2019]   [Jun]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2] Bluetooth: btrtl: HCI reset on close for Realtek BT chip
Date
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.

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

If BT is tunred 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.

Signed-off-by: Jian-Hong Pan <jian-hong@endlessm.com>
---
v2:
- According to the vendor driver, it makes "all" Realtek's BT reset on
close. So, this version makes it the same.
- Change to the new subject for all Realtek BT chips.

drivers/bluetooth/btrtl.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c
index 208feef63de4..be6d5f7e1e44 100644
--- a/drivers/bluetooth/btrtl.c
+++ b/drivers/bluetooth/btrtl.c
@@ -630,6 +630,10 @@ int btrtl_setup_realtek(struct hci_dev *hdev)
return PTR_ERR(btrtl_dev);

ret = btrtl_download_firmware(hdev, btrtl_dev);
+ /* According to the vendor driver, BT must be reset on close to avoid
+ * firmware crash since kernel v3.7.1.
+ */
+ set_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks);

btrtl_free(btrtl_dev);

--
2.22.0
\
 
 \ /
  Last update: 2019-06-24 08:25    [W:0.068 / U:1.676 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site