0

I'm reading about a tutorial on request_irq, I'm new to this topic so I need some idea checking:

  • When set, this flag instructs the kernel to disable all interrupts when executing this interrupt handler.
  • When unset, interrupt handlers run with all interrupts except their own enabled.

For the bold part, so in any way interrupt is executed in serial, i.e. one at a time?

0

FYI, the IRQF_DISABLED flag has been removed from linux kernel entirely, please refer this update.

The main two rationales that brought entire elimination to the flag was

  1. If multiple devices share a single physical interrupt line (because of hardware cost), it not only allows the interrupt it handles but also other interrupt signals that share the same physical interrupt line.
  2. Also, when the interrupt ensues while one interrupt is being processed, it may overrun the kernel stack because the current interrupt context should be saved onto the kernel stack to handle another interrupt.

Also, importantly, 99.999% of the kernel interrupt handler should finish as early as possible, and note that some deferring mechanism help. Therefore, having an IRQF_DISABLED flag depending on the interrupt's characteristics (whether it is fast or slow) is meaningless.

And to answer your question, it doesn't process the interrupts one by one when you unset IRQF_DISABLED flag because another interrupt can interrupt your interrupt handler execution; and that was the reason why overflow can occur when the flag is unset. Also, please refer to this article for further information

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.