Xilinx PIC and kernel interrupt handler

Stig Telfer linuxppc at lizardlogic.co.uk
Mon Jul 31 23:50:40 EST 2006


Hi -

There appears to be a kernel bug in the 2.4 and 2.6.17.7 kernel trees 
relating to reading the interrupt vector from the Xilinx PIC 
(xilinx_pic_get_irq() in xilinx_pic.c).  As I see it, here's the 
problem: If no interrupt is pending, the register should read all ones. 
  However, the IVR is only as wide as the number of interrupt sources.  
The routine mistakenly assumes sign extension and checks for a 32-bit 
read of -1 instead of a read of w bits where w is the number of 
connected interrupt sources.

The 2.6 version also has a search-and-replace glitch relating to 
removal of the reversal of bit numbering.  I have attached a two line 
patch (for 2.6.17.7) that makes the IVR comparison against the right 
bit pattern and removes the remnants of the former bit-reversal code.

Share and enjoy,
Stig Telfer

-------------- next part --------------
A non-text attachment was scrubbed...
Name: xilinx_pic.patch
Type: application/octet-stream
Size: 475 bytes
Desc: not available
Url : http://ozlabs.org/pipermail/linuxppc-embedded/attachments/20060731/fcc319b1/attachment.obj 


More information about the Linuxppc-embedded mailing list