From f7faa3dd1beb584c4354530042033094271e4023 Mon Sep 17 00:00:00 2001 From: Tk-Glitch Date: Tue, 27 Oct 2020 18:41:21 +0100 Subject: [PATCH] linux59-tkg: Add bluetooth fix for https://bugzilla.kernel.org/show_bug.cgi?id=209745 Thanks to @thotypous Fixes https://github.com/Frogging-Family/linux-tkg/pull/99 --- PKGBUILD | 4 +- .../5.9/0003-glitched-base.patch | 61 +++++++++++++++++++ 2 files changed, 63 insertions(+), 2 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index c42c3d3..ed1308e 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -49,7 +49,7 @@ else fi pkgname=("${pkgbase}" "${pkgbase}-headers") pkgver="${_basekernel}"."${_sub}" -pkgrel=5 +pkgrel=6 pkgdesc='Linux-tkg' arch=('x86_64') # no i686 in here url="http://www.kernel.org/" @@ -268,7 +268,7 @@ case $_basever in '66a03c246037451a77b4d448565b1d7e9368270c7d02872fbd0b5d024ed0a997' 'f6383abef027fd9a430fd33415355e0df492cdc3c90e9938bf2d98f4f63b32e6' '35a7cde86fb94939c0f25a62b8c47f3de0dbd3c65f876f460b263181b3e92fc0' - 'b9ebe0ae69bc2b2091d6bfcf6c7875a87ea7969fcfa4e306c48d47a60f9ef4d6' + '902885088ed0748e40372e04a8ec11adf5acf3d935abffc6737dd9e6ec13bb93' '7058e57fd68367b029adc77f2a82928f1433daaf02c8c279cb2d13556c8804d7' 'c605f638d74c61861ebdc36ebd4cb8b6475eae2f6273e1ccb2bbb3e10a2ec3fe' '2bbbac963b6ca44ef3f8a71ec7c5cad7d66df860869a73059087ee236775970a' diff --git a/linux-tkg-patches/5.9/0003-glitched-base.patch b/linux-tkg-patches/5.9/0003-glitched-base.patch index fb09b35..e321500 100644 --- a/linux-tkg-patches/5.9/0003-glitched-base.patch +++ b/linux-tkg-patches/5.9/0003-glitched-base.patch @@ -706,3 +706,64 @@ index 36a469150ff9..aee891c9b78a 100644 -- 2.28.0 +From: Sathish Narasimman +Subject: [PATCH] Bluetooth: Fix: LL PRivacy BLE device fails to connect +Date: Thu, 22 Oct 2020 13:53:04 +0530 + +When adding device to white list the device is added to resolving list +also it has to be added only when HCI_ENABLE_LL_PRIVACY flag is set. +HCI_ENABLE_LL_PRIVACY flag has to be tested before adding/deleting devices +to resolving list. use_ll_privacy macro is used only to check if controller +supports LL_Privacy. + +https://bugzilla.kernel.org/show_bug.cgi?id=209745 + +Signed-off-by: Sathish Narasimman +--- + net/bluetooth/hci_request.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +diff --git a/net/bluetooth/hci_request.c b/net/bluetooth/hci_request.c +index 6f12bab4d2fa..610ed0817bd7 100644 +--- a/net/bluetooth/hci_request.c ++++ b/net/bluetooth/hci_request.c +@@ -698,7 +698,8 @@ static void del_from_white_list(struct hci_request *req, bdaddr_t *bdaddr, + cp.bdaddr_type); + hci_req_add(req, HCI_OP_LE_DEL_FROM_WHITE_LIST, sizeof(cp), &cp); + +- if (use_ll_privacy(req->hdev)) { ++ if (use_ll_privacy(req->hdev) && ++ hci_dev_test_flag(req->hdev, HCI_ENABLE_LL_PRIVACY)) { + struct smp_irk *irk; + + irk = hci_find_irk_by_addr(req->hdev, bdaddr, bdaddr_type); +@@ -732,7 +733,8 @@ static int add_to_white_list(struct hci_request *req, + return -1; + + /* White list can not be used with RPAs */ +- if (!allow_rpa && !use_ll_privacy(hdev) && ++ if (!allow_rpa && ++ !hci_dev_test_flag(hdev, HCI_ENABLE_LL_PRIVACY) && + hci_find_irk_by_addr(hdev, ¶ms->addr, params->addr_type)) { + return -1; + } +@@ -750,7 +752,8 @@ static int add_to_white_list(struct hci_request *req, + cp.bdaddr_type); + hci_req_add(req, HCI_OP_LE_ADD_TO_WHITE_LIST, sizeof(cp), &cp); + +- if (use_ll_privacy(hdev)) { ++ if (use_ll_privacy(hdev) && ++ hci_dev_test_flag(hdev, HCI_ENABLE_LL_PRIVACY)) { + struct smp_irk *irk; + + irk = hci_find_irk_by_addr(hdev, ¶ms->addr, +@@ -812,7 +815,8 @@ static u8 update_white_list(struct hci_request *req) + } + + /* White list can not be used with RPAs */ +- if (!allow_rpa && !use_ll_privacy(hdev) && ++ if (!allow_rpa && ++ !hci_dev_test_flag(hdev, HCI_ENABLE_LL_PRIVACY) && + hci_find_irk_by_addr(hdev, &b->bdaddr, b->bdaddr_type)) { + return 0x00; + }