Re: Using the generic host PCIe driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Mar 03 2017 at  4:53:58 pm GMT, Mason <slash.tmp@xxxxxxx> wrote:
> On 03/03/2017 17:41, Marc Zyngier wrote:
>> On Fri, Mar 03 2017 at 11:26:27 am GMT, Mason <slash.tmp@xxxxxxx> wrote:
>>> On 01/03/2017 17:36, Marc Zyngier wrote:
>>>
>>>> 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
>> 
>> [...]
>> 
>>> 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.

>
>> 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.

>> 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.



[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux