Threaded Interrupts

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

  1. Interrupt ID is enabled in Plic for CPU0
  2. Interrupt is claimed on CPU0
  3. Interrupts are disabled on all CPUs
  4. Top Handler runs on CPU0 and when it finishes , Interrupt is completed (eoi) with same ID on CPU0
  5. Bottom handler starts on another CPU , when it finishes Interrupt ID on CPU0 is enabled again
  6. Interrupts on same ID seem frozen

If I use only top half without thread :

Hard Irq Case

  1. Interrupts ID is enabled on CPU0
  2. 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,