Open beefdeadbeef opened 3 months ago
Hi!
Vints
are slow and so they are supposed to be used for low priority interrupts which get disabled in critical sections.
If your HW interrupt can fire during critical section then you must either lower interrupt priority or stop using vint
.
For faster virtual interrupts please consider using kblock->hpmap
and BGRT_CONFIG_LPFIC_HOOK
. In case of kblock->hpmap
atomics are used.
If you want to use vints anyway then you must know that:
bgrt_vint_push_isr
is not atomic.bgrt_vint_push_isr
for interrupts with different HW priorities then high priority interrupts must be masked/disabled before the bgrt_vint_push_isr
call and enabled after it.bgrt_vint_push
as it calls bgrt_vint_push_isr
in critical section with interrupts masked.That clears things a lot, thank you. Indeed, with these HW interrupt priorities set numerically bigger than BGRT_CONFIG_CRITSEC_PRIO and bgrt_vint_push() used i see no more such problems. Please feel free to close.
So, two vints:
regularly pushed into kernel vic from their BGRT_ISR() wrapped isrs
leads to failed assertion within seconds of run:
Sometimes it is one vint, sometimes another, as in these two, and happens only if both vints have same priority, iow, it is enough to set 0 & 1, or 1 & 2 as priorities to get rid of asserts. Is it necessary condition to have several vints served simultaneously or there's something else ?