Skip to contentSkip to conversation

Bluetooth: btintel: Fix WBS setting for Intel legacy ROM products

PATCH Superseded Tedd Ho-Jeong An 4 participants 4 messages Jan 20, 2022 Bluetooth drivers

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Bluetooth: btintel: Fix WBS setting for Intel legacy ROM products

From: Tedd Ho-Jeong An <[email protected]>

This patch adds the flag to identify the Intel legacy ROM products that don't support WBS like WP and StP.

Fixes 3df4dfbec0f29 ("Bluetooth: btintel: Move hci quirks to setup routine")
---
 drivers/bluetooth/btintel.c | 10 +++++++---
 drivers/bluetooth/btintel.h |  1 +
 drivers/bluetooth/btusb.c   |  6 ++++++
 3 files changed, 14 insertions(+), 3 deletions(-)
drivers/bluetooth/btintel.c +7 -3
index 1a4f8b227eac..225ed0373e9d 100644
@@ -2428,10 +2428,14 @@ static int btintel_setup_combined(struct hci_dev *hdev)
 
 			/* Apply the device specific HCI quirks
 			 *
-			 * WBS for SdP - SdP and Stp have a same hw_varaint but
-			 * different fw_variant
+			 * WBS for SdP - For the Legacy ROM products, only SdP
+			 * supports the WBS. But the version information is not
+			 * enough to use here because the StP2 and SdP have same
+			 * hw_variant and fw_variant. So, this flag is set by
+			 * the transport driver(btusb) based on the HW info
+			 * (idProduct)
 			 */
-			if (ver.hw_variant == 0x08 && ver.fw_variant == 0x22)
+			if (!btintel_test_flag(hdev, INTEL_NO_WBS_SUPPORT))
 				set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED,
 					&hdev->quirks);
 
drivers/bluetooth/btintel.h +1 -0
index c9b24e9299e2..084a5e8dce39 100644
@@ -152,6 +152,7 @@ enum {
 	INTEL_BROKEN_INITIAL_NCMD,
 	INTEL_BROKEN_SHUTDOWN_LED,
 	INTEL_ROM_LEGACY,
+	INTEL_NO_WBS_SUPPORT,
 
 	__INTEL_NUM_FLAGS,
 };
drivers/bluetooth/btusb.c +6 -0
index c30d131da784..566501e64c5a 100644
@@ -62,6 +62,7 @@ static struct usb_driver btusb_driver;
 #define BTUSB_QCA_WCN6855	0x1000000
 #define BTUSB_INTEL_BROKEN_SHUTDOWN_LED	0x2000000
 #define BTUSB_INTEL_BROKEN_INITIAL_NCMD 0x4000000
