]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
Bluetooth: hci_bcm: Use default baud rate if missing shutdown GPIO
authorMarcel Holtmann <marcel@holtmann.org>
Wed, 7 Mar 2018 21:39:03 +0000 (22:39 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Sun, 1 Apr 2018 12:25:30 +0000 (14:25 +0200)
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.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
drivers/bluetooth/hci_bcm.c

index 467e2f5cb7e390ef35364c219d88846e3a1616d5..ff7535e85dea6554714a28de3f1a59069e79d743 100644 (file)
@@ -1146,6 +1146,12 @@ 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");