<div dir="ltr"><div><div><div><div>Hi,<br><br></div><div>I'll give a try on this one,
I've just getting interested in the kernel, but have a very good
knowledge of microcontroller and think I can enlighten you with some
hardware explanation on that :<br><br></div><div>when an interrupt occur
and is enabled, a flag is set at the hardware level in some interrupt
flag register. (this register is set to 1 by hardware only, the software
may only clear it to 0 to acknowledge the interrupt has been treated.
It may be automatically cleared when the interrupt handler launch the
appropriate function call.)<br></div><div><br>The "mask" in your bold
citation is another register, the interrupt mask register. It allow to
control temporarily the execution of particular interrupt on a case by
case basis. thus letting other interrupt occurs while preventing a
particular one. (this register is set by software, you can think of it
as an "interrupt handler inhibitor register" )<br><br></div><div>Those 2
register are wired into a bitwise AND before the signal arrived in the
interrupt handler. the interrupt handler launch the appropriate function
call corresponding to an interrupt signal received.<br><br></div><div>So
because of the AND logic, if the interrupt mask bit is 0 for a specific
interrupt, the interrupt handler will see no positive edge whatever the
interrupt occurred. <br></div><div>BUT If the interrupt occurred, the
interrupt flag will still be set to 1, and not loose the information of
an interrupt occurred.<br><br></div><div>If you set back the mask to 1, 1
AND 1 =1 the signal will then propagate to the interrupt handler and
the function call will be launch right away !<br><br><br></div><div>wikipedia on <a href="https://en.wikipedia.org/wiki/Mask_%28computing%29" target="_blank">Mask</a>.
<br>What may be confuse here is that the bitwise operation can be executed
completely by the hardware (instant reactivity), so you are dealing with
mask without seeing interrupt_flag ^ interrupt_mask anywhere in the
code.<br><br></div><div>Hope that help. <br><br><br></div><div>Jonathan</div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-02-24 13:14 GMT+01:00 priyaranjan <span dir="ltr"><<a href="mailto:priyaranjan45678@gmail.com" target="_blank">priyaranjan45678@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(34,36,38);font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:15.6px">When an Interrupt occurs most device drivers creates a critical section using spin_lock_irqsave or spin_lock_irq which disables the interrupt.</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(34,36,38);font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:15.6px">In such a case the Interrupts are disabled by the IRQ handler. My question is whether Linux kernel disables any interrupts just when the IRQ handler executes or it just wait for the IRQ handler programmer to disable the IRQ in whatever way?</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(34,36,38);font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:15.6px">My understanding is that Russel King has implemented IRQ_DISABLED, If this flag is set then only the IRQ that has occurred is disabled lately however enabled automatically by Kernel after IRQ handler finishes. Is that correct? This also happens in delayed manner.Can anyone explain me how exactly the IRQ disabling is delayed?</p><p style="margin:0px 0px 1em;padding:0px;border:0px;clear:both">From free-electrons <a href="http://free-electrons.com/kerneldoc/latest/DocBook/genericirq/Highlevel_IRQ_flow_handlers.html" target="_blank">link </a>, what I read is :- </p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(34,36,38);font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:15.6px"><span style="color:rgb(0,0,0);font-family:'Times New Roman';font-size:medium;line-height:normal"><b>The interrupt is kept enabled and is masked in the flow handler when an interrupt event happens</b>. This prevents losing edge interrupts on hardware which does not store an edge interrupt event while the interrupt is disabled at the hardware level.</span></p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(34,36,38);font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:15.6px"><span style="color:rgb(0,0,0);font-family:'Times New Roman';font-size:medium;line-height:normal">Can anyone please explain the bold line here?</span><br></p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(34,36,38);font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:15.6px">Regards,</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(34,36,38);font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:15.6px">Priyaranjan</p></div>
<br>_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" rel="noreferrer" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
<br></blockquote></div><br></div>