Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - PCIe interrupt problem with QNX 7. IRQ 0: (6 Items)
   
PCIe interrupt problem with QNX 7. IRQ 0  
I have a problem with some code I've ported from QNX 6.6 to QNX 7 for an x86 system, dealing with a PCIe device.
The motherboard (Gigabyte Z390 UD) is quite new, so I expect it should be no issue.
I can set BIOS settings for "other PCI devices" to "UEFI" or "Legacy" and have the same results.
It appears the program in QNX 7 never receives interrupts from the card. It does in QNX 6.6 on the same machine.
Both cases do not enable MSI capability. I start the pci-server with no parameters.
I've been researching QNX 7 pci-server stuff, but have come to no solution.
Environment variables include PCI_HW_MODULE=/lib/dll/pci/pci_hw-Intel_x86.so
I have not set PCI_HW_CONFIG_FILE

The code for QNX 7 to get IRQ is:
    pci_err_t r;
    pci_irq_t irq;
    int_t nirq = 1;
    r = pci_device_read_irq(m_hPciDevice, &nirq, &irq);
    if (r == PCI_ERR_OK)
    {
        slog2f(NULL, 0, SLOG2_INFO, "IRQ count %d", nirq);
        if (nirq == 1)
        	slog2f(NULL, 0, SLOG2_INFO, "IRQ value %d", irq);
    }

This shows some QNX 7 slog output from program and pci_server during trying to setup the card.
It shows that it can find the card, because the addresses found are correct.
But the IRQ reported is zero.

Read device addresses
Address 0x4b50c000, BAR# 0, size 0, type 16384
Address 0x4b500000, BAR# 0, size 1, type 32768
Address 0x4b508000, BAR# 0, size 2, type 16384
using pci_device_read_irq
IRQ count 1
IRQ value 0
Map memory index 2, addr 0x0, mem 7fc6e1c
Map memory index 3, addr 0x2, mem 7fc6e24
Map memory index 0, addr 0x1, mem 1e029394
pci_server.3..0              pci_dbg      0  DEBUG,1,0,3 [3:3]: intpin_to_pirq(): Determine B1:D0:F0 PIRQ ...
pci_server.3..0              pci_dbg      0  DEBUG,1,0,3 [3:3]: intpin_to_pirq(): B1:D0:F0 swizzle intpin A --> intpin A

pci_server.3..0              pci_dbg      0  DEBUG,1,0,3 [3:3]: intpin_to_pirq(): B0:D1:F0 swizzle intpin A --> intpin B

pci_server.3..0              pci_dbg      0  DEBUG,1,0,3 [3:3]: intpin_to_pirq(): B1:D0:F0 on PIRQ B
pci_server.3..0              pci_dbg      0  DEBUG,1,1,3 [3:3]: B1:D0:F0 INTA --> PIRQB
pci_server.3..0              pci_dbg      0  DEBUG,1,1,3 [3:3]: PIRQB --> IRQ 0
pci_server.3                 pci_log      0  INFO ,1,2,3 [3:3]: hw_alloc_irq(B1:D0:F0, 1, 0x0, 1, 806b130) OK 
[PCI_ERR_OK]


------------------------------------------------------------------------------------------------------
QNX 7 pci-tool query output:

B001:D00:F00 @ idx 0 in slot 1 of chassis 0
	vid/did: 1bee/001e
		<vendor id - unknown>, <device id - unknown>
	class/subclass/reg: ff/00/00
		Unknown Class code
	revid: 1
	cmd/status registers: 7/10
	Capabilities: 05 (MSI) --> 01 (PMI) --> 10 (PCIe) --> *
	Address Space list - 3 assigned
	    [0] MEM, addr=4b40c000, size=4000, align: 4000, attr: 32bit ENABLED
	    [1] MEM, addr=4b400000, size=8000, align: 8000, attr: 32bit ENABLED
	    [2] MEM, addr=4b408000, size=4000, align: 4000, attr: 32bit ENABLED
	Interrupt list - 0 assigned
	hdrType: 0
		ssvid: 1bee  ?
		ssid:  001e

	PCIe Capability Details
		PCIe port Type: [0] (EP) Endpoint Device
		PCIe Extended Capabilities: 02 (VC-MFVC v1) --> *

	PMI Capability Details
		PMI supported states: D0 D3hot D3cold *
		PMI current state: D0
		PME's supported from states: *
		PME's are disabled

