Skip to content

Commit

Permalink
Bluetooth: controller: split: Fix radio in use during flash op
Browse files Browse the repository at this point in the history
Fix a race condition in radio abort requested by flash
driver. It is possible that during abort function execution,
PPI setup to start radio fires. Hence, check explicitly in
cleanup function for radio being in use and disable it.

Fixes zephyrproject-rtos#22945.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
  • Loading branch information
cvinayak committed Feb 19, 2020
1 parent 6baff1b commit 2d267b9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv.c
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,10 @@ static void isr_cleanup(void *param)
int err;

radio_isr_set(isr_race, param);
if (!radio_is_idle()) {
radio_disable();
}

radio_tmr_stop();

err = lll_clk_off();
Expand Down
4 changes: 4 additions & 0 deletions subsys/bluetooth/controller/ll_sw/nordic/lll/lll_conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,10 @@ static void isr_cleanup(void *param)
int err;

radio_isr_set(isr_race, param);
if (!radio_is_idle()) {
radio_disable();
}

radio_tmr_stop();

err = lll_clk_off();
Expand Down
4 changes: 4 additions & 0 deletions subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,10 @@ static void isr_cleanup(void *param)
#endif /* !CONFIG_BT_CTLR_SCAN_INDICATION */

radio_isr_set(isr_race, param);
if (!radio_is_idle()) {
radio_disable();
}

radio_tmr_stop();

err = lll_clk_off();
Expand Down

0 comments on commit 2d267b9

Please sign in to comment.