Need clarity on PCIe MSI interrupt in device tree
Hi,
I have confusion on MSI interrupt flags in PCIe documetation.
MSI interrupts are edge triggered, but i see some controllers use Ex:tegra <0 99 0x4>, here interrupt flags show 0x4 which means level sensitive as per include/dt-bindings/interrupt-controller/irq.h.
May i know why is it like this, why MSI depicted as level sensitive in device tree.
Regards,
valmiki
Quoted 10 lines · valmiki
Hi,
I have confusion on MSI interrupt flags in PCIe documetation.
MSI interrupts are edge triggered, but i see some controllers use Ex:tegra <0 99
0x4>, here interrupt flags show0x4which means level sensitive as perinclude/dt-bindings/interrupt-controller/irq.h.May i know why is it like this, why MSI depicted as level sensitive in device tree.
They are not. MSIs are *not* present in the device tree at all.
What you have here is the cascade interrupt from an MSI controller to another interrupt controller (probably a GICv2), and that particular interrupt is level triggered. Which is perfectly fine if that's the signalling method between the two controllers.
This doesn't in any way reflect how MSIs are signalled.
Thanks,
M.
Signature · 1 line
Jazz is not dead. It just smells funny...
Thans Marc
Quoted 25 lines · Marc Zyngier
Quoted 10 lines · valmiki
Hi,
I have confusion on MSI interrupt flags in PCIe documetation.
MSI interrupts are edge triggered, but i see some controllers use Ex:tegra <0 99
0x4>, here interrupt flags show0x4which means level sensitive as perinclude/dt-bindings/interrupt-controller/irq.h.May i know why is it like this, why MSI depicted as level sensitive in device tree.
They are not. MSIs are *not* present in the device tree at all.
What you have here is the cascade interrupt from an MSI controller to another interrupt controller (probably a GICv2), and that particular interrupt is level triggered. Which is perfectly fine if that's the signalling method between the two controllers.
This doesn't in any way reflect how MSIs are signalled.
Thanks,
M.
Quoted 1 line · valmiki
Hi,
Hi,
Quoted 5 lines
I have confusion on MSI interrupt flags in PCIe documetation.
MSI interrupts are edge triggered, but i see some controllers use Ex:tegra <0 99
0x4>, here interrupt flags show0x4which means level sensitive as perinclude/dt-bindings/interrupt-controller/irq.h.
As Marc says, this isn't actually a description of an MSI, but rather the interrupt generated by the interrupt controller, which is often (but not always) built into PCIe host controllers.
This looks something like:
+--------+ +-----------------+ +----------+ | | +----------+ |~~msi~irq~~>| | | Device |==MSI==>| MSI ctrl | PCIe | | IRQ ctrl |~~~> CPU | | +----------+ |~~intx~irq~>| | +--------+ +-----------------+ +----------+
Each PCIe device sends MSIs to the MSI controller. In response to this, the MSI controller raises a wired interrupt, which is named "msi" in the DT binding because it is the interrupt generated by the MSI controller, and the PCIe controller may raise several distinct interrupts which all need names.
Quoted 2 lines
May i know why is it like this, why MSI depicted as level sensitive in device tree.
As above, the interrupt from the MSI controller to the interrupt controller is level sensitive, but this is not the case for the actual MSIs.
Thanks,
Mark.
Thanks Mark
Quoted 39 lines · Mark Rutland
Quoted 1 line · valmiki
Hi,
Hi,
Quoted 5 lines
I have confusion on MSI interrupt flags in PCIe documetation.
MSI interrupts are edge triggered, but i see some controllers use Ex:tegra <0 99
0x4>, here interrupt flags show0x4which means level sensitive as perinclude/dt-bindings/interrupt-controller/irq.h.As Marc says, this isn't actually a description of an MSI, but rather the interrupt generated by the interrupt controller, which is often (but not always) built into PCIe host controllers.
This looks something like:
+--------+ +-----------------+ +----------+ | | +----------+ |~~msi~irq~~>| | | Device |==MSI==>| MSI ctrl | PCIe | | IRQ ctrl |~~~> CPU | | +----------+ |~~intx~irq~>| | +--------+ +-----------------+ +----------+Each PCIe device sends MSIs to the MSI controller. In response to this, the MSI controller raises a wired interrupt, which is named "msi" in the DT binding because it is the interrupt generated by the MSI controller, and the PCIe controller may raise several distinct interrupts which all need names.
Quoted 2 lines
May i know why is it like this, why MSI depicted as level sensitive in device tree.
As above, the interrupt from the MSI controller to the interrupt controller is level sensitive, but this is not the case for the actual MSIs.
Thanks,
Mark.
Need clarity on MSI handling in RC driver
In reply to valmikiHi All,
I have a doubt, the MSI domains are handled differently in different RC drivers.
Some drivers use irq_domain_add_linear alone, and some use pci_msi_create_irq_domain also to handle MSI.
In most of the 32-bit architectures only irq_domain_add_linear is used and in 64 bit drivers both pci_msi_create_irq_domain and irq_domain_add_linear are used.
So is this because of architecture difference between ARM and ARM64 ?
Thanks & Regards,
valmiki
Re: Need clarity on MSI handling in RC driver
Quoted 5 lines · valmiki
Hi All,
I have a doubt, the MSI domains are handled differently in different RC drivers.
Quoted 8 lines
Some drivers use
irq_domain_add_linearalone, and some usepci_msi_create_irq_domainalso to handle MSI.In most of the 32-bit architectures only
irq_domain_add_linearis used and in 64 bit drivers bothpci_msi_create_irq_domainandirq_domain_add_linearare used.So is this because of architecture difference between ARM and ARM64 ?
Neither. This is purely a software construct. Newer drivers use the generic MSI infrastructure (which also allows things like non-PCI MSI), while older drivers use some ad-hoc infrastructure which is more or less specific to PCI.
The former is the way to go, and the latter is being phased out.
I'll let Mark draw some shiny ASCII art.
Thanks,
M.
Signature · 1 line
Jazz is not dead. It just smells funny...
Re: Need clarity on MSI handling in RC driver
Thanks Marc
Quoted 28 lines · Marc Zyngier
Quoted 5 lines · valmiki
Hi All,
I have a doubt, the MSI domains are handled differently in different RC drivers.
Quoted 8 lines
Some drivers use
irq_domain_add_linearalone, and some usepci_msi_create_irq_domainalso to handle MSI.In most of the 32-bit architectures only
irq_domain_add_linearis used and in 64 bit drivers bothpci_msi_create_irq_domainandirq_domain_add_linearare used.So is this because of architecture difference between ARM and ARM64 ?
Neither. This is purely a software construct. Newer drivers use the generic MSI infrastructure (which also allows things like non-PCI MSI), while older drivers use some ad-hoc infrastructure which is more or less specific to PCI.
The former is the way to go, and the latter is being phased out.
I'll let Mark draw some shiny ASCII art.
Thanks,
M.