Bluetooth: Call bt_recv from priority higher that TX thread.

A build assert in dummy.c lists the following requirement:
[...] receive thread priority shall be higher than the Bluetooth
Host's Tx and the Controller's receive thread priority.
This is required in order to dispatch Number of Completed Packets
event before any new data arrives on a connection to the Host threads.

The drivers uses a priority that is equal to the Host TX thread,
and since they don't use the CONFIG define that is only available
to the controller then this BUILD_ASSERT will not catch the
requirement.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
This commit is contained in:
Joakim Andersson 2020-08-19 17:16:01 +02:00 committed by Johan Hedberg
commit 9ac8dcf5a7
7 changed files with 14 additions and 17 deletions

View file

@ -61,13 +61,6 @@ config BT_CTLR_RX_PRIO_STACK_SIZE
int "High priority Rx thread stack size" if !SOC_COMPATIBLE_NRF
default 448
config BT_CTLR_RX_PRIO
# Hidden option for Controller's Co-Operative high priority Rx thread
# priority.
int
default 6
config BT_CTLR_SETTINGS
bool "Settings System"
depends on SETTINGS

View file

@ -501,7 +501,7 @@ static int hci_driver_open(void)
k_thread_create(&prio_recv_thread_data, prio_recv_thread_stack,
K_KERNEL_STACK_SIZEOF(prio_recv_thread_stack),
prio_recv_thread, NULL, NULL, NULL,
K_PRIO_COOP(CONFIG_BT_CTLR_RX_PRIO), 0, K_NO_WAIT);
K_PRIO_COOP(CONFIG_BT_DRIVER_RX_HIGH_PRIO), 0, K_NO_WAIT);
k_thread_name_set(&prio_recv_thread_data, "BT RX pri");
k_thread_create(&recv_thread_data, recv_thread_stack,