lkml.org 
[lkml]   [1999]   [Sep]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch] SA_INTERRUPT broken for SA_SHIRQ (fwd)
This patch got not merged yet. Why? It's obviously right and necessary to
make SA_INTERRUPT safe w.r.t. SA_SHIRQ.

I am worried some weird lockup may happens due a irq handler running with
irq enabled even if the irq handler is been registered with the
SA_INTERRUPT flag.

Andrea

---------- Forwarded message ----------
Date: Mon, 23 Aug 1999 21:35:34 +0200 (CEST)
From: Andrea Arcangeli <andrea@suse.de>
To: Linus Torvalds <torvalds@transmeta.com>, Alan Cox <alan@redhat.com>
Cc: linux-kernel@vger.rutgers.edu
Subject: [patch] SA_INTERRUPT broken for SA_SHIRQ

It seems to me that the SA_INTERRUPT is looked only for the first shared
irq registered. This is bad IMO since other shared irq may depend on the
SA_INTERRUPT setting (they may avoid a __cli() because they assume they
are just running with irq disabled since they registered the irq handler
specifying the SA_INTERRUPT flag).

Also the irq handler may be called with irq disbled but it could return
with irq enabled or the reverse.

Patch follows against 2.2.12-final3 or 2.3.15-pre2:

--- 2.2.10/arch/i386/kernel/irq.c Tue Jul 13 00:33:09 1999
+++ /tmp/irq.c Tue Aug 3 19:26:23 1999
@@ -726,10 +726,11 @@

status = 1; /* Force the "do bottom halves" bit */

- if (!(action->flags & SA_INTERRUPT))
- __sti();
-
do {
+ if (!(action->flags & SA_INTERRUPT))
+ __sti();
+ else
+ __cli();
status |= action->flags;
action->handler(irq, action->dev_id, regs);
action = action->next;
I noticed this by reading some strange webpage about irq conficts here
http://cesdis.gsfc.nasa.gov/linux/drivers/eepro100.html . I don't know if
my patch is enough to fix the problem but it looks ok to me.

The exact words in the html doc (to avoid you having to browse it) are:

---------------------------------------------------------------------
The EEPro100 board always uses the same IRQ as an Adaptec 2940
The preferred solution is to put each device on its own IRQ line. But some
motherboards, notably the Intel PR440FX, don't permit this. To use
both at the same time requires a slight modification of the 2940 driver:
remove the SA_INTERRUPT flag to the request_irq() call. This is
required whenever the 2940 driver must share an IRQ with any other device.
---------------------------------------------------------------------
Hmm this seems strange. In general shared irqs shouldn't make any
difference in respect of the SA_INTERRUPT flag. Shared irqs and the
SA_INTERRUPT flag _are_ (or better should be) ortogonal issues. So it
looks to me that changing the 2940 is a band-aid and that the right
(untested) fix is my one.
Andrea



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:54    [W:0.041 / U:0.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site