Skip to contentSkip to conversation

Revert "Bluetooth: hci_ll: set operational frequency earlier"

PATCH In review Adam Ford 3 participants 8 messages Oct 2, 2019 – Oct 23, 2019 Bluetooth drivers

lore
Share & tools
lore

Adam Ford

author
#0 lore raw

PATCH 1/1 Revert "Bluetooth: hci_ll: set operational frequency earlier"

As nice as it would be to update firmware faster, that patch broke at least two different boards, an OMAP4+WL1285 based Motorola Droid 4, as reported by Sebasian Reichel and the Logic PD i.MX6Q + WL1837MOD.

This reverts commit a2e02f38eff84f199c8e32359eb213f81f270047.

drivers/bluetooth/hci_ll.c +18 -21
index 285706618f8a..d9a4c6c691e0 100644
@@ -621,13 +621,6 @@ static int ll_setup(struct hci_uart *hu)
 
 	serdev_device_set_flow_control(serdev, true);
 
-	if (hu->oper_speed)
-		speed = hu->oper_speed;
-	else if (hu->proto->oper_speed)
-		speed = hu->proto->oper_speed;
-	else
-		speed = 0;
-
 	do {
 		/* Reset the Bluetooth device */
 		gpiod_set_value_cansleep(lldev->enable_gpio, 0);
@@ -639,20 +632,6 @@ static int ll_setup(struct hci_uart *hu)
 			return err;
 		}
 
-		if (speed) {
-			__le32 speed_le = cpu_to_le32(speed);
-			struct sk_buff *skb;
-
-			skb = __hci_cmd_sync(hu->hdev,
-					     HCI_VS_UPDATE_UART_HCI_BAUDRATE,
-					     sizeof(speed_le), &speed_le,
-					     HCI_INIT_TIMEOUT);
-			if (!IS_ERR(skb)) {
-				kfree_skb(skb);
-				serdev_device_set_baudrate(serdev, speed);
-			}
-		}
-
 		err = download_firmware(lldev);
 		if (!err)
 			break;
@@ -677,7 +656,25 @@ static int ll_setup(struct hci_uart *hu)
 	}
 
 	/* Operational speed if any */
+	if (hu->oper_speed)
+		speed = hu->oper_speed;
+	else if (hu->proto->oper_speed)
+		speed = hu->proto->oper_speed;
+	else
+		speed = 0;
+
+	if (speed) {
+		__le32 speed_le = cpu_to_le32(speed);
+		struct sk_buff *skb;
 
+		skb = __hci_cmd_sync(hu->hdev, HCI_VS_UPDATE_UART_HCI_BAUDRATE,
+				     sizeof(speed_le), &speed_le,
+				     HCI_INIT_TIMEOUT);
+		if (!IS_ERR(skb)) {
+			kfree_skb(skb);
+			serdev_device_set_baudrate(serdev, speed);
+		}
+	}
 
 	return 0;
 }
Signature · 1 line
2.17.1
Acked-by on v1 1/1
#1 lore raw

Hi,

Quoted 8 lines · Adam Ford

As nice as it would be to update firmware faster, that patch broke at least two different boards, an OMAP4+WL1285 based Motorola Droid 4, as reported by Sebasian Reichel and the Logic PD i.MX6Q + WL1837MOD.

This reverts commit a2e02f38eff84f199c8e32359eb213f81f270047.

This should be backported stable

-- Sebastian

Quoted 68 lines
drivers/bluetooth/hci_ll.c +18 -21
index 285706618f8a..d9a4c6c691e0 100644
@@ -621,13 +621,6 @@ static int ll_setup(struct hci_uart *hu)
 
 	serdev_device_set_flow_control(serdev, true);
 
-	if (hu->oper_speed)
-		speed = hu->oper_speed;
-	else if (hu->proto->oper_speed)
-		speed = hu->proto->oper_speed;
-	else
-		speed = 0;
-
 	do {
 		/* Reset the Bluetooth device */
 		gpiod_set_value_cansleep(lldev->enable_gpio, 0);
@@ -639,20 +632,6 @@ static int ll_setup(struct hci_uart *hu)
 			return err;
 		}
 