+#define BTUSB_INTEL_NO_WBS_SUPPORT	0x8000000
 
 static const struct usb_device_id btusb_table[] = {
 	/* Generic Bluetooth USB device */
@@ -385,9 +386,11 @@ static const struct usb_device_id blacklist_table[] = {
 	{ USB_DEVICE(0x8087, 0x0033), .driver_info = BTUSB_INTEL_COMBINED },
 	{ USB_DEVICE(0x8087, 0x07da), .driver_info = BTUSB_CSR },
 	{ USB_DEVICE(0x8087, 0x07dc), .driver_info = BTUSB_INTEL_COMBINED |
+						     BTUSB_INTEL_NO_WBS_SUPPORT |
 						     BTUSB_INTEL_BROKEN_INITIAL_NCMD |
 						     BTUSB_INTEL_BROKEN_SHUTDOWN_LED },
 	{ USB_DEVICE(0x8087, 0x0a2a), .driver_info = BTUSB_INTEL_COMBINED |
+						     BTUSB_INTEL_NO_WBS_SUPPORT |
 						     BTUSB_INTEL_BROKEN_SHUTDOWN_LED },
 	{ USB_DEVICE(0x8087, 0x0a2b), .driver_info = BTUSB_INTEL_COMBINED },
 	{ USB_DEVICE(0x8087, 0x0aa7), .driver_info = BTUSB_INTEL_COMBINED |
@@ -3737,6 +3740,9 @@ static int btusb_probe(struct usb_interface *intf,
 		hdev->send = btusb_send_frame_intel;
 		hdev->cmd_timeout = btusb_intel_cmd_timeout;
 
+		if (id->driver_info & BTUSB_INTEL_NO_WBS_SUPPORT)
+			btintel_set_flag(hdev, INTEL_NO_WBS_SUPPORT);
+
 		if (id->driver_info & BTUSB_INTEL_BROKEN_INITIAL_NCMD)
 			btintel_set_flag(hdev, INTEL_BROKEN_INITIAL_NCMD);
 
Signature · 1 line
2.25.1
#1 lore raw

Dear Tedd,

Thank you for the patch.

Am 20.01.22 um 08:50 schrieb Tedd Ho-Jeong An:

Quoted 1 line

From: Tedd Ho-Jeong An <[email protected]>

As this seems to be a regression, please describe the failure case, and how to reproduce it.

Quoted 2 lines

This patch adds the flag to identify the Intel legacy ROM products that don't support WBS like WP and StP.

Please add, why the quirk is only for to 0x07dc and 0x0a2a, and how it was tested.

Quoted 13 lines
Fixes 3df4dfbec0f29 ("Bluetooth: btintel: Move hci quirks to setup routine")
---
  drivers/bluetooth/btintel.c | 10 +++++++---
  drivers/bluetooth/btintel.h |  1 +
  drivers/bluetooth/btusb.c   |  6 ++++++
  3 files changed, 14 insertions(+), 3 deletions(-)
drivers/bluetooth/btintel.c +0 -0
index 1a4f8b227eac..225ed0373e9d 100644

drivers/bluetooth/btintel.c static int btintel_setup_combined(struct hci_dev *hdev) · line 2435

Quoted 10 lines
drivers/bluetooth/btintel.c +5 -2
@@ -2428,10 +2428,14 @@ static int btintel_setup_combined(struct hci_dev *hdev)
 
  			/* Apply the device specific HCI quirks
  			 *
-			 * WBS for SdP - SdP and Stp have a same hw_varaint but
-			 * different fw_variant
+			 * WBS for SdP - For the Legacy ROM products, only SdP
+			 * supports the WBS. But the version information is not
+			 * enough to use here because the StP2 and SdP have same
+			 * hw_variant and fw_variant. So, this flag is set by
+			 * the transport driver(btusb) based on the HW info

Please add a space before (.

Quoted 44 lines
drivers/bluetooth/btintel.c +2 -1
+			 * (idProduct)
  			 */
-			if (ver.hw_variant == 0x08 && ver.fw_variant == 0x22)
+			if (!btintel_test_flag(hdev, INTEL_NO_WBS_SUPPORT))
  				set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED,
  					&hdev->quirks);
 
drivers/bluetooth/btintel.h +1 -0
index c9b24e9299e2..084a5e8dce39 100644
@@ -152,6 +152,7 @@ enum {
  	INTEL_BROKEN_INITIAL_NCMD,
  	INTEL_BROKEN_SHUTDOWN_LED,
  	INTEL_ROM_LEGACY,
+	INTEL_NO_WBS_SUPPORT,
 
  	__INTEL_NUM_FLAGS,
  };
drivers/bluetooth/btusb.c +3 -0
index c30d131da784..566501e64c5a 100644
@@ -62,6 +62,7 @@ static struct usb_driver btusb_driver;
  #define BTUSB_QCA_WCN6855	0x1000000
  #define BTUSB_INTEL_BROKEN_SHUTDOWN_LED	0x2000000
  #define BTUSB_INTEL_BROKEN_INITIAL_NCMD 0x4000000
+#define BTUSB_INTEL_NO_WBS_SUPPORT	0x8000000
 
  static const struct usb_device_id btusb_table[] = {
  	/* Generic Bluetooth USB device */
@@ -385,9 +386,11 @@ static const struct usb_device_id blacklist_table[] = {
  	{ USB_DEVICE(0x8087, 0x0033), .driver_info = BTUSB_INTEL_COMBINED },
  	{ USB_DEVICE(0x8087, 0x07da), .driver_info = BTUSB_CSR },
  	{ USB_DEVICE(0x8087, 0x07dc), .driver_info = BTUSB_INTEL_COMBINED |
+						     BTUSB_INTEL_NO_WBS_SUPPORT |
  						     BTUSB_INTEL_BROKEN_INITIAL_NCMD |
  						     BTUSB_INTEL_BROKEN_SHUTDOWN_LED },
  	{ USB_DEVICE(0x8087, 0x0a2a), .driver_info = BTUSB_INTEL_COMBINED |
+						     BTUSB_INTEL_NO_WBS_SUPPORT |
  						     BTUSB_INTEL_BROKEN_SHUTDOWN_LED },
  	{ USB_DEVICE(0x8087, 0x0a2b), .driver_info = BTUSB_INTEL_COMBINED },
  	{ USB_DEVICE(0x8087, 0x0aa7), .driver_info = BTUSB_INTEL_COMBINED |

drivers/bluetooth/btusb.c static int btusb_probe(struct usb_interface *intf, · line 3748

Quoted 9 lines
drivers/bluetooth/btusb.c +3 -0
@@ -3737,6 +3740,9 @@ static int btusb_probe(struct usb_interface *intf,
  		hdev->send = btusb_send_frame_intel;
  		hdev->cmd_timeout = btusb_intel_cmd_timeout;
 
+		if (id->driver_info & BTUSB_INTEL_NO_WBS_SUPPORT)
+			btintel_set_flag(hdev, INTEL_NO_WBS_SUPPORT);
+
  		if (id->driver_info & BTUSB_INTEL_BROKEN_INITIAL_NCMD)
  			btintel_set_flag(hdev, INTEL_BROKEN_INITIAL_NCMD);
 

Kind regards,

Paul

#2 lore raw
In reply to Tedd Ho-Jeong An

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=606839

---Test result---

Test Summary:

CheckPatch                    PASS      1.07 seconds
GitLint                       PASS      0.35 seconds
SubjectPrefix                 PASS      0.21 seconds
BuildKernel                   PASS      29.94 seconds
BuildKernel32                 PASS      26.51 seconds
Incremental Build with patchesPASS      36.37 seconds
TestRunner: Setup             PASS      478.30 seconds
TestRunner: l2cap-tester      PASS      13.18 seconds
TestRunner: bnep-tester       PASS      5.86 seconds
TestRunner: mgmt-tester       PASS      104.31 seconds
TestRunner: rfcomm-tester     PASS      7.16 seconds
TestRunner: sco-tester        PASS      7.43 seconds
TestRunner: smp-tester        PASS      7.27 seconds
TestRunner: userchan-tester   PASS      6.13 seconds

---
Regards,
Linux Bluetooth

maintainer
#3 lore raw
In reply to Tedd Ho-Jeong An

Hi Tedd,

Quoted 38 lines

This patch adds the flag to identify the Intel legacy ROM products that don't support WBS like WP and StP.

Fixes 3df4dfbec0f29 ("Bluetooth: btintel: Move hci quirks to setup routine")

---

drivers/bluetooth/btintel.c | 10 +++++++---
drivers/bluetooth/btintel.h |  1 +
drivers/bluetooth/btusb.c   |  6 ++++++
3 files changed, 14 insertions(+), 3 deletions(-)
drivers/bluetooth/btintel.c +7 -3
index 1a4f8b227eac..225ed0373e9d 100644
@@ -2428,10 +2428,14 @@ static int btintel_setup_combined(struct hci_dev *hdev)
 
 			/* Apply the device specific HCI quirks
 			 *
-			 * WBS for SdP - SdP and Stp have a same hw_varaint but
-			 * different fw_variant
+			 * WBS for SdP - For the Legacy ROM products, only SdP
+			 * supports the WBS. But the version information is not
+			 * enough to use here because the StP2 and SdP have same
+			 * hw_variant and fw_variant. So, this flag is set by
+			 * the transport driver(btusb) based on the HW info
+			 * (idProduct)
 			 */
-			if (ver.hw_variant == 0x08 && ver.fw_variant == 0x22)
+			if (!btintel_test_flag(hdev, INTEL_NO_WBS_SUPPORT))
 				set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED,
 					&hdev->quirks);
 
drivers/bluetooth/btintel.h +0 -0
index c9b24e9299e2..084a5e8dce39 100644

drivers/bluetooth/btintel.h enum { · line 155

Quoted 4 lines
drivers/bluetooth/btintel.h +1 -0
@@ -152,6 +152,7 @@ enum {
 	INTEL_BROKEN_INITIAL_NCMD,
 	INTEL_BROKEN_SHUTDOWN_LED,
 	INTEL_ROM_LEGACY,
+	INTEL_NO_WBS_SUPPORT,

please keep it as INTEL_ROM_LEGACY_NO_WBS or INTEL_ROM_LEGACY_NO_WBS_SUPPORT. It is better to make clear that this is only for our ROM products. Especially since above it is in the section for just the ROM products.

Regards

Marcel