[1548] in SIPB_Linux_Development

home help back first fref pref prev next nref lref last post

Re: IRQ share w/ network and SCSI cards

daemon@ATHENA.MIT.EDU (Patrick McCormick)
Sat Dec 21 00:56:18 1996

To: Kyle W Ingols <kwi@MIT.EDU>
Cc: warlord@MIT.EDU, linux-dev@MIT.EDU
In-Reply-To: Your message of "Sat, 21 Dec 1996 00:13:08 EST."
             <199612210513.AAA14400@quicksilver.mit.edu> 
Date: Sat, 21 Dec 1996 00:56:57 EST
From: Patrick McCormick <pmccormi@MIT.EDU>


Kyle --

Thanks for sending along the info; if I find time I'll use your patch
and see if it works with my Millenia, and maybe we can make an alternative
boot disk to offer people with this problem. That last part is more
Derek's department, though.

I have a gut feeling that more than a few people coming back with 
brand-new Christmas systems may run into this problem.

--Pat

> I had a heck of a time getting Linux working with my computer, because
> the architecture of the machine (it's a Dell Optiplex GXpro) requires
> all PCI cards to share the same IRQ.
> 
> As a result, my Ethernet card (a 3C590-TPO) and my SCSI card (an
> Adaptec 2940UW rev.B) were sharing IRQ 15, and I was able to use
> either one or the other, but not both.
> 
> After about 20 hours of (non-continuous!) fiddling, I managed to find
> a solution by tweaking something inside the 3C59X.C driver.
> 
> As near as I can tell, when a driver calls for an interrupt, it can
> pass flags along to indicate what kind of interrupt it needs, and
> whether or not it is willing to share interrupts.  In this case, the
> aic7xxx.c driver (for the SCSI card) was passing SA_INTERRUPT and
> SA_SHIRQ, and the 3c59x.c driver was just passing SA_SHIRQ.
> 
> This apparently means both drivers were willing to share interrupts,
> but the drivers disagreed over which kind of interrupt they wanted.
> Poking around in irq.h revealed that sharing interrupts only works
> when the drivers involved agree to share, and only when they also
> agree on the type of interrupt to share.
> 
> The last note in my preamble is that the SA_INTERRUPT flag, according
> to Donald Becker (<becker@cesdis1.gsfc.nasa.gov>, the author of the
> 3C59X.C driver), causes other interrupts to be disabled during the
> running of the interrupt handler.  To me, that meant that having
> SA_INTERRUPT in a driver would not likely cause problems, but removing
> it from a driver that expects it would.
> 
> So, to solve my shared-irq problem, I added the SA_INTERRUPT flag to
> the request_irq call in the 3C59X.C driver.  That was all it took.
> (Incidentally, I'm using kernel 2.0.18 and the drivers which came with
> it, and I compiled both 3C59X.C and AIC7XXX.C into the kernel instead
> of as modules.)
> 
> When I sent this information to Mr. Becker, he suggested that it
> should be posted in case other people have run into this same
> problem.  He did caution, however, that doing this will cause a
> "slight decrease in interrupt handling latency, which isn't the right
> thing for most network cards."  He went on to explain what kind of
> problems that effect might produce:
> 
>   "The negative effect is that latency-sensitive interrupt source
>    might have problems e.g. the serial driver might lose characters
>    at high data rates while you are receiving large packets."
> 
> Still, for me, it is certainly better than nothing.
> 
> I must state at this point that I am no god, of Linux or anything
> else, and will probably not understand any highly technical comment on
> this.  I managed to stumble across it by being stubborn and having a
> specific problem I needed to fix.  I posted this because checking
> those flags might help solve shared-irq problems with other PCI-based
> drivers, not just 3C59X.C.
> 
> If you have any comments about this post that need to go to me
> personally for some reason, feel free to send them.  Just be
> forewarned that I am, as I said, somewhat clueless.
 > 
> (snip)
> 
> -=-=-
> 
> From: Kevin Fenzi <kevin@scrye.com>
> Newsgroups: comp.os.linux.hardware
> Subject: Re: Sharing interupts?
> Date: 16 Dec 1996 21:34:11 -0700
> 
> "Kai" == Kai Harrekilde-Petersen <khp@dolphinics.no> writes:
> "jens" == jens.hansson@mailbox.swipnet.se (Jens Hansson) writes:
> "kevin" == In article <m2zpzi84ur.fsf@scrye.com>, kevin@scrye.com says...  
> 
> kevin> Is there a way to share IRQ's in linux? Can I put (for example) a
> kevin> scsi card and an ethernet card on the same IRQ? I have been told
> kevin> you can share in DOS, can you in linux?  ...  
> 
> jens>> You cannot share
> jens>> interrupts in a PC at all! This has nothing to do with Linux.
> 
> Kai> Wrong! -- thank you for playing.
> 
> Kai> On PCI you certainly *can* share interrupts (since they are
> Kai> active low, level sensitive.
> 
> Kai> Now, if only all the PCI drivers supported shared irq's.
> 
> To follow up on my own question, I got a number of helpfull answers.
> From them, and looking at the kernel source, I conclude:
> 
> You can share interupts under linux, but only on PCI card, where the
> driver supports irq_sharing. 
> 
> You can never share on (E)ISA cards. 
> 
> From poking around with dejanews (www.dejanews.com), I found an
> article by Kyle W Ingols <kwi@mit.edu> that said:
>  (snip -- I listed it above)
> 
> So, in order to share an irq the driver(s) you are using need to have
> both the SA_INTERRUPT and the SA_SHIRQ flags set in the request_irq
> call. 
> 
> In the 2.0.27 kernel that I have only the following drivers have that
> enabled: 
> 
> ./drivers/net/de4x5.c
> ./drivers/net/tulip.c
> ./drivers/net/3c59x.c
> ./drivers/net/defxx.c
> ./drivers/char/serial.c
> ./drivers/scsi/aic7xxx.c
> ./drivers/scsi/eata_dma.c
> ./drivers/scsi/advansys.c
> ./drivers/scsi/BusLogic.c
> ./drivers/scsi/ncr53c8xx.c
> 
> So, unless you are sharing two of these, you will have to make kernel
> mods. I managed to avoid having to do this, as I found out that since
> I am using a polling lpd for my printer, I can stick something else on
> irq7, and it works great. 
> 
> thanks for everyone's responses, and let me know if you have any
> further questions...
> 
> kevin
> -- 
> Kevin Fenzi           |  Alternative Collegiate |acca@acca.nmsu.edu
> kevin@scrye.com       |  Computing Association  |pgp2.6.2 key by request
> WWW -> http://scrye.com/~kevin/
>                  kfenzi@uswest.com
> 		          bob@acca.nmsu.edu
> 
> -=-=-
> 
> Hope this is helpful.  I am by no means a Linux god, so I probably can't
> tell you anything more than this...
> 
> ~Kyle Ingols





home help back first fref pref prev next nref lref last post