-		if (speed) {
-			__le32 speed_le = cpu_to_le32(speed);
-			struct sk_buff *skb;
-
-			skb = __hci_cmd_sync(hu->hdev,
-					     HCI_VS_UPDATE_UART_HCI_BAUDRATE,
-					     sizeof(speed_le), &speed_le,
-					     HCI_INIT_TIMEOUT);
-			if (!IS_ERR(skb)) {
-				kfree_skb(skb);
-				serdev_device_set_baudrate(serdev, speed);
-			}
-		}
-
 		err = download_firmware(lldev);
 		if (!err)
 			break;
@@ -677,7 +656,25 @@ static int ll_setup(struct hci_uart *hu)
 	}
 
 	/* Operational speed if any */
+	if (hu->oper_speed)
+		speed = hu->oper_speed;
+	else if (hu->proto->oper_speed)
+		speed = hu->proto->oper_speed;
+	else
+		speed = 0;
+
+	if (speed) {
+		__le32 speed_le = cpu_to_le32(speed);
+		struct sk_buff *skb;
 
+		skb = __hci_cmd_sync(hu->hdev, HCI_VS_UPDATE_UART_HCI_BAUDRATE,
+				     sizeof(speed_le), &speed_le,
+				     HCI_INIT_TIMEOUT);
+		if (!IS_ERR(skb)) {
+			kfree_skb(skb);
+			serdev_device_set_baudrate(serdev, speed);
+		}
+	}
 
 	return 0;
 }
Signature · 1 line
2.17.1
author
#2 lore raw
Quoted 9 lines · Sebastian Reichel

Hi,

Quoted 5 lines · Adam Ford

As nice as it would be to update firmware faster, that patch broke at least two different boards, an OMAP4+WL1285 based Motorola Droid 4, as reported by Sebasian Reichel and the Logic PD i.MX6Q + WL1837MOD.

Quoted 7 lines
Quoted 3 lines

This reverts commit a2e02f38eff84f199c8e32359eb213f81f270047.

This should be backported stable

Is there any chance of this getting picked up for the 5.4 kernel? It's been a couple weeks, and I haven't seen any responses beyond Sebastian's Ack and request for backport.

adam

Quoted 71 lines

-- Sebastian

Quoted 68 lines
drivers/bluetooth/hci_ll.c +18 -22
index 285706618f8a..d9a4c6c691e0 100644
@@ -621,13 +621,6 @@ static int ll_setup(struct hci_uart *hu)
 
      serdev_device_set_flow_control(serdev, true);
 
-     if (hu->oper_speed)
-             speed = hu->oper_speed;
-     else if (hu->proto->oper_speed)
-             speed = hu->proto->oper_speed;
-     else
-             speed = 0;
-
      do {
              /* Reset the Bluetooth device */
              gpiod_set_value_cansleep(lldev->enable_gpio, 0);
@@ -639,20 +632,6 @@ static int ll_setup(struct hci_uart *hu)
                      return err;
              }
 
-             if (speed) {
-                     __le32 speed_le = cpu_to_le32(speed);
-                     struct sk_buff *skb;
-
-                     skb = __hci_cmd_sync(hu->hdev,
-                                          HCI_VS_UPDATE_UART_HCI_BAUDRATE,
-                                          sizeof(speed_le), &speed_le,
-                                          HCI_INIT_TIMEOUT);
-                     if (!IS_ERR(skb)) {
-                             kfree_skb(skb);
-                             serdev_device_set_baudrate(serdev, speed);
-                     }
-             }
-
              err = download_firmware(lldev);
              if (!err)
                      break;
@@ -677,7 +656,25 @@ static int ll_setup(struct hci_uart *hu)
      }
 
      /* Operational speed if any */
