Skip to content

Commit b8b946f

Browse files
cvinayaknashif
authored andcommitted
Bluetooth: controller: Fix rx_demux scheduling for LOW_LAT_ULL
Fix the mayfly callee id for the rx_demux scheduling under the LOW_LAT_ULL implementation. This could be causing undefined mayfly execution behavior in nRF51x SoC. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent a50b69d commit b8b946f

File tree

1 file changed

+17
-2
lines changed
  • subsys/bluetooth/controller/ll_sw

1 file changed

+17
-2
lines changed

subsys/bluetooth/controller/ll_sw/ull.c

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,9 @@ static inline void *mark_get(void *m);
323323
static inline void done_alloc(void);
324324
static inline void rx_alloc(uint8_t max);
325325
static void rx_demux(void *param);
326+
#if defined(CONFIG_BT_CTLR_LOW_LAT_ULL)
327+
static void rx_demux_yield(void);
328+
#endif /* CONFIG_BT_CTLR_LOW_LAT_ULL */
326329
#if defined(CONFIG_BT_CONN)
327330
static uint8_t tx_cmplt_get(uint16_t *handle, uint8_t *first, uint8_t last);
328331
static inline void rx_demux_conn_tx_ack(uint8_t ack_last, uint16_t handle,
@@ -1853,7 +1856,7 @@ static void rx_demux(void *param)
18531856

18541857
#if defined(CONFIG_BT_CTLR_LOW_LAT_ULL)
18551858
if (!nack) {
1856-
ull_rx_sched();
1859+
rx_demux_yield();
18571860
}
18581861
#else /* !CONFIG_BT_CTLR_LOW_LAT_ULL */
18591862
if (nack) {
@@ -1873,7 +1876,7 @@ static void rx_demux(void *param)
18731876
link, node_tx);
18741877

18751878
#if defined(CONFIG_BT_CTLR_LOW_LAT_ULL)
1876-
ull_rx_sched();
1879+
rx_demux_yield();
18771880
#endif /* CONFIG_BT_CTLR_LOW_LAT_ULL */
18781881

18791882
}
@@ -1885,6 +1888,18 @@ static void rx_demux(void *param)
18851888
#endif /* CONFIG_BT_CTLR_LOW_LAT_ULL */
18861889
}
18871890

1891+
#if defined(CONFIG_BT_CTLR_LOW_LAT_ULL)
1892+
static void rx_demux_yield(void)
1893+
{
1894+
static memq_link_t link;
1895+
static struct mayfly mfy = {0, 0, &link, NULL, rx_demux};
1896+
1897+
/* Kick the ULL (using the mayfly, tailchain it) */
1898+
mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_ULL_HIGH, 1,
1899+
&mfy);
1900+
}
1901+
#endif /* CONFIG_BT_CTLR_LOW_LAT_ULL */
1902+
18881903
#if defined(CONFIG_BT_CONN)
18891904
static uint8_t tx_cmplt_get(uint16_t *handle, uint8_t *first, uint8_t last)
18901905
{

0 commit comments

Comments
 (0)