drivers: nrf_rtc_timer: Remove unnecessary interrupt locking
There is no need to disable interrupts while just checking if a channel needs to be processed in the ISR, as that section does not contain anything that needs to be protected against overwriting from some other context. In particular, if a given timeout is changed or even aborted while its event is being checked, this will be correctly handled in the code that follows and that checks the expiration time. Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
This commit is contained in:
parent
eb0cbb433c
commit
3454a2547e
1 changed files with 4 additions and 11 deletions
|
@ -424,25 +424,18 @@ static void sys_clock_timeout_handler(int32_t chan,
|
||||||
|
|
||||||
static bool channel_processing_check_and_clear(int32_t chan)
|
static bool channel_processing_check_and_clear(int32_t chan)
|
||||||
{
|
{
|
||||||
bool result = false;
|
|
||||||
|
|
||||||
uint32_t mcu_critical_state = full_int_lock();
|
|
||||||
|
|
||||||
if (nrf_rtc_int_enable_check(RTC, RTC_CHANNEL_INT_MASK(chan))) {
|
if (nrf_rtc_int_enable_check(RTC, RTC_CHANNEL_INT_MASK(chan))) {
|
||||||
/* The processing of channel can be caused by CC match
|
/* The processing of channel can be caused by CC match
|
||||||
* or be forced.
|
* or be forced.
|
||||||
*/
|
*/
|
||||||
result = (atomic_and(&force_isr_mask, ~BIT(chan)) & BIT(chan)) ||
|
if ((atomic_and(&force_isr_mask, ~BIT(chan)) & BIT(chan)) ||
|
||||||
event_check(chan);
|
event_check(chan)) {
|
||||||
|
|
||||||
if (result) {
|
|
||||||
event_clear(chan);
|
event_clear(chan);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
full_int_unlock(mcu_critical_state);
|
return false;
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void process_channel(int32_t chan)
|
static void process_channel(int32_t chan)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue