Will Dyson on Tue, 13 Aug 2002 08:50:06 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] isr is called reentrantly!!


Fred K Ollinger wrote:

   if (megaCfg->host->irq == irq) {
        if (megaCfg->flag & IN_ISR) {
            TRACE (("ISR called reentrantly!!\n"));
            printk ("ISR called reentrantly!!\n");
        }
        megaCfg->flag |= IN_ISR;

However, I have no idea what this does. Does anyone have an idea?

It seems to me that whenever the interupt handler function (the function this fragment comes from) is running, it sets the IN_ISR flag in the megaCfg struct that was associated with the device at request_irq() time (ie driver setup). The flag is unset right before the interupt handler returns.


If the handler is called to handle an interupt and finds that the flag is already set, it knows that some cpu was still executing the handler because of a previous interrupt when the current interrupt was received and triggerd a new execution of the handler. It is not explicitly stated that this is an error (although the use of 2 exclamation points suggests it is not normal).

I originally thought this was probably an error (as I saw no locking to handle the condition), but then I noticed the comment at the top of megaraid.c, where it states:

 * Version 1.05
 *    Changed the queing implementation for handling SCBs and completed
 *      commands.
 *    Added spinlocks in the interrupt service routine to enable the
 *      driver function in the SMP environment.

I think that this might be a cause of a hang.

You should ask about this on the megaraid mailing list. http://domsch.com/linux/

At the very least, if this is not an error or very unusual condition, the driver should be quiet about it...

--
Will Dyson
"Back off man, I'm a scientist!" -Dr. Peter Venkman

_________________________________________________________________________
Philadelphia Linux Users Group        --       http://www.phillylinux.org
Announcements - http://lists.netisland.net/mailman/listinfo/plug-announce
General Discussion  --   http://lists.netisland.net/mailman/listinfo/plug