Thread (1 message) 1 message, 1 author, 2017-03-03

Using the generic host PCIe driver

From: Marc Zyngier <hidden>
Date: 2017-03-03 17:08:20
Also in: linux-pci

On Fri, Mar 03 2017 at  4:53:58 pm GMT, Mason [off-list ref] wrote:
On 03/03/2017 17:41, Marc Zyngier wrote:
quoted
On Fri, Mar 03 2017 at 11:26:27 am GMT, Mason [off-list ref] wrote:
quoted
On 01/03/2017 17:36, Marc Zyngier wrote:
quoted
Mason: while the kernel has generic support for dealing with MSI, there
is not standardization at the interrupt controller level, so you do have
to write your own driver, and wire it in the rest of the framework.

I suggest you look at things like drivers/pci/host/pcie-altera-msi.c,
which has an extremely simple implementation. You can use this as a
starting point for your own driver.
Thanks Marc,

I'll have a close look at the Altera driver.

I'm having a hard time understanding 3 different kinds of interrupts:

  1. MSI (message-signalled interrupts)
  2. legacy interrupts
  3. custom interrupts
[...]
quoted
I suppose the interrupt controller I'm supposed to write needs
to handle all 3 types of interrupts?
That's entirely up to you. INTx is the bare minimum.
That's going to be a problem. Rev 1 of the PCIe controller does not
support legacy interrupts at all.
Well, let's hope that you never run out of MSIs, and that you don't face
a PCI device that insists (for better or worse) on using INTx.
quoted
MSI is what people
actually need. The rest has more to do with configuring your host
controller, but only you know about it (and I'm not really interested in
the gory details of how this particular HW works).
I was under the impression that some of the error interrupts might be
required for proper PCIe functionality.
Maybe, but that's not something the PCIe *device* will ever have to care
about. That's the host controller's business.
quoted
I mentioned the Altera driver because it is a very simple example of an
MSI controller driver that uses the generic MSI domains. It doesn't care
about INTx, nor host controller management interrupts (that's handled
separately).
OK, MSI support is all I need to start with, so I'll try my best to
decipher the cryptic intc API, without melting my remaining neuron.
What cryptic for someone is usually crystal clear for someone else. We
deal with it.

     M.
-- 
Jazz is not dead, it just smell funny.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help