]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-5.0/bluetooth-btrtl-restore-old-logic-to-assume-firmware-is-already-loaded.patch
5.0-stable patches
[thirdparty/kernel/stable-queue.git] / queue-5.0 / bluetooth-btrtl-restore-old-logic-to-assume-firmware-is-already-loaded.patch
1 From 00df214b1faae520880cc5c57e206f21239ef741 Mon Sep 17 00:00:00 2001
2 From: Kai-Heng Feng <kai.heng.feng@canonical.com>
3 Date: Sun, 27 Jan 2019 16:33:59 +0800
4 Subject: Bluetooth: btrtl: Restore old logic to assume firmware is already loaded
5
6 From: Kai-Heng Feng <kai.heng.feng@canonical.com>
7
8 commit 00df214b1faae520880cc5c57e206f21239ef741 upstream.
9
10 Realtek bluetooth may not work after reboot:
11 [ 12.446130] Bluetooth: hci0: RTL: rtl: unknown IC info, lmp subver a99e, hci rev 826c, hci ver 0008
12
13 This is a regression introduced by commit 26503ad25de8 ("Bluetooth:
14 btrtl: split the device initialization into smaller parts"). The new
15 logic errors out early when no matching IC info can be found, in this
16 case it means the firmware is already loaded.
17
18 So let's assume the firmware is already loaded when we can't find
19 matching IC info, like the old logic did.
20
21 Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=201921
22 Fixes: 26503ad25de8 ("Bluetooth: btrtl: split the device initialization into smaller parts")
23 Cc: stable@vger.kernel.org # 4.19+
24 Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
25 Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
26 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
27
28 ---
29 drivers/bluetooth/btrtl.c | 10 +++++++---
30 1 file changed, 7 insertions(+), 3 deletions(-)
31
32 --- a/drivers/bluetooth/btrtl.c
33 +++ b/drivers/bluetooth/btrtl.c
34 @@ -552,10 +552,9 @@ struct btrtl_device_info *btrtl_initiali
35 hdev->bus);
36
37 if (!btrtl_dev->ic_info) {
38 - rtl_dev_err(hdev, "rtl: unknown IC info, lmp subver %04x, hci rev %04x, hci ver %04x",
39 + rtl_dev_info(hdev, "rtl: unknown IC info, lmp subver %04x, hci rev %04x, hci ver %04x",
40 lmp_subver, hci_rev, hci_ver);
41 - ret = -EINVAL;
42 - goto err_free;
43 + return btrtl_dev;
44 }
45
46 if (btrtl_dev->ic_info->has_rom_version) {
47 @@ -610,6 +609,11 @@ int btrtl_download_firmware(struct hci_d
48 * standard btusb. Once that firmware is uploaded, the subver changes
49 * to a different value.
50 */
51 + if (!btrtl_dev->ic_info) {
52 + rtl_dev_info(hdev, "rtl: assuming no firmware upload needed\n");
53 + return 0;
54 + }
55 +
56 switch (btrtl_dev->ic_info->lmp_subver) {
57 case RTL_ROM_LMP_8723A:
58 case RTL_ROM_LMP_3499: