1

I am working on a PCIe Linux driver. I would like to register an ISR for the device. IRQ number assigned to the device by the Linux system is 16, which is shared by other(USB host controller) device also. (Checked by lspci -v). It is a pin based interrupt.

By searching online I found almost all PCI driver example just provides only IRQF_SHARED as flag in API request_irq(), and does not provide any other flags to mention behaviour like High/Low level interrupt.

My question is, how the Linux kernel determines the behaviour of shared interrupt (for PCIe device), if it is low level or High level ?

1 Answers1

1

PCIe uses MSI, so there is no hi/low level to be concerned with. Traditional PCI cards use level triggered interrupts, but most devices use active low signaling so this isn't something a driver writer has access to modify/tweak.

Larry Schiefer
  • 15,687
  • 2
  • 27
  • 33
  • In my case, I am not using MSI. If I request IRQ with flag IRQF_TRIGGER_HIGH/LOW in adition to IRQF_SHARED, system throw errors "genirq: Flags mismatch" as the IRQ already shared by another device with different flag value. So want to understand how Linux system handle this types of shared Interrupts. Is there any document which describe this things ? – Riddhi patel Apr 06 '17 at 04:30
  • That gets into some deeper machine specific code within the kernel. Most will have it set by the BIOS or low level firmware (or platform init code) and the kernel will use those values appropriately. – Larry Schiefer Apr 06 '17 at 10:43