[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-arm-kernel
Subject:    Re: race condition in do_IRQ
From:       Marc Singer <elf () buici ! com>
Date:       2004-05-06 16:03:11
Message-ID: 20040506160311.GA8969 () buici ! com
[Download RAW message or body]

On Thu, May 06, 2004 at 11:56:38AM +0200, Marius Groeger wrote:
> Robin,
> 
> On Thu, 6 May 2004, Robin Farine wrote:
> 
> > I may be wrong but here is how I understand it. This part of the code
> > runs with the irq_controller_lock held and interrupts globally disabled.
> > For the duration of each interrupt handler, the common interrupt
> > handling code releases the lock (and enables interrupt iff the handler
> > has not specified the SA_INTERRUPT flag). Thus, this code respects
> > atomicity with respect to nested interrupts and SMP.
> >
> > While a handler is executing with interrupts enabled, a new interrupt
> > routed to the same vector may occur. The running flag prevents nested
> > executions of the associated handler.
> 
> Thank you and Matthias for clearing this up. May I humbly suggest to
> insert some text along these lines as comment?

While it might look like a good idea to insert such a comment, it can
introduce it's own problems.  1) Comments let people off of the hook
from reading the code.  2) They may be wrong which leads to confusion
and some people misunderstanding the code since they read the
incorrect comments instead of the code.  

We're all better off reading the code than reading comments.  Really.


-------------------------------------------------------------------
Subscription options: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
FAQ:       http://www.arm.linux.org.uk/armlinux/mlfaq.php
Etiquette: http://www.arm.linux.org.uk/armlinux/mletiquette.php
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic