Hi folks,
I’m putting together an FPGA PCIe card and doing some prototyping by placing it into the main PCIe slot in the AGX Xavier carrier board. I have a simple driver that registers an MSI interrupt to a simple handler that just prints text to dmesg and returns. The FPGA by itself triggers an interrupt once per second.
My issue is that something (presumably) in the kernel is not catching those interrupts and executing my driver. I know this is an issue with something in the Xavier because if I run the same driver with the same FPGA card on a different linux machine, I see my interrupt-indicating dmesg text showing up once a second.
Is there some configuration that I’m missing? Appreciate any insight.
I’ve included the relevant part results of “lspci -vvv” and my pci probe function for reference:
0005:01:00.0 Unassigned class [ff00]: Pronto.ai Device ca77
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0
Interrupt: pin A routed to IRQ 819
Region 0: Memory at 1f40000000 (32-bit, non-prefetchable)
Capabilities: [50] Power Management version 3
Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [70] MSI: Enable+ Count=1/1 Maskable- 64bit+
Address: 00000000fffff000 Data: 0000
Capabilities: [90] Express (v1) Endpoint, MSI 00
DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s <64ns, L1 <1us
ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset- SlotPowerLimit 0.000W
DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
MaxPayload 128 bytes, MaxReadReq 512 bytes
DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr- TransPend-
LnkCap: Port #0, Speed 2.5GT/s, Width x4, ASPM L1, Exit Latency L0s unlimited, L1 unlimited
ClockPM- Surprise- LLActRep- BwNot- ASPMOptComp+
LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- CommClk+
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 2.5GT/s, Width x4, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
Capabilities: [100 v1] Device Serial Number 00-00-00-00-00-00-00-00
Kernel driver in use: pcd
static int pcd_probe(struct pci_dev* dev, const struct pci_device_id* id)
{
int result;
printk(KERN_NOTICE "Probing pci devices\n");
// Enable PCI device
result = pci_enable_device(dev);
if(result)
{
result = -EINVAL;
goto out;
}
// Enable bus mastering
pci_set_master(dev);
// Request MSI interrupt vector
// magic number params are min and max vector num
result = pci_alloc_irq_vectors(dev, 1, 1, PCI_IRQ_MSI);
if (result < 0)
{
printk(KERN_ERR "failed to alloc irq vectors\n");
goto out_disable;
}
else
{
printk(KERN_NOTICE "allocated %d vectors\n", result);
result = 0;
}
// Request interrupt assingnment
// pcd_irq is a global variable
// pcd_int_handler just prints stuff to dmesg and returns
pcd_irq = pci_irq_vector(dev, 0);
printk(KERN_INFO "pcd: interrupt line 0 is %d\n", pcd_irq);
if (request_irq(pcd_irq, pcd_int_handler, 0, "pcd", dev))
{
printk(KERN_ERR "pcd: cannot register irq %d\n", pcd_irq);
pci_free_irq_vectors(dev);
result = -EIO;
goto out_disable;
}
// Map bar 0
// Arguments are device, BAR number, maxlen
pcds[0].bar0 = pci_iomap(dev, 0, 0);
out:
return result;
out_disable:
pci_disable_device(dev);
goto out;
}
Thank you!