**** Note Interrupt list 0 assigned. Is this a pci-server issue??
You can see in the pci query in QNX 6.6 (below), it has interrupt pin A, and interrupt line 11.

------------------------------------------------------------------------------------------------------
QNX 6 pci query output:

Class          = Unknown (Unknown)
Vendor ID      = 1beeh, Unknown 
Device ID      = 1eh, Unknown Unknown
PCI index      = 0h
Class Codes    = ff0000h
Revision ID    = 1h
Bus number     = 1
Device number  = 0
Function num   = 0
Status Reg     = 10h
Command Reg    = 7h
	I/O space access enabled
	Memory...
View Full Message
Re: PCIe interrupt problem with QNX 7. IRQ 0  
I suspect that the chipset for your board is not supported by the version of HW module you have, probably v2.0
Please post the slog2info for the pci-server after boot (slog2info -b pci_server) and for when your program starts up so
 we can have a look.
Please also confirm whether or not other devices on the platform are working or not.
Re: PCIe interrupt problem with QNX 7. IRQ 0  
Hi Michael. Thanks for your reply.
Attached is slog2info output.
Other devices are working. Eg. Ethernet and video card.
There is another card that the software uses, but I'm unable to check the functionality, because that is dependent upon 
successful initialization of everything. I can't remove it and run the software at the moment, because it's existence is
 checked before initialization of the rest. I can see about changing that when I have some time.
Attachment: Text slog2info_pci_server.txt 99.34 KB
Re: PCIe interrupt problem with QNX 7. IRQ 0  
Ok, I was looking for an explicit message that the chipset was unknown but that does not appear. However the register 
contents for PIRQB is not correct so you probably also need a newer startup. We have added newer chipset support for 
both startup and the x86 PCI HW modules since the 7.0 release and since this is a newer platform, its probably best that
 you get the latest BSP. You will need to contact your local QNX representative to get that initiated.

In the meantime however, you can try and use a HW config file to get the correct INTPIN assigned. See the [interrupts] 
section of /etc/system/config/pci/pci_hw-template.cfg for details on how to do that. IO-APIC based IRQs for PCI 
typically range between 16 and 23 inclusive. If you have the ability to pass an IRQ to your software, then you can 
iterate over these values until you find the correct one and then add it to the config file (or just continue to pass it
 as a driver arg). If not, its a bit more laborous and you will have to try the different values by rebuilding the IFS 
each time as the HW config file must be set before the pci-server is started and the pci-server cannot be easily re-
started on an x86 platform (you would need to stop every other driver using it)
Re: PCIe interrupt problem with QNX 7. IRQ 0  
As you suggested, using trial and error in software, I found it uses IRQ 18. So now I get the board working by "forcing"
 the IRQ in software, or setting the pci device hw config file and using the pci_device_read_irq. Thanks very much for 
your help.
Now I'm onto the next PCIe board which results in system crash on initialization in QNX 7. That's also not our code. I'm
 referring to the National Instruments NIMHDDK library, if you're interested.
Re: PCIe interrupt problem with QNX 7. IRQ 0  
Glad to hear you have worked around the interrupt issue.
I still encourage you to try and obtain an updated BSP and PCI HW module going forward.
I personally have no experience with the NI libraries so will not be able to help there.
I also suggest that you may want to look into posting to one of the more hardware focused forums for possible help with 
that