[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190124152310.29717-3-kai.heng.feng@canonical.com>
Date: Thu, 24 Jan 2019 23:23:10 +0800
From: Kai-Heng Feng <kai.heng.feng@...onical.com>
To: marcel@...tmann.org, johan.hedberg@...il.com
Cc: drake@...lessm.com, linux-bluetooth@...r.kernel.org,
linux-kernel@...r.kernel.org,
Kai-Heng Feng <kai.heng.feng@...onical.com>
Subject: [PATCH 3/3] Bluetooth: btrtl: Skip initialization if firmware is already loaded
Realtek bluetooth may not work after reboot:
[ 12.446130] Bluetooth: hci0: RTL: rtl: unknown IC info, lmp subver a99e, hci rev 826c, hci ver 0008
The power is not cut during system reboot, so the firmware is kept in
Bluetooth controller.
Realtek bluetooth doesn't have the ability to check firmware loading
status. but the version queried by HCI_OP_READ_LOCAL_VERSION will be
different if firmware is already loaded. Realtek's own fork, rtk_btusb
also use this method to detect the loading status.
So let's assume the firmware is already loaded when we can't find
matching IC info.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=201921
Signed-off-by: Kai-Heng Feng <kai.heng.feng@...onical.com>
---
drivers/bluetooth/btrtl.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c
index c36f500d8313..e2f89d57dd14 100644
--- a/drivers/bluetooth/btrtl.c
+++ b/drivers/bluetooth/btrtl.c
@@ -546,9 +546,10 @@ int btrtl_initialize(struct hci_dev *hdev,
hdev->bus);
if (!btrtl_dev->ic_info) {
- rtl_dev_err(hdev, "rtl: unknown IC info, lmp subver %04x, hci rev %04x, hci ver %04x",
- lmp_subver, hci_rev, hci_ver);
- return -EINVAL;
+ rtl_dev_info(hdev, "rtl: unknown IC info, lmp subver %04x, hci rev %04x, hci ver %04x",
+ lmp_subver, hci_rev, hci_ver);
+ rtl_dev_info(hdev, "rtl: firmware may be already loaded, or it's an unsupported IC.");
+ return 0;
}
if (btrtl_dev->ic_info->has_rom_version) {
@@ -621,7 +622,8 @@ int btrtl_setup_realtek(struct hci_dev *hdev)
if (ret)
return ret;
- ret = btrtl_download_firmware(hdev, &btrtl_dev);
+ if (btrtl_dev.ic_info)
+ ret = btrtl_download_firmware(hdev, &btrtl_dev);
return ret;
}
--
2.17.1
Powered by blists - more mailing lists