]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
Bluetooth: hci_mrvl: Wait for final ack before switching baudrate
authorSascha Hauer <s.hauer@pengutronix.de>
Fri, 14 Jun 2019 07:23:50 +0000 (09:23 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Sat, 6 Jul 2019 10:53:56 +0000 (12:53 +0200)
For the Marvell HCI UART we have to upload two firmware files. The first
one is only for switching the baudrate of the device to a higher
baudrate. After the baudrate switching firmware has been uploaded the
device waits for a final ack (0x5a) before actually switching the
baudrate. To send this final ack with the old baudrate give the hci
ldisc workqueue a chance to run before switching the baudrate. Without
this the final ack will never be received by the device and firmware
upload fails.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
drivers/bluetooth/hci_mrvl.c

index 50212ac629e3540bc1f9a2d2fb030c286680512b..a0a74362455ec554edeb2cf24db1f64aa5a3430a 100644 (file)
@@ -339,6 +339,9 @@ static int mrvl_setup(struct hci_uart *hu)
                return -EINVAL;
        }
 
+       /* Let the final ack go out before switching the baudrate */
+       hci_uart_wait_until_sent(hu);
+
        hci_uart_set_baudrate(hu, 3000000);
        hci_uart_set_flow_control(hu, false);