[Linux-parport] [PATCH/RFC] parport_pc: remove ancient

vdb at picaros.org vdb at picaros.org
Mon Sep 19 18:17:31 EDT 2011

> > http://lists.infradead.org/pipermail/linux-parport/2004-March/000048.html
> I think that this is a good approach, but it seems that this patch go to 
> nowhere.... also solves another question of timeouts.

The code in this patch solves a practical problem: system lockup 
when using parallel port PCI add in boards.  

The EPP_supported Intel bug test causes the system lockup.  In short:

1. The test enables the interrupt logic: 
  nErrIntrEn, ecr & 0x10 == 0, enables nFault to interrupt routing,
  serviceIntr, ecr & 0x04 == 0, allows interrupts for FIFO or DMA data.

2. When ECP mode is selected, ecr == 0x60, the empty FIFO generates an 
  interrupt condition.  The parport driver has not yet requested the 
  irq so the interrupt handler is not registered.  

3. A PCI add in board is configured for level interrupts, and the 
  Programmable Interrupt Controller is configured for level sensitive 
  interrupt handling if the INTX# line comes from the PCI bus.  

4. Thus 2 and 3 give an interrupt storm.  The PIC interrupts a 
  processor, the kernel calls any registered handler and sends an 
  end of interrupt to the PIC, and the PIC interrupts again, ....

5. If no handler is registered then linux detects such a storm.  
  Indeed, in this case all these interrupts are spurious so it is 
  reasonable to disable the irq if its processing overloads the 
  system.  If all system time is used up serving the irq then the 
  kernel, after a few ms, masks out that line in the PIC control 

6. If a handler is registered all interrupts are considered genuine 
  and the system locks up at 100% sysload.

So in (5.) lies the reason why add in boards work if the irq is not 
shared.  Luckily the parport interrupt handler isn't registered 
since the stock handler doesn't reset the interrupt condition.  

The workaround of this bug is to load the parport module first and to 
never share irq's between parports.  Removing the EPP test is an 
improvement since (2.) disappears.  

The patches modify EPP_supported such that ecr = mode | 0x14 and add 
to the handler the interrupt reset logic.  In this way interrupts work 
and ECP nFault signalling, reverse idle to incoming data available, is 
then available for free.  

Porting this to linux-2.6 SMP is straightforward, but since the 
parallel port is disappearing it seems not useful to do so.  

Servaas Vandenberghe.

More information about the Linux-parport mailing list