Click to See Complete Forum and Search --> : IRQ Sharing
nipper
09-24-2003, 09:17 AM
Hi-
I don't have much hardware/IRQ experience, and I've come across something that doesn't seem to make sense. It seems as though I have several devices sharing the same IRQ (5). Is this normal?
I read in other posts about this being the result of PnP being enabled in the BIOS -- I made sure this was turned off, and they're still sharing the same IRQ. Is this normal, or is it a problem?
See output below -- there seems to be 5 devices sharing IRQ5:
IRQ's need to be shared as there are a limited amount available for the hardware devices that require a irq.
As long as 2 or more devices sharing a IRQ are not ones that are heavily utilized, you should be ok.
BTW... Windows does the same.
If you are not using any serial devices, disable either or both serial ports (IRQ 3 & 4) in the bios to free up a couple more IRQ's for other devices to use. The same can be done with the printer port (IRQ-7) if you don't have a printer.
banzaikai
09-26-2003, 07:05 AM
Howdy.
For the most part, mdwatts is right on the money (as always). Since I know his time is limited, I'll go a step further...
IRQ sharing is a neccessity. You've only got 16 IRQs (0-15), and many more devices than that can be plugged into the box. Obviously, someone's gonna havta share. Don't worry, the BIOS and OS know how to work with all this traffic. The real problem stems with the actual working of the "Plug and Play (PnP)" method used by Windows. What happens is that the WinOS can, and will, re-assign the IRQs and I/O ports of the hardware on the fly, per the user's settings. Normally, if you have all the devices set to use automatic settings, you'll never notice. Set just one little thing to "Manual", and all bets are off, since WinOS will start playing around with the settings for you.
Linux, on the other hand, "don't play dat". If the BIOS says there's a port at 0x378/IRQ7, then there better darn well be something there, or Linux is gonna throw a hissy fit. This is why you turn off PnP in the BIOS. Essentially, this tells the BIOS -not- to let the OS change anything from where the BIOS set it, so things stay where they're told to stay.
Now, another look at your post shows that there may actually be only 3 or 4 devices using IRQ5:
The "XT-PIC" stands for "XT compatible Programmable Interrupt Controller", and is the chip reading the IRQs, so this one doesn't count. The "SIS7012" is your on-board Audio, and counts as #1. The "ETH0" is your ethernet, and counts as #2. It's the two "usb-ohci" and one "ehci-hcd" that I'm not too sure about, as the usb-ohci (usb1.1) and ehci-hcd (usb2.0) could be ports all located on the one usb controller chip. This means it could be seen as one chip/three devices or three devices and one IRQ. My bet's on the former.
I'd also take mdwatts' advice on disabling anything not being used, but when I see that there is no IRQ3,4, and 10 being used, I'm wondering if this'll really solve things. On my box, I've got my second serial port (com2-ttyS1/irq3) and second IDE controller (0x170/irq15) disabled, thinking that my scsi card would pop up to irq15. Well, my video card is sitting at irq15, my scsi is at irq10, and my usb and ethernet card use irq11. NONE of my cards have popped in at irq3, and it's still listed as free. Go figure. So far, though, both usb and eth0 run just fine together.
Hope this gives you some ideas....
banzai "one IRQed guy" kai
Satanic Atheist
09-26-2003, 07:35 AM
IRQ sharing seems to be a recent concept, and doesn't really make a lot of sense since older machines complained like hell when two devices used the same Interrupt ReQuest.
I don't understand how Linux controls the IRQs since once the BIOS has begun loading Linux, it doesn't seem to have any more effect (it's as though Linux inplements it's own software based BIOS which allows for interesting boot configurations and hardware).
Normally, using PCI cards only will not cause any problems since they'll dynamically reconfigure themselves to "fit in". Using an old ISA card is likely to cause you problems though.
Also be aware that cards can only reconfigure themselves in certain ways, and if you have a problem with a machine not booting (or even getting to the POST) you could try shuffling the cards around in the slots. I know that my SCSI card will only work in one slot whilst everything else works anywhere. If I put that card elsewhere then the whole machine locks solid.
If you don't have a problem with your machine (i.e. it's stable) then don't worry about it. Hopefully, though, we can soon start to see 32-bit interrupts appearing or even more and then all this nonsense will be a thing of the past.
James
banzaikai
09-26-2003, 08:15 AM
How old are you, Satanic Atheist?
On the original PC, there were only eight IRQs, so saying that IRQ sharing is a new concept isn't true. After all, every tech knows that:
COM1/3 (ttyS0/2) = IRQ4
COM2/4 (ttyS1/3) = IRQ3
Now, if you meant that sharing them -at the same time- was new, then you're right. And all of it has to do with "Enumeration". If you've played around with the Windows 95 and later versions of device manager, then you've seen the many "PCI Enumerators" in there. Essentially, it assigns an ID number to each device sharing an IRQ, so it can tell them apart (e.g., IRQ10 - #1 = Sound, IRQ10 - #2 = Ethernet, etc.). In fact, you won't see any enumerators for devices which don't share an IRQ, because it's not needed.
Linux doesn't control the IRQs after booting, but the method of it's scanning for devices may have something to do with why the PnP sometimes screws up. My Athlon box was running just fine with PnP turned on, and after I turned it off, everything was right where it should have been. My Intel box was another matter. Linux gave me hissies until PnP was disabled. In either case, the Win98SE side didn't give a rat's behind about PnP...
Everything else you state is spot-on. Some manufacturers set their cards to jump to certain locations, and if they can't set to something that isn't being used already, well....
32-bit IRQs aren't the answer, as USB/FireWire is helping to solve all that. One needs look only to Motorola's CPU design to see how it should be done. Only three IRQ lines on the CPU, giving just eight possible priorities. So how do they get by the sharing problem? Polling. And you wonder why we Amiga, Atari, and MacClassic folks are laughing ourselves silly.
banzai "whahahahahaha" kai
:D
nipper
09-26-2003, 10:23 AM
Thanks all! You all provided alot of info I couldn't find in a book!!!
-Nipper
Satanic Atheist
09-26-2003, 10:44 AM
How old are you, Satanic Atheist?
Too damn old if you ask me!
I remember my first computer. The BBC Model B. Ah, those were the days. Even with it's state-of-the-art multi-purpose RS232 port (still the standard some 20 years on).
The first PC I had only had one Parallel and one COM port so IRQ sharing wasn't possible (nothing to share it with) and wasn't desirable either. You generally didn't have a snowflake's hope in hell of upgrading that baby!
Then things moved on, and although you're quite right about sharing COM1 and COM3 and COM2 and COM4 (and, incidentally, COM5 with COM7 and COM6 with COM8), the COM ports are not used for much more than old modems, serial mice and professional uses between hardware. All thanks to the trusty RS232 standard!
I'd just forgotten about the IRQs on those...
James
nipper
09-26-2003, 11:39 AM
So, I guess my question is, should I try and make use of the "empty" IRQs, or doesn't it matter?
For example, my eth0, audio and USB ports are all using IRQ5, since these are all used quite frequently, should they be assigned to other IRQs?
banzaikai
09-27-2003, 07:50 AM
Oh, that's right - someone asked a question...
You really don't have to worry too much about IRQ sharing nowadays. Again, with the Enumeration, the OS can keep track of what device(s) need service. The only thing that may affect you is if two of the devices don't "play well" with each other. Other than that, speed is the remaining issue, but with speeds in the GHz ranges, this isn't much of a problem. Besides, the BIOS will assign a card/device to a specific IRQ-I/O slot, and there's not much you can do about it. It's up to the card's manufacturer to allow it to use the IRQs "below" 9. I've found that most PCI devices like to stay above this, since most legacy ISA cards use the lower IRQs.
Warning: More old-school background info coming!
<oldschool>
In the really old days of CPU design, they had to have some way of stopping, pausing, and interrupting the CPU for various reasons (slow devices, slow memory, debugging, etc.). So, they came up with different ways of doing this. The common /HALT (or /STOP) will do just that. They threw in the /NMI (Non-Maskable Interrupt) as a "really urgent request" to the CPU. Which leads us to the standard /IRQ (Interrupt ReQuest). On early 8-bitters, there was only one IRQ line. The CPU would see the IRQ, then jump to the IRQ subroutine in ROM, and "poll" the devices until the one that generated the IRQ was found, and then run the service routine to handle it.
As you may have guessed, this takes quite a bit of time, cpu-wise. So, the folks at Intel decided to make a chip to handle nothing but IRQs. They came up with the i82C59 PIC, which would monitor eight different IRQ lines (assigned a priority of 0=highest, 7=lowest), and then flag the cpu that the device at IRQ-so-and-so needs attention. Speeded things up considerably. Unfortuntely, the design of the PC followed the TV show, "Eight is enough" - and we all know how silly an idea that was...
So, they simply added another 8259 and "cascaded" it to the first 8259 (IRQ9 on the second to IRQ2 on the first), and doubled the IRQs to 16. That still isn't enough, but by then they figured out what the folks at Motorola had already known: combine the two.
On the 680x0 cpus, they have IRQ priority AND polling. The three IRQ lines assign the priority of the IRQ, and the cpu then polls the devices on just that priority level until the culprit is found. This allows flexibility, because you can add all the devices you want, it just adds another IRQ vector into the list.
So, the PCI standard adopted the "Enumeration", which is a fancy way of saying, "We can now poll all the devices on any IRQ". A big yawn was heard from Motorola...
</oldschool>
You're right, nipper, maybe Satanic Atheist and I should write a book... Maybe a NHF or two?
banzai "too many people /IRQing me - gotta /HALT" kai
Satanic Atheist
09-27-2003, 08:03 AM
Oh my, your knowledge is impressive. Gotta hand it to you.
I never knew too much about the chips on the MoBo, just how to put a machine together worked for me.
As for the NHF, well, I would do it, and there is a thread on /dev/random about doing something similar for Slackware, but I'm only here another 84 days!
Thanks for the info, I'll re-read it. Nothing bad ever came from learning!
James
banzaikai
09-28-2003, 05:41 AM
Well,
Like you, I got my start back in the Commodore PET/ TRS-80 days. I was fortunate enough to know the manager of the local Radio Shack when the first TRS-80 Model I came in :D
After that, I got to run the computer lab at my high school (my Aunt happened to be in charge), which had PETs. So, I gravitated towards the 65xx CPUs. I like the 80xx and Z-80 instruction sets, but there's something about the sheer elegance of the 65xx/68xx chips that made me stay with them - into the 680x0 (Amiga!)
So, I've been playing, building, and upgrading since about 1977. I've actually sat in front of darn near every computer that came out for the consumer market, and a couple of the commercial ones.
After Commodore went bust, I shuddered at the thought of having to pray to the almighty Bill Gates - until I found Linux, which, believe it or not, can run on an Amiga (Debian 2.2 kernel was the last supported, IIRC).
I've also been dying to get a t-shirt that says, "Thank God I'm an Atheist" :D
banzai "dare to be different" kai
Satanic Atheist
09-28-2003, 08:47 PM
Git.
James
justlinux.com
Copyright 2007 Jupitermedia Corporation All Rights Reserved.