ParallelPortIRQ7

Parallel port interupt collisions

Bugzilla has a couple of reports of loading the parallel port driver (parport_pc) killing wifi or anything else using the same IRQ:

Executive Summary: Buggy BIOS adds IRQ7 to the pool of PCI interrupts. Hopefully can work-around in software; or get user to reboot and force the BIOS not to assign IRQ7 to any PCI slot.

Routeing

As I understand it:

PCI Card INTA/B/C/D -> PCI Interrupt Router \ 
                                             --> {IRQs} -> APIC -> CPU
    Legacy ISA devices (serial/parallel...) / 

PCI devices and Legacy ISA cannot share IRQs

(Over-simplification); This is actually down to the different ways interrupts are triggered. Diagram: (As I understand it)

          +---+
ISA IRQ   |   |     (Edge/change trigger)
----------+   +--------------------------

          +------------------------------
PCI INTA  |      (Level/positive trigger)
----------+

If more than one device needs servicing (in level mode), the IRQ line will stay high as long as something still needs servicing. In edge mode; the interrupt could be masked, or could even be the state-transition from high-to-low... ISA devices use Edge, unless they are out of spec. PCI devices MUST use Level signalling.

Sequence of events

ISA Parallel Port (eg. Laptop Super-I/O chip or just an old machine). This is hard-coded in the IBM-PC standard to always to map LPT1 to IRQ7. Buggy BIOS then also gives use of IRQ7 to the PCI Interrupt router, assuming they can share. This means two different signalling systems on the same IRQ pin, which doesn't work.

Reproducibility ?

00:25 <sladen> for testing;  wonder if I can emulate this by forcing the PCI slots to use IRQ 7
00:38 <mdz> good idea

Work-arounds

  1. Get user to reboot to into BIOS and disable assignment of IRQ7 to PCI devices after user has found a problem.
  2. Load parport irq=none and run parallel port in polling mode, requiring no interrupts.

  3. Detect other devices trying to share IRQ7 by grepping the PCI tree (eg. lspci); and if so, do B. Should ideally be done every boot, perhaps place in /etc/modprobe.d ?

  4. Detect PCI devices trying to use IRQ7 and re-route to, say IRQ11; either by setting the PCI IRQ Routeing Table using ACPI, or by knowing how to program the particular Interrupt Router [chip].

B should probably work in all cases, but will likely introduce a slight responsiveness hit, owing to Parallel Port probeing once every 100msec seconds when idle and every 5usec-200usec when expecting data. (SuSE appears to suggest this as default).

D would probably be the most ideal (undo what effects of Buggy BIOS), but least practical.

C Do-able, meaning device running in polled mode only when required. 2 C.1 Like C, but enable polled mode whenever laptop-detect reckons it's a laptop; (and so statistically more likely to have a buggy BIOS!)

  • NB: I believe it can occur with both non-laptop and non-APIC. Just that nobody has reported that so far, so it might be possible to generalise to "laptops with apic on".

A Could be "fixed in documenation alone", with the problem being blamed on the BIOS writer (who's fault it is! Smile :-) User reboots and plays with BIOS following rough instructions given.

Notes

Quick draft, PaulSladen 2004-09-28

MataroSessionsWorkshops/ParallelPortIRQ7 (last edited 2008-08-06 16:33:06 by localhost)