From f6627710b332de1254abadd3f2835b2a71f51dc5 Mon Sep 17 00:00:00 2001 From: Mikhail Novosyolov Date: Tue, 23 Feb 2021 01:50:28 +0300 Subject: [PATCH] Pick fix of some issues in Bluetooth This patch is applied in Arch Linux kernel and has not been upstreamized yet. Thanks to tsaruk1van@ for reporting existense of the issue (also with kernel 5.10) and that this fix works. --- kbz211571.patch | 50 +++++++++++++++++++++++++++++++++++++++++++++++++ kernel.spec | 2 ++ 2 files changed, 52 insertions(+) create mode 100644 kbz211571.patch diff --git a/kbz211571.patch b/kbz211571.patch new file mode 100644 index 0000000..d1e59b0 --- /dev/null +++ b/kbz211571.patch @@ -0,0 +1,50 @@ +From 66b6d6c8306329134abeeb26d352f2074b2f0e1e Mon Sep 17 00:00:00 2001 +From: Hui Wang +Date: Mon, 8 Feb 2021 13:02:37 +0800 +Subject: Bluetooth: btusb: Some Qualcomm Bluetooth adapters stop working + +This issue starts from linux-5.10-rc1, I reproduced this issue on my +Dell Inspiron 7447 with BT adapter 0cf3:e005, the kernel will print +out: "Bluetooth: hci0: don't support firmware rome 0x31010000", and +someone else also reported the similar issue to bugzilla #211571. + +I found this is a regression introduced by 'commit b40f58b97386 +("Bluetooth: btusb: Add Qualcomm Bluetooth SoC WCN6855 support"), the +patch assumed that if high ROM version is not zero, it is an adapter +on WCN6855, but many old adapters don't need to load rampatch or nvm, +and they have non-zero high ROM version. + +To fix it, let the driver match the rom_version in the +qca_devices_table first, if there is no entry matched, check the +high ROM version, if it is not zero, we assume this adapter is ready +to work and no need to load rampatch and nvm like previously. + +BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=211571 +Fixes: b40f58b97386 ("Bluetooth: btusb: Add Qualcomm Bluetooth SoC WCN6855 support") +Signed-off-by: Hui Wang +Signed-off-by: Marcel Holtmann +--- + drivers/bluetooth/btusb.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c +index 03b83aa91277..32161dd40ed6 100644 +--- a/drivers/bluetooth/btusb.c ++++ b/drivers/bluetooth/btusb.c +@@ -4069,6 +4069,13 @@ static int btusb_setup_qca(struct hci_dev *hdev) + info = &qca_devices_table[i]; + } + if (!info) { ++ /* If the rom_version is not matched in the qca_devices_table ++ * and the high ROM version is not zero, we assume this chip no ++ * need to load the rampatch and nvm. ++ */ ++ if (ver_rom & ~0xffffU) ++ return 0; ++ + bt_dev_err(hdev, "don't support firmware rome 0x%x", ver_rom); + return -ENODEV; + } +-- +cgit v1.2.3-1-gf6bb5 + diff --git a/kernel.spec b/kernel.spec index c73ce24..e0e58e3 100644 --- a/kernel.spec +++ b/kernel.spec @@ -323,6 +323,8 @@ Patch306: 0001-ROSA-ima-allow-to-off-modules-signature-check-dynami.patch # https://www.linux.org.ru/news/kernel/16052362?cid=16075323 Patch307: le9pf.diff Patch308: 0001-Revert-kallsyms-unexport-kallsyms_lookup_name-and-ka.patch +# https://git.archlinux.org/linux.git/commit/?h=v5.11-arch2&id=66b6d6c830 +Patch309: kbz211571.patch # Disable AutoReq AutoReq: 0