linux-stable/drivers/bluetooth
Ismael Ferreras Morezuelas b3cf94c8b6 Bluetooth: btusb: Use quirk to skip HCI_FLT_CLEAR_ALL on fake CSR controllers
Another subset of the more recent batch of Chinese clones aren't
specs-compliant and seem to lock up whenever they receive a
HCI_OP_SET_EVENT_FLT with flt_type set to zero/HCI_FLT_CLEAR_ALL,
which on Linux (until the recent HCI state-machine refactor) happened
right at BR/EDR setup. As there are other less-straightforward ways
of reaching those operations, this patch is still relevant.

So, while all the previous efforts to wrangle the herd of fake CSRs
seem to be paying off (and these also get detected as such) we
still need to take care of this quirk; testers seem to agree
that these dongles tend to work well enough afterwards.

From some cursory USB packet capture on Windows it seems like
that driver doesn't appear to use this clear-all functionality at all.

This patch was tested on some really popular AliExpress-style
dongles, in my case marked as "V5.0". Chip markings: UG8413,
the backside of the PCB says "USB Dangel" (sic).

Here is the `hciconfig -a` output; for completeness:

hci0:	Type: Primary  Bus: USB
	BD Address: 00:1A:7D:DA:7X:XX  ACL MTU: 679:8  SCO MTU: 48:16
	UP RUNNING PSCAN ISCAN
	Features: 0xbf 0x3e 0x4d 0xfa 0xdb 0x3d 0x7b 0xc7
	Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
	Link policy: RSWITCH SNIFF
	Link mode: PERIPHERAL ACCEPT
	Name: 'CSR8510 A10.'
	Class: 0x7c0104
	Service Classes: Rendering, Capturing, Object Transfer, Audio, Telephony
	Device Class: Computer, Desktop workstation
	HCI Version: 4.0 (0x6)  Revision: 0x3120
	LMP Version: 4.0 (0x6)  Subversion: 0x22bb
	Manufacturer: Cambridge Silicon Radio (10)

As well as the `lsusb -vv -d 0a12:0001`:

ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass          224 Wireless
  bDeviceSubClass         1 Radio Frequency
  bDeviceProtocol         1 Bluetooth
  bMaxPacketSize0        64
  idVendor           0x0a12 Cambridge Silicon Radio, Ltd
  idProduct          0x0001 Bluetooth Dongle (HCI mode)
  bcdDevice           88.91
  iManufacturer           0
  iProduct                2 BT DONGLE10
  iSerial                 0
  bNumConfigurations      1

Also, changed the benign dmesg print that shows up whenever the
generic force-suspend fails from bt_dev_err to bt_dev_warn;
it's okay and done on a best-effort basis, not a problem
if that does not work.

Also, swapped the HCI subver and LMP subver numbers for the Barrot
in the comment, which I copied wrong the last time around.

Fixes: 81cac64ba2 ("Bluetooth: Deal with USB devices that are faking CSR vendor")
Fixes: cde1a8a992 ("Bluetooth: btusb: Fix and detect most of the Chinese Bluetooth controllers")
Fixes: d74e0ae7e0 ("Bluetooth: btusb: Fix detection of some fake CSR controllers with a bcdDevice val of 0x0134")
Fixes: 0671c06623 ("Bluetooth: btusb: Add workaround for remote-wakeup issues with Barrot 8041a02 fake CSR controllers")
Fixes: f4292e2faf ("Bluetooth: btusb: Make the CSR clone chip force-suspend workaround more generic")

Link: https://bugzilla.kernel.org/show_bug.cgi?id=60824
Link: https://gist.github.com/nevack/6b36b82d715dc025163d9e9124840a07

