kernel_samsung_a53x/drivers/bluetooth
Arkadiusz Bokowy 09f6b73de7 Bluetooth: vhci: Fix race when opening vhci device
commit 92d4abd66f7080075793970fc8f241239e58a9e7 upstream.

When the vhci device is opened in the two-step way, i.e.: open device
then write a vendor packet with requested controller type, the device
shall respond with a vendor packet which includes HCI index of created
interface.

When the virtual HCI is created, the host sends a reset request to the
controller. This request is processed by the vhci_send_frame() function.
However, this request is send by a different thread, so it might happen
that this HCI request will be received before the vendor response is
queued in the read queue. This results in the HCI vendor response and
HCI reset request inversion in the read queue which leads to improper
behavior of btvirt:

> dmesg
[1754256.640122] Bluetooth: MGMT ver 1.22
[1754263.023806] Bluetooth: MGMT ver 1.22
[1754265.043775] Bluetooth: hci1: Opcode 0x c03 failed: -110

In order to synchronize vhci two-step open/setup process with virtual
HCI initialization, this patch adds internal lock when queuing data in
the vhci_send_frame() function.

Signed-off-by: Arkadiusz Bokowy <arkadiusz.bokowy@gmail.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-08 11:26:08 +01:00
..
ath3k.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bcm43xx.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bcm203x.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfusb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bluecard_cs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bpa10x.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bt3c_cs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
btbcm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
btbcm.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
btintel.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
btintel.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
btmrvl_debugfs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
btmrvl_drv.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
btmrvl_main.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
btmrvl_sdio.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
btmrvl_sdio.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
btmtksdio.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
btmtkuart.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
btpower.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
btqca.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
btqca.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
btqcomsmd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
btrsi.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
btrtl.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
btrtl.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
btsdio.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
btusb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
btwilink.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dtl1_cs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
h4_recv.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hci_ag6xx.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hci_ath.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hci_bcm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hci_bcsp.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hci_h4.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hci_h5.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hci_intel.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hci_ldisc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hci_ll.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hci_mrvl.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hci_nokia.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hci_qca.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hci_serdev.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hci_uart.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hci_vhci.c Bluetooth: vhci: Fix race when opening vhci device 2024-11-08 11:26:08 +01:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00