kernel_optimize_test/drivers/bluetooth
Dean Jenkins 2d6f1da168 Bluetooth: hci_ldisc: Add protocol check to hci_uart_tx_wakeup()
Before attempting to schedule a work-item onto hu->write_work in
hci_uart_tx_wakeup(), check that the Data Link protocol layer is
still bound to the HCI UART driver.

Failure to perform this protocol check causes a race condition between
the work queue hu->write_work running hci_uart_write_work() and the
Data Link protocol layer being unbound (closed) in hci_uart_tty_close().

Note hci_uart_tty_close() does have a "cancel_work_sync(&hu->write_work)"
but it is ineffective because it cannot prevent work-items being added
to hu->write_work after cancel_work_sync() has run.

Therefore, add a check for HCI_UART_PROTO_READY into hci_uart_tx_wakeup()
which prevents scheduling of the work queue when HCI_UART_PROTO_READY
is in the clear state. However, note a small race condition remains
because the hci_uart_tx_wakeup() thread can run in parallel with the
hci_uart_tty_close() thread so it is possible that a schedule of
hu->write_work can occur when HCI_UART_PROTO_READY is cleared. A complete
solution needs locking of the threads which is implemented in a future
commit.

Signed-off-by: Dean Jenkins <Dean_Jenkins@mentor.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2017-04-30 12:22:14 +02:00
..
ath3k.c Bluetooth: Add another AR3012 04ca:3018 device 2017-02-16 17:35:23 +01:00
bcm203x.c
bfusb.c
bluecard_cs.c Bluetooth: bluecard: use setup_timer 2017-04-12 22:02:37 +02:00
bpa10x.c
bt3c_cs.c
btbcm.c Bluetooth: btbcm: Add a delay for module reset 2017-02-16 17:32:25 +01:00
btbcm.h
btintel.c
btintel.h
btmrvl_debugfs.c
btmrvl_drv.h
btmrvl_main.c Bluetooth: btmrvl: fix spelling mistake: "caibration" -> "calibration" 2017-02-16 17:38:51 +01:00
btmrvl_sdio.c Bluetooth: btmrvl: remove unnecessary wakeup interrupt number sanity check 2017-04-12 22:02:40 +02:00
btmrvl_sdio.h
btqca.c
btqca.h
btqcomsmd.c soc: qcom: smd: Transition client drivers from smd to rpmsg 2017-03-28 17:58:07 -07:00
btrtl.c Bluetooth: btrtl: Change message for missing config file 2017-04-12 22:02:38 +02:00
btrtl.h
btsdio.c
btuart_cs.c
btusb.c Bluetooth: btusb: wake system up when receives a wake irq 2017-04-12 22:02:38 +02:00
btwilink.c
dtl1_cs.c
hci_ag6xx.c
hci_ath.c
hci_bcm.c Bluetooth: hci_bcm: add missing tty-device sanity check 2017-04-12 22:02:39 +02:00
hci_bcsp.c
hci_h4.c Bluetooth: hci_uart: add support for word alignment 2017-04-12 22:12:17 +02:00
hci_h5.c
hci_intel.c Bluetooth: hci_intel: add missing tty-device sanity check 2017-04-12 22:02:39 +02:00
hci_ldisc.c Bluetooth: hci_ldisc: Add protocol check to hci_uart_tx_wakeup() 2017-04-30 12:22:14 +02:00
hci_ll.c Bluetooth: hci_ll: Fix NULL pointer deref on FW upload failure 2017-04-22 10:28:40 +02:00
hci_mrvl.c
hci_nokia.c Bluetooth: Add module license for HCI UART Nokia H4+ 2017-04-30 12:22:14 +02:00
hci_qca.c Bluetooth: hci_qca: fix spelling mistake: "Spurrious" -> "Spurious" 2017-02-18 20:09:47 +01:00
hci_serdev.c Bluetooth: hci_serdev: allow modular drivers 2017-04-12 22:12:17 +02:00
hci_uart.h bluetooth: hci_uart: remove unused hci_uart_init_tty 2017-04-13 19:22:53 +02:00
hci_vhci.c
Kconfig Bluetooth: try to improve CONFIG_SERIAL_DEV_BUS dependency 2017-04-22 10:28:40 +02:00
Makefile Bluetooth: try to improve CONFIG_SERIAL_DEV_BUS dependency 2017-04-22 10:28:40 +02:00