diff mbox series

[v10,2/2] btbcm: disable read tx power for some Macs with the T2 Security chip

Message ID 51575680-E9C3-4962-A3C4-ADCBD6DBCA00@live.com
State Superseded
Headers show
Series [v10,1/2] Bluetooth: add quirk disabling LE Read Transmit Power | expand

Commit Message

Aditya Garg Dec. 2, 2021, 12:42 p.m. UTC
From: Aditya Garg <gargaditya08@live.com>

Some Macs with the T2 security chip had Bluetooth not working.
To fix it we add DMI based quirks to disable querying of LE Tx power.

Signed-off-by: Aditya Garg <gargaditya08@live.com>
Reported-by: Orlando Chamberlain <redecorating@protonmail.com>
Tested-by: Orlando Chamberlain <redecorating@protonmail.com>
Link:
https://lore.kernel.org/r/4970a940-211b-25d6-edab-21a815313954@protonmail.com
Fixes: 7c395ea521e6 ("Bluetooth: Query LE tx power on startup")
Cc: stable@vger.kernel.org
---
v7 :- Removed unused variable and added Tested-by.
v8 :- No change.
v9 :- Add Cc: stable@vger.kernel.org
v10 :- Fix gitlint
 drivers/bluetooth/btbcm.c | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

Comments

Marcel Holtmann Dec. 3, 2021, 9:28 p.m. UTC | #1
Hi Aditya,

> Some Macs with the T2 security chip had Bluetooth not working.
> To fix it we add DMI based quirks to disable querying of LE Tx power.
> 
> Signed-off-by: Aditya Garg <gargaditya08@live.com>
> Reported-by: Orlando Chamberlain <redecorating@protonmail.com>
> Tested-by: Orlando Chamberlain <redecorating@protonmail.com>
> Link:
> https://lore.kernel.org/r/4970a940-211b-25d6-edab-21a815313954@protonmail.com
> Fixes: 7c395ea521e6 ("Bluetooth: Query LE tx power on startup")
> Cc: stable@vger.kernel.org
> ---
> v7 :- Removed unused variable and added Tested-by.
> v8 :- No change.
> v9 :- Add Cc: stable@vger.kernel.org
> v10 :- Fix gitlint
> drivers/bluetooth/btbcm.c | 39 +++++++++++++++++++++++++++++++++++++++
> 1 file changed, 39 insertions(+)

patch has been applied to bluetooth-next tree.

Regards

Marcel
Linux regression tracking (Thorsten Leemhuis) Dec. 21, 2021, 1:44 p.m. UTC | #2
Hi, this once again is your Linux kernel regression tracker speaking.

On 03.12.21 22:28, Marcel Holtmann wrote:

>> Some Macs with the T2 security chip had Bluetooth not working.
>> To fix it we add DMI based quirks to disable querying of LE Tx power.
>>
>> Signed-off-by: Aditya Garg <gargaditya08@live.com>
>> Reported-by: Orlando Chamberlain <redecorating@protonmail.com>
>> Tested-by: Orlando Chamberlain <redecorating@protonmail.com>
>> Link:
>> https://lore.kernel.org/r/4970a940-211b-25d6-edab-21a815313954@protonmail.com
>> Fixes: 7c395ea521e6 ("Bluetooth: Query LE tx power on startup")

If anyone wonders: this was for v5.11-rc1.

>> Cc: stable@vger.kernel.org
>> ---
>> v7 :- Removed unused variable and added Tested-by.
>> v8 :- No change.
>> v9 :- Add Cc: stable@vger.kernel.org
>> v10 :- Fix gitlint
>> drivers/bluetooth/btbcm.c | 39 +++++++++++++++++++++++++++++++++++++++
>> 1 file changed, 39 insertions(+)
> 
> patch has been applied to bluetooth-next tree.
And there are these two pages now for 19 days. What's the hold-up? Or do
you consider the changes to dangerous to merge now?

Sure, it's not a recent regression, so it might not look that urgent.
But it OTOH affects everyone that can't go back to v5.10 (the newest
Longterm kernel without the regression) -- for example if a user needs a
post-v5.10 feature or upgrades to a distro with a newer kernel.

That's why this fix (unless you considerer it to dangerous) IMHO should
be merged rather sooner than later and and not wait for the merge window
of v5.17. Another aspect against waiting for the next merge window: it
contributes to piling up a large number of changes that need to be
backported to stable and longterm kernels once v5.17-rc1 is out,
resulting in stable and longterm releases with a huge pile of changes:
https://lwn.net/Articles/863505/

Ciao, Thorsten

#regzbot poke
diff mbox series

Patch

diff --git a/drivers/bluetooth/btbcm.c b/drivers/bluetooth/btbcm.c
index e4182acee488c5..07fabaa5aa2979 100644
--- a/drivers/bluetooth/btbcm.c
+++ b/drivers/bluetooth/btbcm.c
@@ -8,6 +8,7 @@ 
 
 #include <linux/module.h>
 #include <linux/firmware.h>
+#include <linux/dmi.h>
 #include <asm/unaligned.h>
 
 #include <net/bluetooth/bluetooth.h>
@@ -343,6 +344,40 @@  static struct sk_buff *btbcm_read_usb_product(struct hci_dev *hdev)
 	return skb;
 }
 
+static const struct dmi_system_id disable_broken_read_transmit_power[] = {
+	{
+		 .matches = {
+			DMI_MATCH(DMI_BOARD_VENDOR, "Apple Inc."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro16,1"),
+		},
+	},
+	{
+		 .matches = {
+			DMI_MATCH(DMI_BOARD_VENDOR, "Apple Inc."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro16,2"),
+		},
+	},
+	{
+		 .matches = {
+			DMI_MATCH(DMI_BOARD_VENDOR, "Apple Inc."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro16,4"),
+		},
+	},
+	{
+		 .matches = {
+			DMI_MATCH(DMI_BOARD_VENDOR, "Apple Inc."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "iMac20,1"),
+		},
+	},
+	{
+		 .matches = {
+			DMI_MATCH(DMI_BOARD_VENDOR, "Apple Inc."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "iMac20,2"),
+		},
+	},
+	{ }
+};
+
 static int btbcm_read_info(struct hci_dev *hdev)
 {
 	struct sk_buff *skb;
@@ -363,6 +398,10 @@  static int btbcm_read_info(struct hci_dev *hdev)
 	bt_dev_info(hdev, "BCM: features 0x%2.2x", skb->data[1]);
 	kfree_skb(skb);
 
+	/* Read DMI and disable broken Read LE Min/Max Tx Power */
+	if (dmi_first_match(disable_broken_read_transmit_power))
+		set_bit(HCI_QUIRK_BROKEN_READ_TRANSMIT_POWER, &hdev->quirks);
+
 	return 0;
 }