diff --git a/patch/kernel/archive/rockchip64-5.15/wifi-4004-fix-uwe5622-park-link-policy.patch b/patch/kernel/archive/rockchip64-5.15/wifi-4004-fix-uwe5622-park-link-policy.patch new file mode 100644 index 0000000000..6b5cb12fea --- /dev/null +++ b/patch/kernel/archive/rockchip64-5.15/wifi-4004-fix-uwe5622-park-link-policy.patch @@ -0,0 +1,61 @@ +From de74a350782cc5f42f2f3b58ffd6771c4dea27ab Mon Sep 17 00:00:00 2001 +From: Paolo Sabatino +Date: Thu, 16 Jun 2022 19:19:49 +0000 +Subject: [PATCH] fix spreadtrum (sprd) bluetooth broken park link status + +--- + drivers/bluetooth/hci_ldisc.c | 6 ++++++ + include/net/bluetooth/hci.h | 6 ++++++ + net/bluetooth/hci_core.c | 2 +- + 3 files changed, 13 insertions(+), 1 deletion(-) + +diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c +index 5ed2cfa7da1..0c2448e73c1 100644 +--- a/drivers/bluetooth/hci_ldisc.c ++++ b/drivers/bluetooth/hci_ldisc.c +@@ -652,6 +652,12 @@ static int hci_uart_register_dev(struct hci_uart *hu) + hdev->setup = hci_uart_setup; + SET_HCIDEV_DEV(hdev, hu->tty->dev); + ++ // Set the broken Park link status quirk, specific for spreadtrum (sprd) ++ // bluetooth devices ++ if (hdev->manufacturer == 0xffff && hu->tty->driver && ++ strncmp(hu->tty->driver->name, "ttyBT", 5) == 0) ++ set_bit(HCI_QUIRK_BROKEN_PARK_LINK_STATUS, &hdev->quirks); ++ + if (test_bit(HCI_UART_RAW_DEVICE, &hu->hdev_flags)) + set_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks); + +diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h +index 2ed6af29352..5fef855cfdf 100644 +--- a/include/net/bluetooth/hci.h ++++ b/include/net/bluetooth/hci.h +@@ -262,6 +262,12 @@ enum { + * during the hdev->setup vendor callback. + */ + HCI_QUIRK_BROKEN_READ_TRANSMIT_POWER, ++ ++ /* ++ * Device declares that support Park link status, but it really ++ * does not support it and fails to initialize ++ */ ++ HCI_QUIRK_BROKEN_PARK_LINK_STATUS + }; + + /* HCI device flags */ +diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c +index cdca5373230..123ce7042bb 100644 +--- a/net/bluetooth/hci_core.c ++++ b/net/bluetooth/hci_core.c +@@ -511,7 +511,7 @@ static void hci_setup_link_policy(struct hci_request *req) + link_policy |= HCI_LP_HOLD; + if (lmp_sniff_capable(hdev)) + link_policy |= HCI_LP_SNIFF; +- if (lmp_park_capable(hdev)) ++ if (lmp_park_capable(hdev) && !test_bit(HCI_QUIRK_BROKEN_PARK_LINK_STATUS, &hdev->quirks)) + link_policy |= HCI_LP_PARK; + + cp.policy = cpu_to_le16(link_policy); +-- +2.30.2 + diff --git a/patch/kernel/archive/rockchip64-5.15/wifi-4004-fix-uwe5622.patch b/patch/kernel/archive/rockchip64-5.15/wifi-4004-fix-uwe5622-warnings.patch similarity index 100% rename from patch/kernel/archive/rockchip64-5.15/wifi-4004-fix-uwe5622.patch rename to patch/kernel/archive/rockchip64-5.15/wifi-4004-fix-uwe5622-warnings.patch diff --git a/patch/kernel/archive/rockchip64-5.18/wifi-4004-fix-uwe5622-park-link-policy.patch b/patch/kernel/archive/rockchip64-5.18/wifi-4004-fix-uwe5622-park-link-policy.patch new file mode 100644 index 0000000000..0dcb6c9e22 --- /dev/null +++ b/patch/kernel/archive/rockchip64-5.18/wifi-4004-fix-uwe5622-park-link-policy.patch @@ -0,0 +1,61 @@ +From 682121f340fe0b8ec885f9b628e754d2298a32a2 Mon Sep 17 00:00:00 2001 +From: Paolo Sabatino +Date: Thu, 16 Jun 2022 19:52:20 +0000 +Subject: [PATCH] fix spreadtrum (sprd) broken bluetooth park link status + +--- + drivers/bluetooth/hci_ldisc.c | 6 ++++++ + include/net/bluetooth/hci.h | 6 ++++++ + net/bluetooth/hci_sync.c | 2 +- + 3 files changed, 13 insertions(+), 1 deletion(-) + +diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c +index f537673ede1..a3222cb727e 100644 +--- a/drivers/bluetooth/hci_ldisc.c ++++ b/drivers/bluetooth/hci_ldisc.c +@@ -655,6 +655,12 @@ static int hci_uart_register_dev(struct hci_uart *hu) + hdev->setup = hci_uart_setup; + SET_HCIDEV_DEV(hdev, hu->tty->dev); + ++ // Set the broken Park link status quirk, specific for spreadtrum (sprd) ++ // bluetooth devices ++ if (hdev->manufacturer == 0xffff && hu->tty->driver && ++ strncmp(hu->tty->driver->name, "ttyBT", 5) == 0) ++ set_bit(HCI_QUIRK_BROKEN_PARK_LINK_STATUS, &hdev->quirks); ++ + if (test_bit(HCI_UART_RAW_DEVICE, &hu->hdev_flags)) + set_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks); + +diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h +index 656b609cb68..d2dc448501c 100644 +--- a/include/net/bluetooth/hci.h ++++ b/include/net/bluetooth/hci.h +@@ -281,6 +281,12 @@ enum { + * during the hdev->setup vendor callback. + */ + HCI_QUIRK_BROKEN_ENHANCED_SETUP_SYNC_CONN, ++ ++ /* ++ * Device declares that support Park link status, but it really ++ * does not support it and fails to initialize ++ */ ++ HCI_QUIRK_BROKEN_PARK_LINK_STATUS, + }; + + /* HCI device flags */ +diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c +index 13600bf120b..a6437cd0935 100644 +--- a/net/bluetooth/hci_sync.c ++++ b/net/bluetooth/hci_sync.c +@@ -3171,7 +3171,7 @@ static int hci_setup_link_policy_sync(struct hci_dev *hdev) + link_policy |= HCI_LP_HOLD; + if (lmp_sniff_capable(hdev)) + link_policy |= HCI_LP_SNIFF; +- if (lmp_park_capable(hdev)) ++ if (lmp_park_capable(hdev) && !test_bit(HCI_QUIRK_BROKEN_PARK_LINK_STATUS, &hdev->quirks)) + link_policy |= HCI_LP_PARK; + + cp.policy = cpu_to_le16(link_policy); +-- +2.30.2 + diff --git a/patch/kernel/archive/rockchip64-5.18/wifi-4004-fix-uwe5622.patch b/patch/kernel/archive/rockchip64-5.18/wifi-4004-fix-uwe5622-warnings.patch similarity index 100% rename from patch/kernel/archive/rockchip64-5.18/wifi-4004-fix-uwe5622.patch rename to patch/kernel/archive/rockchip64-5.18/wifi-4004-fix-uwe5622-warnings.patch