On 28 October 2013 18:09, Karicheri, Muralidharan <m-karicheri2@xxxxxx> wrote: > > Andrewl, > > Thanks. I got some questions on AER irq handling below. > > >> > Yes. That was it. It probes the driver now. Did you try error inject feature? > >> > >> I did have a look at that, but it really depends on what exactly you want to test. There are > >> many things this won't help you with, you ought to examine the aer inject driver to see > >> what it does. For example if you are bringing up a new device and want to see it raise an > >> AER interrupt then aer inject won't help. In this case you'll need to find a way to trigger real > >> errors. > >> > > What is the IRQ line tied to the AER driver? This is well defined by the PCIe standard, and codeified in init_service_irqs (drivers/pci/pcie/portdrv_core.c) - the code references sections from the standard. I believe if MSI/MSI-X is not available then all port service interrupts (AER, PM, HP, etc) are expected to come in on whatever legacy interrupt is set up in the device config space (most probably IRQ0). Where MSI/MSI-X are used there are different rules. There is nothing special about port services, they come throughout whatever interrupt mechanism is turned on in the config space, i.e. if MSI's are enabled, then the kernel wouldn't expect a legacy interrupt... > > Since this is handling the root port error irq as well as the upstream/downstream device irqs. Does this driver assumes that error interrupt is raised on Legacy IRQ0 or MSI IRQ 0 for all of the ports (root, downstream and upstream)? The AER driver will 'attach' to any config space that reports having an AER capability, and use the interrupt associated with that config space. I can't remember much about root ports I'm afraid... (but if the downstream/upstream ports don't have AER capability, perhaps the errors would propagate towards the RC and be captured by the AER there (?) and the source can be distinguished by the source ID register) > > When I have dumped the irq number in the AER driver it shows Legacy irq0 (when nomsi boot parameter is used) or MSI irq0. Our PCIe IP acts as a RC and has a separate IRQ line (12) for root port irq as below > > 12 Error Interrupts > [0] System error (OR of fatal, nonfatal, correctable errors) (RC mode only) > [1] PCIe fatal error (RC mode only) > [2] PCIe non-fatal error (RC mode only) > [3] PCIe correctable error (RC mode only) > [4] AXI Error due to fatal condition in AXI bridge (EP/RC modes) > [5] PCIe advanced error (RC mode only) > > Does that mean, I need to modify the AER driver to support separate IRQ line for root port (port_type = PCI_EXP_TYPE_ROOT_PORT) for the hw I am working on. Any help? The standard (and the AER driver) expect AER errors to be reported via PCIe interrupts, which are either legacy, MSI or MSI-X interrupts, in your case the hardware appears to use it's own standard CPU interrupt. The port service drivers, as far as I'm aware do not support this. It may be possible that your hardware does the right thing, and that the AER interrupt above is provided in addition for convenience. Perhaps someone else here may have a different view... Andrew Murray -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html