Hi,
I’m trying to use several interrupt use models with external interrupts (kernel 5.12.1). When it came to threaded interrupt they are not re-enabled anymore after the first time kernel thread runs (I use the IRQF_ONESHOT flag). If I move all the code in Top Half no problem. Has anyone found same behavior?
I printed out the context in the hard irq ad in the thread : interrupt fires on CPU0 and within handler interrupts look disabled, the thread then runs on CPU1 in process context with interrupts enabled. On CPU0 they seem not re-enabled anymore.
Adding some debug print this is what it seems to happen :
Threaded case
- Interrupt ID is enabled in Plic for CPU0
- Interrupt is claimed on CPU0
- Interrupts are disabled on all CPUs
- Top Handler runs on CPU0 and when it finishes , Interrupt is completed (eoi) with same ID on CPU0
- Bottom handler starts on another CPU , when it finishes Interrupt ID on CPU0 is enabled again
- Interrupts on same ID seem frozen
If I use only top half without thread :
Hard Irq Case
- Interrupts ID is enabled on CPU0
- I can see continuous claim/complete of the interrupt ID on CPU0
Don’t see enabling/disabling in Plic
using softirq and workqueue is OK.
The difference I notice is that apparently only in the threaded case there is the disabling/enabling mechanism (I think it is correct ) and it is the only case when the specific Global Interrupt ID stops working,