From: "Ira W. Snyder" <iws@ovro•caltech.edu>
To: Jeff Hane <jeff.hane@maxim-ic•com>
Cc: "linuxppc-dev@ozlabs•org" <linuxppc-dev@ozlabs•org>
Subject: Re: PCI interrupt question
Date: Thu, 3 Dec 2009 11:44:26 -0800 [thread overview]
Message-ID: <20091203194426.GA16874@ovro.caltech.edu> (raw)
In-Reply-To: <1259869140.18190.52.camel@qu102.quarc.com>
On Thu, Dec 03, 2009 at 11:39:00AM -0800, Jeff Hane wrote:
> On Thu, 2009-12-03 at 09:11 -0800, David Hawkins wrote:
> > 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?
>
> yes. We are using a canyonlands board with 460ex.
>
> >
> > 2. You have some PCI device - what? Have you tested it works in a
> > standard PCI bus? Eg. ran lspci from an x86 host.
>
> It is a FPGA board that we are using to develop a video codec/SOC. We
> have not connected it an x86; however, we know the the PCI interface is
> working because we can talk to the FPGA board.
>
> >
> > 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).
>
> We are using the vanilla versions of u-boot and linux for the
> canyonlands boards and have made few changes and definitely not to the
> PCI setup.
>
> >
> > 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.
> >
>
> So are you saying linux should be writing the irq number to the
> INTERRUPT_LINE config reg? This is what I expected but I do not see
> it.
> I believe the DTS is being parsed properly and the connection is made
> to the correct interrupt line on the device. But somebody still needs
> to assign and IRQ number, right? This is the part that is not clear,
> there is an irq field in pci_dev structure which is filled in after
> looking at the DTS and I just want to be sure this is the irq number to
> be used when calling request_irq.
>
Last time I checked, Linux did not write the assigned IRQ to the card's
PCI configuration space. However, the struct pci_dev irq member
contained the correct value. You should be using the value from the
structure for request_irq(). That's how all PCI drivers I've ever seen
work.
Ira
next prev parent reply other threads:[~2009-12-03 20:07 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-03 6:21 PCI interrupt question Jeff Hane
2009-12-03 7:31 ` Stefan Roese
2009-12-03 17:11 ` David Hawkins
2009-12-03 19:39 ` Jeff Hane
2009-12-03 19:44 ` Ira W. Snyder [this message]
2009-12-03 19:52 ` David Hawkins
2009-12-03 19:59 ` Ira W. Snyder
2009-12-03 20:03 ` David Hawkins
2009-12-03 21:28 ` Wolfgang Denk
2009-12-03 21:38 ` David Hawkins
2009-12-04 9:05 ` Benjamin Herrenschmidt
2009-12-04 4:52 ` Stefan Roese
2009-12-04 9:02 ` Benjamin Herrenschmidt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091203194426.GA16874@ovro.caltech.edu \
--to=iws@ovro$(echo .)caltech.edu \
--cc=jeff.hane@maxim-ic$(echo .)com \
--cc=linuxppc-dev@ozlabs$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox