All of lore.kernel.org
 help / color / mirror / Atom feed
* Can interrupt be missed between interrupt disable/enable window?
@ 2016-03-21  7:11 Vishwas Srivastava
  2016-03-21  8:14 ` Chetan Nanda
  2016-03-21  9:11 ` Crazyiop
  0 siblings, 2 replies; 3+ messages in thread
From: Vishwas Srivastava @ 2016-03-21  7:11 UTC (permalink / raw)
  To: kernelnewbies

Kernel code heavily uses the spinlock primitives
spin_lock_irqsave/restore plus local interrupt disabling/ enabling, all
across the code.
Is there a possibility that the interrupts might get
missed in this small window

disable interrupts
.............
.............                        <<<<<<<<<<<----------------------
interrupts is trigerred here

enable interrupts


specially when the irq
affinity has been set to the same core on which the
above mentioned code (disabling / enabling the irq's)
runs?
How the linux deals with this kind of scenario?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20160321/7c643276/attachment.html 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Can interrupt be missed between interrupt disable/enable window?
  2016-03-21  7:11 Can interrupt be missed between interrupt disable/enable window? Vishwas Srivastava
@ 2016-03-21  8:14 ` Chetan Nanda
  2016-03-21  9:11 ` Crazyiop
  1 sibling, 0 replies; 3+ messages in thread
From: Chetan Nanda @ 2016-03-21  8:14 UTC (permalink / raw)
  To: kernelnewbies

On Mon, Mar 21, 2016 at 12:41 PM, Vishwas Srivastava
<vishu.kernel@gmail.com> wrote:
> Kernel code heavily uses the spinlock primitives
> spin_lock_irqsave/restore plus local interrupt disabling/ enabling, all
> across the code.
> Is there a possibility that the interrupts might get
> missed in this small window
>
> disable interrupts
> .............
> .............                        <<<<<<<<<<<----------------------
> interrupts is trigerred here
>
> enable interrupts
>

As per my understanding, During disable period interrupt delivery to a
local core is disabled.
So, when interrupts are enabled (for that core) again then interrupt
will be delivered to that core .So no interrupt missed.

But if there are multiple interrupt from same source during the
disabled period then core will be interrupted once after interrupts
enabled again, i.e. all interrupt except one are missed by core,

Thanks,
Chetan Nanda

>
> specially when the irq
> affinity has been set to the same core on which the
> above mentioned code (disabling / enabling the irq's)
> runs?
> How the linux deals with this kind of scenario?
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Can interrupt be missed between interrupt disable/enable window?
  2016-03-21  7:11 Can interrupt be missed between interrupt disable/enable window? Vishwas Srivastava
  2016-03-21  8:14 ` Chetan Nanda
@ 2016-03-21  9:11 ` Crazyiop
  1 sibling, 0 replies; 3+ messages in thread
From: Crazyiop @ 2016-03-21  9:11 UTC (permalink / raw)
  To: kernelnewbies

Hi,

When interrupt are globally disabled, interrupt are still detected and their flag set by their specific hardware circuit. It's only their immediat processing that are disabled. 

After reenabling interrupt, they will be treated right away, as their flag are still set. it would looks like the interrupt trigger Just happened. 

An interrupt miss is a problem if an interrupt is triggered a second time before the first one has been treated. That's When information is lost. 

This is impossible in some case and harmless in other. 

For the rest, the driver know something happens, but canot be sur of the number of triggers. As the interrupt are not lost, the driver's interrupt function is still called and has an opportunity to check it out, and act accordingly.

++


Le 21 mars 2016 08:11:54 GMT+01:00, Vishwas Srivastava <vishu.kernel@gmail.com> a ?crit :
>Kernel code heavily uses the spinlock primitives
>spin_lock_irqsave/restore plus local interrupt disabling/ enabling, all
>across the code.
>Is there a possibility that the interrupts might get
>missed in this small window
>
>disable interrupts
>.............
>.............                        <<<<<<<<<<<----------------------
>interrupts is trigerred here
>
>enable interrupts
>
>
>specially when the irq
>affinity has been set to the same core on which the
>above mentioned code (disabling / enabling the irq's)
>runs?
>How the linux deals with this kind of scenario?
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Kernelnewbies mailing list
>Kernelnewbies at kernelnewbies.org
>http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20160321/f44c69f2/attachment.html 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-03-21  9:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-21  7:11 Can interrupt be missed between interrupt disable/enable window? Vishwas Srivastava
2016-03-21  8:14 ` Chetan Nanda
2016-03-21  9:11 ` Crazyiop

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.