+     if (hu->oper_speed)
+             speed = hu->oper_speed;
+     else if (hu->proto->oper_speed)
+             speed = hu->proto->oper_speed;
+     else
+             speed = 0;
+
+     if (speed) {
+             __le32 speed_le = cpu_to_le32(speed);
+             struct sk_buff *skb;
 
+             skb = __hci_cmd_sync(hu->hdev, HCI_VS_UPDATE_UART_HCI_BAUDRATE,
+                                  sizeof(speed_le), &speed_le,
+                                  HCI_INIT_TIMEOUT);
+             if (!IS_ERR(skb)) {
+                     kfree_skb(skb);
+                     serdev_device_set_baudrate(serdev, speed);
+             }
+     }
 
      return 0;
 }
--

2.17.1

maintainer
#3 lore raw
In reply to Adam Ford

Hi Adam,

Quoted 8 lines

As nice as it would be to update firmware faster, that patch broke at least two different boards, an OMAP4+WL1285 based Motorola Droid 4, as reported by Sebasian Reichel and the Logic PD i.MX6Q + WL1837MOD.

This reverts commit a2e02f38eff84f199c8e32359eb213f81f270047.

patch has been applied to bluetooth-next tree.

Regards

Marcel

author
#4 lore raw
Quoted 8 lines · Marcel Holtmann

Hi Adam,

Quoted 5 lines

As nice as it would be to update firmware faster, that patch broke at least two different boards, an OMAP4+WL1285 based Motorola Droid 4, as reported by Sebasian Reichel and the Logic PD i.MX6Q + WL1837MOD.

Quoted 5 lines
Quoted 3 lines

This reverts commit a2e02f38eff84f199c8e32359eb213f81f270047.

patch has been applied to bluetooth-next tree.

Thank you very much!

adam

Quoted 5 lines

Regards

Marcel

author
#5 lore raw
In reply to Marcel Holtmann
Quoted 8 lines · Marcel Holtmann

Hi Adam,

Quoted 5 lines

As nice as it would be to update firmware faster, that patch broke at least two different boards, an OMAP4+WL1285 based Motorola Droid 4, as reported by Sebasian Reichel and the Logic PD i.MX6Q + WL1837MOD.

Quoted 5 lines
Quoted 3 lines

This reverts commit a2e02f38eff84f199c8e32359eb213f81f270047.

patch has been applied to bluetooth-next tree.

Any change this can get pushed upstream to stable? (including 5.4?)

adam

Quoted 5 lines

Regards

Marcel

author
#6 lore raw
Quoted 10 lines · Adam Ford
Quoted 8 lines · Marcel Holtmann

Hi Adam,

Quoted 5 lines

As nice as it would be to update firmware faster, that patch broke at least two different boards, an OMAP4+WL1285 based Motorola Droid 4, as reported by Sebasian Reichel and the Logic PD i.MX6Q + WL1837MOD.

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

This reverts commit a2e02f38eff84f199c8e32359eb213f81f270047.

patch has been applied to bluetooth-next tree.

Any change this can get pushed upstream to stable? (including 5.4?)

Marcel, I have confirmed this revert also fixes a regression on my omap36xx based device using a wl1283 Bluetooth. At this point, I believe we've identified at least 3 devices with regressions that this revert fixes.

adam

Quoted 6 lines

adam

Quoted 5 lines

Regards

Marcel

maintainer
#7 lore raw

Hi Adam,

Quoted 11 lines
Quoted 11 lines
Quoted 10 lines
Quoted 8 lines

As nice as it would be to update firmware faster, that patch broke at least two different boards, an OMAP4+WL1285 based Motorola Droid 4, as reported by Sebasian Reichel and the Logic PD i.MX6Q + WL1837MOD.

This reverts commit a2e02f38eff84f199c8e32359eb213f81f270047.

patch has been applied to bluetooth-next tree.

Quoted 7 lines
Quoted 2 lines

Any change this can get pushed upstream to stable? (including 5.4?)

Marcel, I have confirmed this revert also fixes a regression on my omap36xx based device using a wl1283 Bluetooth. At this point, I believe we've identified at least 3 devices with regressions that this revert fixes.

as soon as we have done our pull request and this is in Linus’ tree, feel free to suggest it for -stable tree inclusion.

Regards

Marcel