0

In <<understanding Linux kernel>>, it mentions that while interrupt handler is running, the corresponding IRQ line are temporarily ignored. So I want to know why IRQ line need to be ignored, what to be protected? Thanks.

in other words, why "there should be no occurrence of an interrupt until the corresponding interrupt handler has terminated".

Muqali He
  • 43
  • 5

1 Answers1

1

If it's a level triggered interrupt, it got to be ignored at least until its source has been cleared by the handler, otherwise the interrupt would occur repeatedly until the stack overflows. And regardless of level or edge triggering, it usually does no good to re-enter a specific interrupt handler while it still processes the interrupt; the actual interrupt routine (top half) should be quite short anyway. See also Top halves and bottom halves concept clarification.

Armali
  • 18,255
  • 14
  • 57
  • 171
  • Thanks for your answer, Let me add my questions. For example, in x86 with 8259A. When a device(named A) raise a IRQ, PIC will send a signal to CPU, then CPU acknowledge it and execute handler. but when executing this handler, why the same interrupt will be masked by 8259A(PIC)? – Muqali He Nov 03 '21 at 01:13
  • 1
    Oh, thank u very much. I understand the impact of "level/edge triggered". – Muqali He Nov 03 '21 at 02:07
  • 1
    Suppose a slow interrupt handler which processes characters incoming from a serial line. If, while processing a char, an interrupt was triggered again, the characters could lose the original/correct sequence, disrupting the communication. – linuxfan says Reinstate Monica Nov 03 '21 at 06:44