linux/drivers/bluetooth
Marcel Holtmann ce6bb9297c Bluetooth: btusb: Handle out of order firmware loading complete event
When loading the Intel firmware it can happen that the firmware loading
complete vendor event arrives before the command complete event for the
last firmware fragment.

< HCI Command: Vendor (0x3f|0x0009) plen 7
        01 02 fc 03 00 00 00
> HCI Event: Vendor (0xff) plen 5
        06 00 00 00 00
> HCI Event: Command Complete (0x0e) plen 4
      Vendor (0x3f|0x0009) ncmd 31
        Status: Success (0x00)

This is mainly caused by the fact that the vendor command and its
command complete event are transported over the bulk endpoints. The
firmware loading complete event however is send over the interrupt
endpoint. So with just bad timing one event arrives before the other.

Currently the code does not account for it. There are precautions for
receiving firmware loading complete event quickly, but not for receiving
it before the command complete.

Introduce an extra flag that tracks when the firmware sending has
completed from the driver point of view and track the completion of
the firmware loading procedure with a different flag. That way the
wakeup can be handled properly.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2015-01-28 21:26:21 +01:00
..
ath3k.c Bluetooth: ath3k: Add support of AR3012 bluetooth 13d3:3423 device 2015-01-21 06:05:37 +01:00
bcm203x.c Bluetooth: Use devm_kzalloc in bcm203x.c file. 2012-08-06 15:03:00 -03:00
bfusb.c Bluetooth: bfusb: Set the HCI_QUIRK_BROKEN_LOCAL_COMMANDS quirk 2014-12-26 20:16:12 +02:00
bluecard_cs.c Bluetooth: Remove typedef bluecard_info_t 2014-08-14 08:49:25 +02:00
bpa10x.c Bluetooth: Declare bpa10x_table[] as const 2013-10-11 17:05:22 +02:00
bt3c_cs.c Bluetooth: Remove typedef bt3c_info_t 2014-08-14 08:49:26 +02:00
btmrvl_debugfs.c Bluetooth: btmrvl add firmware dump support 2014-12-03 17:35:51 +01:00
btmrvl_drv.h Bluetooth: btmrvl: use msecs_to_jiffies within macro definition 2015-01-08 06:36:50 +01:00
btmrvl_main.c Bluetooth: btmrvl: fix card reset and suspend race issue 2015-01-08 06:36:50 +01:00
btmrvl_sdio.c bluetooth: btmrvl: increase the priority of firmware download message 2015-01-06 16:19:36 +01:00
btmrvl_sdio.h Bluetooth: btmrvl add firmware dump support 2014-12-03 17:35:51 +01:00
btsdio.c Bluetooth: Use MD SET register for changing SDIO Type-B to Type-A 2013-12-29 21:31:07 +02:00
btuart_cs.c Bluetooth: Remove typedef btuart_info_t 2014-08-14 08:49:25 +02:00
btusb.c Bluetooth: btusb: Handle out of order firmware loading complete event 2015-01-28 21:26:21 +01:00
btwilink.c bluetooth: drop owner assignment from platform_drivers 2014-10-20 16:20:19 +02:00
dtl1_cs.c Bluetooth: Remove typedefs nsh_t and dtl1_info_t 2014-08-14 08:49:26 +02:00
hci_ath.c Bluetooth: hci-uart-ath: Correct the comments in this driver 2014-11-11 00:21:18 +01:00
hci_bcsp.c Bluetooth: Remove assignments in if-statements 2014-03-05 20:52:17 +02:00
hci_h4.c Bluetooth: Remove hci_h4 unused defines 2014-04-24 11:55:26 -03:00
hci_h5.c Bluetooth: Switch HCI H5 driver to use hci_reset_dev() function 2014-11-02 10:03:51 +02:00
hci_ldisc.c Bluetooth: Fix HCIUARTGETDEVICE ioctl when UART is not registered 2014-07-12 18:37:34 +03:00
hci_ll.c Bluetooth: Add hdev parameter to hdev->send driver callback 2013-10-11 15:28:03 +02:00
hci_uart.h Bluetooth: Add support for external configuration with UART driver 2014-07-11 13:59:50 +03:00
hci_vhci.c switch hci_vhci to ->write_iter() 2014-10-09 02:39:08 -04:00
Kconfig Bluetooth: btmrvl add firmware dump support 2014-12-03 17:35:51 +01:00
Makefile Bluetooth: Enable -D__CHECK_ENDIAN__ for sparse by default 2013-10-02 09:10:05 +03:00