Skip to content

Commit 770a1e7

Browse files
committed
Bluetooth: Controller: Fix PDU length in case of ISR latency issue
In case of ISR latencies, if packet pointer has not been set on time then we do not want to check uninitialized length in rx buffer that did not get used by Radio DMA. This would help us in detecting radio ready event being set? We can not detect radio ready if it happens twice before Radio ISR executes after latency. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent 6e6d92f commit 770a1e7

File tree

1 file changed

+12
-2
lines changed
  • subsys/bluetooth/controller/ll_sw/nordic/lll

1 file changed

+12
-2
lines changed

subsys/bluetooth/controller/ll_sw/nordic/lll/lll_conn.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -658,13 +658,23 @@ void lll_conn_isr_tx(void *param)
658658

659659
void lll_conn_rx_pkt_set(struct lll_conn *lll)
660660
{
661+
struct pdu_data *pdu_data_rx;
661662
struct node_rx_pdu *node_rx;
662663
uint16_t max_rx_octets;
663664
uint8_t phy;
664665

665666
node_rx = ull_pdu_rx_alloc_peek(1);
666667
LL_ASSERT(node_rx);
667668

669+
/* In case of ISR latencies, if packet pointer has not been set on time
670+
* then we do not want to check uninitialized length in rx buffer that
671+
* did not get used by Radio DMA. This would help us in detecting radio
672+
* ready event being set? We can not detect radio ready if it happens
673+
* twice before Radio ISR executes after latency.
674+
*/
675+
pdu_data_rx = (void *)node_rx->pdu;
676+
pdu_data_rx->len = 0U;
677+
668678
#if defined(CONFIG_BT_CTLR_DATA_LENGTH)
669679
#ifdef CONFIG_BT_LL_SW_LLCP_LEGACY
670680
max_rx_octets = lll->max_rx_octets;
@@ -705,15 +715,15 @@ void lll_conn_rx_pkt_set(struct lll_conn *lll)
705715
#error "Undefined HAL_RADIO_PDU_LEN_MAX."
706716
#else
707717
radio_pkt_rx_set(radio_ccm_rx_pkt_set(&lll->ccm_rx, phy,
708-
node_rx->pdu));
718+
pdu_data_rx));
709719
#endif
710720
#endif /* CONFIG_BT_CTLR_LE_ENC */
711721
} else {
712722
radio_pkt_configure(RADIO_PKT_CONF_LENGTH_8BIT, max_rx_octets,
713723
RADIO_PKT_CONF_FLAGS(RADIO_PKT_CONF_PDU_TYPE_DC, phy,
714724
RADIO_PKT_CONF_CTE_DISABLED));
715725

716-
radio_pkt_rx_set(node_rx->pdu);
726+
radio_pkt_rx_set(pdu_data_rx);
717727
}
718728
}
719729

0 commit comments

Comments
 (0)