0
int request_threaded_irq(unsigned int irq,
    irq_handler_t handler,
    irq_handler_t thread_fn,
    unsigned long irqflags,
    const char *devname,
    void *dev_id);

How can we the IRQ handler thread calling thread_fn again when it finishes, if there was another same IRQ generated and its hard IRQ handler calling handler was executed and returned IRQ_WAKE_THREAD?

In the above situation, IRQ_WAKE_THREAD for same IRQ can be ignored. This is problematic when the same IRQ generation and the end of hard IRQ handler for it returns IRQ_WAKE_THREAD during the IRQ handler thread is exiting. Then, the previous interrupt request will be ignored and cannot be processed by the handler until the same IRQ is generated again.

0andriy
  • 4,183
  • 1
  • 24
  • 37
  • Race conditions are handled by locks and doing operations in the proper order. We would need full details to say more. – stark Dec 14 '22 at 14:17
  • @stark I think I found another way. Would the above issue be solved if I use IRQF_ONESHOT? – hurryman2212 Dec 14 '22 at 20:23
  • Since you are keeping secret about your hardware (note, _x86_ has no direct relation to your question in the current form) it's hard to say what you are doing and trying to achieve. In some cases `IRQF_ONESHOT` is correct approach, in some it's just papering over the real issue. – 0andriy Dec 14 '22 at 22:38

0 Answers0