linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] Bluetooth: btrtl: Restore old logic to assume firmware is already loaded
@ 2019-01-27  8:33 Kai-Heng Feng
  2019-01-28 12:25 ` Marcel Holtmann
  0 siblings, 1 reply; 2+ messages in thread
From: Kai-Heng Feng @ 2019-01-27  8:33 UTC (permalink / raw)
  To: marcel, johan.hedberg
  Cc: drake, linux-bluetooth, linux-kernel, Kai-Heng Feng, stable

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

This is a regression introduced by commit 26503ad25de8 ("Bluetooth:
btrtl: split the device initialization into smaller parts"). The new
logic errors out early when no matching IC info can be found, in this
case it means the firmware is already loaded.

So let's assume the firmware is already loaded when we can't find
matching IC info, like the old logic did.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=201921
Fixes: 26503ad25de8 ("Bluetooth: btrtl: split the device initialization into smaller parts")
Cc: stable@vger.kernel.org # 4.19+
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
---
 drivers/bluetooth/btrtl.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c
index 41405de27d66..c91bba00df4e 100644
--- a/drivers/bluetooth/btrtl.c
+++ b/drivers/bluetooth/btrtl.c
@@ -552,10 +552,9 @@ struct btrtl_device_info *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",
+		rtl_dev_info(hdev, "rtl: unknown IC info, lmp subver %04x, hci rev %04x, hci ver %04x",
 			    lmp_subver, hci_rev, hci_ver);
-		ret = -EINVAL;
-		goto err_free;
+		return btrtl_dev;
 	}
 
 	if (btrtl_dev->ic_info->has_rom_version) {
@@ -610,6 +609,11 @@ int btrtl_download_firmware(struct hci_dev *hdev,
 	 * standard btusb. Once that firmware is uploaded, the subver changes
 	 * to a different value.
 	 */
+	if (!btrtl_dev->ic_info) {
+		rtl_dev_info(hdev, "rtl: assuming no firmware upload needed\n");
+		return 0;
+	}
+
 	switch (btrtl_dev->ic_info->lmp_subver) {
 	case RTL_ROM_LMP_8723A:
 	case RTL_ROM_LMP_3499:
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] Bluetooth: btrtl: Restore old logic to assume firmware is already loaded
  2019-01-27  8:33 [PATCH v2] Bluetooth: btrtl: Restore old logic to assume firmware is already loaded Kai-Heng Feng
@ 2019-01-28 12:25 ` Marcel Holtmann
  0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2019-01-28 12:25 UTC (permalink / raw)
  To: Kai-Heng Feng
  Cc: Johan Hedberg, Daniel Drake, linux-bluetooth, linux-kernel, stable

Hi Kai-Heng,

> 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
> 
> This is a regression introduced by commit 26503ad25de8 ("Bluetooth:
> btrtl: split the device initialization into smaller parts"). The new
> logic errors out early when no matching IC info can be found, in this
> case it means the firmware is already loaded.
> 
> So let's assume the firmware is already loaded when we can't find
> matching IC info, like the old logic did.
> 
> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=201921
> Fixes: 26503ad25de8 ("Bluetooth: btrtl: split the device initialization into smaller parts")
> Cc: stable@vger.kernel.org # 4.19+
> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
> ---
> drivers/bluetooth/btrtl.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-01-28 12:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-27  8:33 [PATCH v2] Bluetooth: btrtl: Restore old logic to assume firmware is already loaded Kai-Heng Feng
2019-01-28 12:25 ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).