Skip to contentSkip to conversation

Bluetooth: hci_bcm: Use default baud rate if missing shutdown GPIO

PATCH Applied Marcel Holtmann 2 participants 2 messages Mar 7, 2018 – Mar 11, 2018 Bluetooth drivers

lore
Share & tools
lore

Marcel Holtmann

author maintainer
#0 lore raw

PATCH 1/1 Bluetooth: hci_bcm: Use default baud rate if missing shutdown GPIO

In case the shutdown GPIO is not wired up, it is impossible to reset the Bluetooth controller to its original state. This include the initial default baud rate which leads to issues when reloading the module or when something unexpected happens. To avoid any kind of runtime deadlocks, stick with the initial default baud rate.

---
 drivers/bluetooth/hci_bcm.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/bluetooth/hci_bcm.c +5 -0
index 6035d68d8167..1b9bef24b7a2 100644
@@ -1141,6 +1141,11 @@ static int bcm_serdev_probe(struct serdev_device *serdev)
 	if (err)
 		return err;
 
+	if (!bcmdev->shutdown) {
+		dev_warn(&serdev->dev, "No reset resource, using default baud rate\n");
+		bcmdev->oper_speed = bcmdev->init_speed;
+	}
+
 	err = bcm_gpio_set_power(bcmdev, false);
 	if (err)
 		dev_err(&serdev->dev, "Failed to power down\n");
Signature · 1 line
2.14.3
#1 lore raw

Hi Marcel,

Quoted 10 lines · Marcel Holtmann

In case the shutdown GPIO is not wired up, it is impossible to reset the Bluetooth controller to its original state. This include the initial default baud rate which leads to issues when reloading the module or when something unexpected happens. To avoid any kind of runtime deadlocks, stick with the initial default baud rate.

---
 drivers/bluetooth/hci_bcm.c | 5 +++++
 1 file changed, 5 insertions(+)

Applied to bluetooth-next. Thanks.

Johan