zephyr/include
Joakim Andersson 4be66bd33d Bluetooth: Fix host RX thread deadlock
Fix host RX thread being deadlocked. The deadlock occurs because the
RX thread is stuck waiting in conn_tx_alloc with K_FOREVER but if the
connection is disconnected only the RX thread can unblock it in the
handling of the disconnect event.

This commit fixes this deadlock by splitting the processing of the
disconnected event into two parts.
The part needed to unblock the RX is to release resources held by
unack'ed TX packets and mark the connection state as not connected
anymore.
The RX thread waiting for free_tx fifo and the TX thread waiting for
the bt_dev.le.pkts semaphore will both check the connected state after
having acquired them and will abort if disconnected.
The rest of the processing will be handled at normal RX thread
priority like normal.

Move the bt_recv_prio handling to the Bluetooth host when the host
has defined its own RX thread (CONFIG_BT_RECV_IS_RX_THREAD=n).
If the HCI driver has the RX thread (CONFIG_BT_RECV_IS_RX_THREAD=y),
then the responsibility to call bt_recv and bt_recv_prio correctly
falls to the HCI driver.
The helper function bt_hci_evt_is_prio() is replaced with
bt_hci_evt_get_flags() so that the HCI driver can do this correctly.
This decision to replace was made so that existing HCI drivers
maintained out-of-tree will fail at compile time with the new system.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>

Bluetooth: host: Move bt_recv_prio to host when RX thread is defined

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-07-06 11:15:39 +02:00
..
app_memory sys: util: Added separator to FOR_EACH_ macros 2020-06-10 11:58:13 +02:00
arch drivers: interrupt_controller: Add gicv3 SGI api 2020-07-01 08:02:57 -04:00
audio zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
bluetooth bluetooth: uuid: add bond management uuids 2020-07-02 08:50:50 -04:00
canbus zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
cmsis_rtos_v1
cmsis_rtos_v2
console zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
crypto zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
data json: Add top-level array encoding support 2020-06-19 18:21:27 +02:00
debug
devicetree devicetree.h: pwms: Add DT_ macros for retrieving pwm period 2020-05-29 14:48:12 +02:00
dfu dfu: flash_img: Constify flash_img_buffered_write() data parameter 2020-06-10 09:30:08 +02:00
disk zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
display zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
drivers Bluetooth: Fix host RX thread deadlock 2020-07-06 11:15:39 +02:00
dt-bindings dts: bindings: Add bindings for Semtech SX126x 2020-07-02 08:32:37 -04:00
fs subsys/fs/nvs: Move write_block_size to flash_parameters 2020-06-22 14:35:03 +02:00
linker linker: add iterable section macros 2020-06-24 17:09:22 -04:00
logging sys: util: Deprecate GET_ARGS_LESS_1 macro 2020-06-22 15:18:07 +02:00
mgmt zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
net net: buf.h: Add static initialiser to net_buf_struct 2020-07-04 07:08:33 -04:00
posix lib: posix: nanosleep 2020-06-12 17:02:03 +02:00
power zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
random zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
settings
shell shell: refactor device_name_get implementation 2020-06-23 13:27:14 +02:00
stats zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
storage includes/storage/stream_flash: clarification on API usage 2020-06-13 11:57:35 +02:00
sys lib/os/heap: debugging facility to dump the heap structure to the cconsole 2020-06-26 11:41:43 -07:00
toolchain linker: add iterable section macros 2020-06-24 17:09:22 -04:00
tracing zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
usb zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
zephyr zephyr: Use deprecated instead of legacy for Kconfig int types 2020-06-09 06:49:56 -05:00
cache.h
device.h device: Fix structure documentation 2020-06-23 18:57:23 -04:00
devicetree.h zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
exc_handle.h
fatal.h
generated_dts_board.h
init.h device: Fix structure documentation 2020-06-23 18:57:23 -04:00
irq_nextlevel.h zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
irq_offload.h
irq.h zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
kernel_includes.h
kernel_structs.h kernel/timeout: Fix 32 bit rollover conditions 2020-06-18 13:21:06 +02:00
kernel_version.h zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
kernel.h kernel: k_poll: Clarify events parameter description 2020-06-30 13:47:24 -07:00
mempool_heap.h sys_heap: reduce the size of struct z_heap_bucket by half 2020-06-21 19:25:35 +02:00
mempool_sys.h zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
ptp_clock.h
sched_priq.h
shared_irq.h zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
spinlock.h
sw_isr_table.h zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
sys_clock.h api: Fix narrowing conversion C++ compilation warning in Z_TIMEOUT_TICKS 2020-06-30 12:21:41 -05:00
syscall_handler.h userspace: add z_is_in_user_syscall() 2020-06-03 22:33:32 +02:00
syscall.h
timeout_q.h zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
toolchain.h
wait_q.h
zephyr.h