Subject: Re: PCI interrupt question

From: David Hawkins <[email-masked]>
Date: Thu, 03 Dec 2009 09:11:38 -0800

Hi Jeff,

>  I'm trying to get interrupts working for my PCI device on a 460ex and
> am having problem.  My ISR never triggers.
> 
> I'm new to PCI(and ppc) and LDD said that I could read the config reg
> INTURRUPT_LINE to get the interrupt assigned to my PCI device.  Well,
> this always reads zero. 
> 
> After reading through the code it appears that the interrupt is being
> assigned after reading some information out of the device tree and then
> filling in the irg in the pci_dev structure.  
> 
> I'm just looking for confirmation that I should be calling request_irq
> with the irq that I found in the pci_dev struct.

Can you clarify:

1. 460EX is your PCI host CPU?

2. You have some PCI device - what? Have you tested it works in a
    standard PCI bus? Eg. ran lspci from an x86 host.

3. When your host processor boots, it assigns the PCI resources.
    On an x86, its the BIOS that assigns the PCI addresses and IRQs
    on the PCI devices. For your 460EX, it could be your bootloader,
    or it could be your host OS (Linux).

4. If you boot Linux on your 460EX and run lspci, and the device
    configuration space register for the IRQ line is 0, then your
    host has not setup the PCI interface on your device correctly.

5. Once you have the PCI IRQ assigned to the device correctly,
    you need to know which IRQ line on the host this corresponds to.
    I'm pretty sure that needs to be described in the DTS as
    commented by Stefan.

These comments might not be 100% correct, but the list of things
to check should be close enough for you to track down your
problem.

Cheers,
Dave