Cc: stable@vger.kernel.org
Cc: Hans de Goede <hdegoede@redhat.com>
Tested-by: Gonzalo Tornaría <tornaria@cmat.edu.uy>
Tested-by: Mateus Lemos <lemonsmateus@gmail.com>
Tested-by: Ismael Ferreras Morezuelas <swyterzone@gmail.com>
Signed-off-by: Ismael Ferreras Morezuelas <swyterzone@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2022-03-18 17:12:07 +01:00
..
ath3k.c Bluetooth: ath3k: use usb_control_msg_send() and usb_control_msg_recv() 2020-09-25 16:33:59 +02:00
bcm203x.c Bluetooth: Use fallthrough pseudo-keyword 2020-07-10 19:09:42 +02:00
bfusb.c Bluetooth: bfusb: fix division by zero in send path 2021-10-25 15:04:46 +02:00
bluecard_cs.c Bluetooth: Use fallthrough pseudo-keyword 2020-07-10 19:09:42 +02:00
bpa10x.c
bt3c_cs.c
btbcm.c Bluetooth: btbcm: disable read tx power for MacBook Air 8,1 and 8,2 2022-01-06 14:55:33 +01:00
btbcm.h Bluetooth: btbcm: Make btbcm_setup_patchram use btbcm_finalize 2020-04-22 19:43:58 +02:00
btintel.c Bluetooth: btintel: Fix WBS setting for Intel legacy ROM products 2022-01-21 21:37:48 +01:00
btintel.h Bluetooth: btintel: Fix WBS setting for Intel legacy ROM products 2022-01-21 21:37:48 +01:00
btmrvl_debugfs.c Bluetooth: Remove kernel-doc style comment block 2022-01-21 21:41:51 +01:00
btmrvl_drv.h
btmrvl_main.c Bluetooth: btmrvl_main: repair a non-kernel-doc comment 2021-11-16 15:12:05 +01:00
btmrvl_sdio.c Bluetooth: Remove kernel-doc style comment block 2022-01-21 21:41:51 +01:00
btmrvl_sdio.h
btmtk.c Bluetooth: btmtkuart: rely on BT_MTK module 2022-03-18 17:12:07 +01:00
btmtk.h Bluetooth: btmtkuart: rely on BT_MTK module 2022-03-18 17:12:07 +01:00
btmtksdio.c Bluetooth: btmtksdio: Fix kernel oops when sdio suspend. 2022-03-04 16:33:27 +01:00
btmtkuart.c Bluetooth: btmtkuart: fix the conflict between mtk and msft vendor event 2022-03-18 17:12:07 +01:00
btqca.c Bluetooth: btqca: sequential validation 2022-01-07 08:32:55 +01:00
btqca.h Bluetooth: btqca: sequential validation 2022-01-07 08:32:55 +01:00
btqcomsmd.c Bluetooth: btqcomsmd: Fix a resource leak in error handling paths in the probe function 2020-12-18 22:20:21 +01:00
btrsi.c Bluetooth: btrsi: remove superfluous header files from btrsi.c 2021-09-29 00:13:48 +02:00
btrtl.c Bluetooth: btrtl: Add support for RTL8822C hci_ver 0x08 2022-01-26 14:39:34 +01:00
btrtl.h Bluetooth: hci_h5: Add RTL8822CS capabilities 2021-06-26 07:12:34 +02:00
btsdio.c Bluetooth: btsdio: Do not bind to non-removable BCM4345 and BCM43455 2021-10-20 15:04:13 +02:00
btusb.c Bluetooth: btusb: Use quirk to skip HCI_FLT_CLEAR_ALL on fake CSR controllers 2022-03-18 17:12:07 +01:00
dtl1_cs.c
h4_recv.h
hci_ag6xx.c Bluetooth: hci_uart: Remove redundant assignment to fw_ptr 2021-06-26 07:52:41 +02:00
hci_ath.c
hci_bcm.c Bluetooth: hci_bcm: add BCM43430A0 & BCM43430A1 2022-03-04 16:57:13 +01:00
hci_bcsp.c
hci_h4.c Bluetooth: hci_h4: Fix padding calculation error within h4_recv_buf() 2021-11-16 13:57:25 +01:00
hci_h5.c Bluetooth: hci_h5: Add power reset via gpio in h5_btrtl_open 2022-01-26 14:39:35 +01:00
hci_intel.c Bluetooth: btintel: Check firmware version before download 2021-03-25 16:09:35 +01:00
hci_ldisc.c tty: remove file from tty_ldisc_ops::ioctl and compat_ioctl 2021-11-25 18:36:27 +01:00
hci_ll.c Bluetooth: Remove kernel-doc style comment block 2022-01-21 21:41:51 +01:00
hci_mrvl.c
hci_nokia.c
hci_qca.c Bluetooth: hci_qca: Fix NULL vs IS_ERR_OR_NULL check in qca_serdev_probe 2022-01-06 14:53:57 +01:00
hci_serdev.c Bluetooth: hci_serdev: call init_rwsem() before p->open() 2022-01-21 23:46:48 +01:00
hci_uart.h Bluetooth: hci_h5: Disable the hci_suspend_notifier for btrtl devices 2021-07-22 16:06:09 +02:00
hci_vhci.c Bluetooth: vhci: Set HCI_QUIRK_VALID_LE_STATES 2021-12-22 23:01:35 +01:00
Kconfig Bluetooth: btmtkuart: rely on BT_MTK module 2022-03-18 17:12:07 +01:00
Makefile Bluetooth: mediatek: add BT_MTK module 2021-10-25 15:36:23 +02:00
virtio_bt.c virtio,vdpa,qemu_fw_cfg: features, cleanups, fixes 2022-01-18 10:05:48 +02:00