pru: Fix race condition in clearing of irq flags
Each irq flag must only be cleared after it has been serviced. This fixes a race condition that could cause incoming commands to be delayed for extended period. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
91b9634198
commit
121c747cc8
|
@ -80,14 +80,16 @@ static void
|
|||
_irq_poll(void)
|
||||
{
|
||||
uint32_t secr0 = CT_INTC.SECR0;
|
||||
if (secr0 & (1 << KICK_PRU1_EVENT))
|
||||
if (secr0 & (1 << KICK_PRU1_EVENT)) {
|
||||
CT_INTC.SECR0 = 1 << KICK_PRU1_EVENT;
|
||||
sched_wake_tasks();
|
||||
}
|
||||
if (secr0 & (1 << IEP_EVENT)) {
|
||||
CT_IEP.TMR_CMP_STS = 0xff;
|
||||
uint32_t next = timer_dispatch_many();
|
||||
timer_set(next);
|
||||
CT_INTC.SECR0 = 1 << IEP_EVENT;
|
||||
}
|
||||
CT_INTC.SECR0 = (1 << IEP_EVENT) | (1 << KICK_PRU1_EVENT);
|
||||
}
|
||||
void __attribute__((optimize("O2")))
|
||||
irq_poll(void)
|
||||
|
|
Loading…
Reference in New Issue