|
PCI: InterruptAttach() succeeds but handler not called anyway
|
07/11/2012 11:48 AM
post94191
|
PCI: InterruptAttach() succeeds but handler not called anyway
Hi,
I'm working on a device driver which shall process interrupts generated by an
FPGA. Although all my initialization steps succeed my IRQ handler is obviously
not called. Additionally I don't see the respective IRQ is attached to my driver
when checking with "pidin irq".
Any ideas on what I'm doing wrong are highly appreciated :)
Thomas
My IRQ handling code
--------------------
int enableIrqHandler()
{
fpga.pciDevInfo.VendorId = FPGA_VENDOR_ID;
fpga.pciDevInfo.DeviceId = FPGA_DEVICE_ID;
fpga.pciHandle = pci_attach(0);
fpga.handle = pci_attach_device(NULL, PCI_SHARE | PCI_INIT_ALL | PCI_SEARCH_VENDEV,
0, &fpga.pciDevInfo);
fpga.regBase = mmap_device_memory(NULL, FPGA_SYS_REGS_SIZE,
PROT_READ | PROT_WRITE | PROT_NOCACHE,
0, fpga.pciDevInfo.CpuBaseAddress[0]);
pthread_create(&fpga.thread, NULL, irqThread, NULL);
}
void *irqThread(void *arg)
{
ThreadCtl(_NTO_TCTL_IO, 0);
fpga.intrId = InterruptAttach(_NTO_INTR_CLASS_EXTERNAL | fpga.pciDevInfo.Irq,
irqHandler, NULL, 0,
_NTO_INTR_FLAGS_END | _NTO_INTR_FLAGS_TRK_MSK);
InterruptUnmask(_NTO_INTR_CLASS_EXTERNAL | fpga.pciDevInfo.Irq, fpga.intrId);
while (1)
{
InterruptWait(0, NULL);
fpga.thread_trigger_count++;
}
}
const struct sigevent *irqHandler(void *arg, int id)
{
uint32_t status;
struct sigevent *event = NULL;
fpga.irq_trigger_count++;
status = *VID_CTRL_REG2;
if (status & FPGA__TRANSITION)
{
*VID_CTRL_REG2 = status & ~FPGA__TRANSITION;
memset(&fpga.Event, 0, sizeof(fpga.Event));
fpga.Event.sigev_notify = SIGEV_INTR;
event = &fpga.Event;
}
return event;
}
Output of pci -vvv
------------------
Class = System Peripherals (Other)
Vendor ID = 10eeh, Xilinx Corporation
Device ID = 1h, EUROCOM for PCI (ECOMP)
PCI index = 0h
Class Codes = 088000h
Revision ID = 0h
Bus number = 7
Device number = 0
Function num = 0
Status Reg = 10h
Command Reg = 6h
I/O space access disabled
Memory space access enabled
Bus Master enabled
Special Cycle operations ignored
Memory Write and Invalidate disabled
Palette Snooping disabled
Parity Error Response disabled
Data/Address stepping disabled
SERR# driver disabled
Fast back-to-back transactions to different agents disabled
PCI INTx enabled
Header type = 0h Single-function
BIST = 0h Build-in-self-test not supported
Latency Timer = 0h
Cache Line Size= 0h
BAR - 0 [Mem] = 98000000h 32bit length 134217728 enabled
Subsystem Vendor ID = 10eeh
Subsystem ID = 3h
Max Lat = 0ns
Min Gnt = 0ns
PCI Int Pin = INT A
Interrupt line = 112
CPU Interrupt = 80020020h
Capabilities Pointer = 40h
Capability ID = 1h - Power Management
Capabilities = 7003h - 8h
Capability ID = 5h - Message Signaled Interrupts
Capabilities = 81h - fee00000h Enabled
Capability ID = 10h - PCI Express
Capabilities = 1h - 288fc0h
Device Dependent Registers:
0x040: 0148 0370 0800 0000 0558 8100 0000 e0fe
0x050: 0000 0000 7000 0000 1000 0100 c08f 2800
0x060: 1028 0000 11f4 0300 0000 1100 0000 0000
0x070: 0000 0000 0000 0000 0000 0000 0000 0000
...
0x0f0: 0000 0000 0000 0000 0000 0000 0000 0000
0x100: 0300 0100 0000 0000 0000 0000 0000 0000
0x110: 0000 0000 0000 0000 0000 0000 0000 0000
...
0xff0: 0000 0000 0000 0000 0000 0000 0000 0000
Some syslog output I generate
-----------------------------
Jan 01 00:00:07.559.5 17880 00 enableIrqHandler: FPGA attached: handle=0x806b8e0, Irq=0x80020020, CpuBaseAddress[0]=
0x98000000, BaseAddressSize[0]=0x8000000
Jan 01 00:00:07.559.5 17880 00 InterruptAttach() succeeded. intrId=45
Jan 01...
View Full Message
|
|
|
|
Re: PCI: InterruptAttach() succeeds but handler not called anyway
|
07/11/2012 12:24 PM
post94195
|
Re: PCI: InterruptAttach() succeeds but handler not called anyway
Hello,
your PCIe interface seems to be initialized for MSI operation ( IRQ = 112)
So try to use it in MSI mode ... Hugh posted resently the attached code.
You need QNX 6.5 SP1 ... some structure components used in the example
are not yet available.
--Armin
http://www.steinhoff-automation.com
Thomas Klein wrote:
> Hi,
>
> I'm working on a device driver which shall process interrupts generated by an
> FPGA. Although all my initialization steps succeed my IRQ handler is obviously
> not called. Additionally I don't see the respective IRQ is attached to my driver
> when checking with "pidin irq".
>
> Any ideas on what I'm doing wrong are highly appreciated :)
> Thomas
>
>
> My IRQ handling code
> --------------------
> int enableIrqHandler()
> {
> fpga.pciDevInfo.VendorId = FPGA_VENDOR_ID;
> fpga.pciDevInfo.DeviceId = FPGA_DEVICE_ID;
> fpga.pciHandle = pci_attach(0);
> fpga.handle = pci_attach_device(NULL, PCI_SHARE | PCI_INIT_ALL | PCI_SEARCH_VENDEV,
> 0, &fpga.pciDevInfo);
>
> fpga.regBase = mmap_device_memory(NULL, FPGA_SYS_REGS_SIZE,
> PROT_READ | PROT_WRITE | PROT_NOCACHE,
> 0, fpga.pciDevInfo.CpuBaseAddress[0]);
>
> pthread_create(&fpga.thread, NULL, irqThread, NULL);
> }
>
> void *irqThread(void *arg)
> {
> ThreadCtl(_NTO_TCTL_IO, 0);
>
> fpga.intrId = InterruptAttach(_NTO_INTR_CLASS_EXTERNAL | fpga.pciDevInfo.Irq,
> irqHandler, NULL, 0,
> _NTO_INTR_FLAGS_END | _NTO_INTR_FLAGS_TRK_MSK);
>
> InterruptUnmask(_NTO_INTR_CLASS_EXTERNAL | fpga.pciDevInfo.Irq, fpga.intrId);
>
> while (1)
> {
> InterruptWait(0, NULL);
> fpga.thread_trigger_count++;
> }
> }
>
> const struct sigevent *irqHandler(void *arg, int id)
> {
> uint32_t status;
> struct sigevent *event = NULL;
>
> fpga.irq_trigger_count++;
> status = *VID_CTRL_REG2;
>
> if (status & FPGA__TRANSITION)
> {
> *VID_CTRL_REG2 = status & ~FPGA__TRANSITION;
> memset(&fpga.Event, 0, sizeof(fpga.Event));
> fpga.Event.sigev_notify = SIGEV_INTR;
> event = &fpga.Event;
> }
> return event;
> }
>
> Output of pci -vvv
> ------------------
> Class = System Peripherals (Other)
> Vendor ID = 10eeh, Xilinx Corporation
> Device ID = 1h, EUROCOM for PCI (ECOMP)
> PCI index = 0h
> Class Codes = 088000h
> Revision ID = 0h
> Bus number = 7
> Device number = 0
> Function num = 0
> Status Reg = 10h
> Command Reg = 6h
> I/O space access disabled
> Memory space access enabled
> Bus Master enabled
> Special Cycle operations ignored
> Memory Write and Invalidate disabled
> Palette Snooping disabled
> Parity Error Response disabled
> Data/Address stepping disabled
> SERR# driver disabled
> Fast back-to-back transactions to different agents disabled
> PCI INTx enabled
> Header type = 0h Single-function
> BIST = 0h Build-in-self-test not supported
> Latency Timer = 0h
> Cache Line Size= 0h
> BAR - 0 [Mem] = 98000000h 32bit length 134217728 enabled
> Subsystem Vendor ID = 10eeh
> Subsystem ID = 3h
> Max Lat = 0ns
> Min Gnt = 0ns
> PCI Int Pin = INT A
> Interrupt line = 112
> CPU Interrupt = 80020020h
> Capabilities Pointer = 40h
> Capability ID = 1h - Power Management
> Capabilities = 7003h - 8h
> Capability ID = 5h - Message Signaled Interrupts
> Capabilities =...
View Full Message
|
|
|
|
Re: PCI: InterruptAttach() succeeds but handler not called anyway
|
07/11/2012 12:58 PM
post94199
|
Re: PCI: InterruptAttach() succeeds but handler not called anyway
> Hello,
>
> your PCIe interface seems to be initialized for MSI operation ( IRQ = 112)
> So try to use it in MSI mode ... Hugh posted resently the attached code.
> You need QNX 6.5 SP1 ... some structure components used in the example
> are not yet available.
Thanks for your fast reply, Armin! Just to be sure: I took much of my init code from a driver
which operates on the following device:
Class = Multimedia (Video)
Vendor ID = 104ah, STMicroelectronics
Device ID = cc0dh, Unknown Unknown
<snip>
PCI Int Pin = INT A
Interrupt line = 104
CPU Interrupt = 80020018h
Capabilities Pointer = 44h
Capability ID = 1h - Power Management
Capabilities = 803h - 8h
Capability ID = 10h - PCI Express
Capabilities = 2h - 8d80h
Capability ID = 5h - Message Signaled Interrupts
Capabilities = 81h - fee00000h Enabled
It also seems to use MSIs but is anyway succesfully handling interrupts.
Do you see a difference between my device and the one mentioned above
which would explain why they have to be initialized differently?
Thomas
|
|
|
|
RE: PCI: InterruptAttach() succeeds but handler not called anyway
|
07/11/2012 12:59 PM
post94200
|
RE: PCI: InterruptAttach() succeeds but handler not called anyway
Do you check the return codes from all the functions to make sure that they succeeded?
Steve Reid (stever@qnx.com)
Technical Editor
QNX Software Systems
-----Original Message-----
From: Thomas Klein [mailto:community-noreply@qnx.com]
Sent: Wednesday, July 11, 2012 12:59 PM
To: general-community
Subject: Re: PCI: InterruptAttach() succeeds but handler not called anyway
> Hello,
>
> your PCIe interface seems to be initialized for MSI operation ( IRQ =
> 112) So try to use it in MSI mode ... Hugh posted resently the attached code.
> You need QNX 6.5 SP1 ... some structure components used in the example
> are not yet available.
Thanks for your fast reply, Armin! Just to be sure: I took much of my init code from a driver which operates on the
following device:
Class = Multimedia (Video)
Vendor ID = 104ah, STMicroelectronics
Device ID = cc0dh, Unknown Unknown
<snip>
PCI Int Pin = INT A
Interrupt line = 104
CPU Interrupt = 80020018h
Capabilities Pointer = 44h
Capability ID = 1h - Power Management
Capabilities = 803h - 8h
Capability ID = 10h - PCI Express
Capabilities = 2h - 8d80h
Capability ID = 5h - Message Signaled Interrupts
Capabilities = 81h - fee00000h Enabled
It also seems to use MSIs but is anyway succesfully handling interrupts.
Do you see a difference between my device and the one mentioned above which would explain why they have to be
initialized differently?
Thomas
_______________________________________________
General
http://community.qnx.com/sf/go/post94199
To cancel your subscription to this discussion, please e-mail general-community-unsubscribe@community.qnx.com
|
|
|
|
Re: RE: PCI: InterruptAttach() succeeds but handler not called anyway
|
07/11/2012 1:28 PM
post94201
|
Re: RE: PCI: InterruptAttach() succeeds but handler not called anyway
> Do you check the return codes from all the functions to make sure that they
> succeeded?
Yes, I do.
I had a look at Hugh's code which Armin posted. The only difference to what I did before is that I now call
pci_attach_device(NULL, PCI_INIT_ALL | PCI_INIT_ROM | PCI_SHARE | PCI_MASTER_ENABLE | PCI_USE_MSI | PCI_USE_MSIX, 0, &
g_fpga.pciDevInfo);
I regret, it doesn't make a difference. I still can't see a connection between irq=0x80020020 and my handler when
examining "pidin irq" output. Do I perhaps miss any steps between pci_attach_device() and InterruptAttach()? Any
explanation why InterruptAttach() returns a reasonable id but still the respective pciDevInfo.Irq=0x80020020 doesn't
appear in "pidin irq" output?
Thomas
> Steve Reid (stever@qnx.com)
> Technical Editor
> QNX Software Systems
>
> -----Original Message-----
> From: Thomas Klein [mailto:community-noreply@qnx.com]
> Sent: Wednesday, July 11, 2012 12:59 PM
> To: general-community
> Subject: Re: PCI: InterruptAttach() succeeds but handler not called anyway
>
> > Hello,
> >
> > your PCIe interface seems to be initialized for MSI operation ( IRQ =
> > 112) So try to use it in MSI mode ... Hugh posted resently the attached code
> .
> > You need QNX 6.5 SP1 ... some structure components used in the example
> > are not yet available.
>
> Thanks for your fast reply, Armin! Just to be sure: I took much of my init
> code from a driver which operates on the following device:
>
> Class = Multimedia (Video)
> Vendor ID = 104ah, STMicroelectronics
> Device ID = cc0dh, Unknown Unknown
> <snip>
> PCI Int Pin = INT A
> Interrupt line = 104
> CPU Interrupt = 80020018h
> Capabilities Pointer = 44h
> Capability ID = 1h - Power Management
> Capabilities = 803h - 8h
> Capability ID = 10h - PCI Express
> Capabilities = 2h - 8d80h
> Capability ID = 5h - Message Signaled Interrupts
> Capabilities = 81h - fee00000h Enabled
>
> It also seems to use MSIs but is anyway succesfully handling interrupts.
> Do you see a difference between my device and the one mentioned above which
> would explain why they have to be initialized differently?
>
> Thomas
>
>
>
> _______________________________________________
>
> General
> http://community.qnx.com/sf/go/post94199
> To cancel your subscription to this discussion, please e-mail general-
> community-unsubscribe@community.qnx.com
|
|
|
|
Re: PCI: InterruptAttach() succeeds but handler not called anyway
|
07/11/2012 2:34 PM
post94204
|
Re: PCI: InterruptAttach() succeeds but handler not called anyway
Thomas,
the IRQ returned by pci_attach_device is completely nonsens :)
As a workaround try to use the IRQ number returned by pci -vvv.
--Armin
Thomas Klein wrote:
>> Do you check the return codes from all the functions to make sure that they
>> succeeded?
> Yes, I do.
> I had a look at Hugh's code which Armin posted. The only difference to what I did before is that I now call
>
> pci_attach_device(NULL, PCI_INIT_ALL | PCI_INIT_ROM | PCI_SHARE | PCI_MASTER_ENABLE | PCI_USE_MSI | PCI_USE_MSIX, 0, &
g_fpga.pciDevInfo);
>
> I regret, it doesn't make a difference. I still can't see a connection between irq=0x80020020 and my handler when
examining "pidin irq" output. Do I perhaps miss any steps between pci_attach_device() and InterruptAttach()? Any
explanation why InterruptAttach() returns a reasonable id but still the respective pciDevInfo.Irq=0x80020020 doesn't
appear in "pidin irq" output?
>
> Thomas
>
>> Steve Reid (stever@qnx.com)
>> Technical Editor
>> QNX Software Systems
>>
>> -----Original Message-----
>> From: Thomas Klein [mailto:community-noreply@qnx.com]
>> Sent: Wednesday, July 11, 2012 12:59 PM
>> To: general-community
>> Subject: Re: PCI: InterruptAttach() succeeds but handler not called anyway
>>
>>> Hello,
>>>
>>> your PCIe interface seems to be initialized for MSI operation ( IRQ =
>>> 112) So try to use it in MSI mode ... Hugh posted resently the attached code
>> .
>>> You need QNX 6.5 SP1 ... some structure components used in the example
>>> are not yet available.
>> Thanks for your fast reply, Armin! Just to be sure: I took much of my init
>> code from a driver which operates on the following device:
>>
>> Class = Multimedia (Video)
>> Vendor ID = 104ah, STMicroelectronics
>> Device ID = cc0dh, Unknown Unknown
>> <snip>
>> PCI Int Pin = INT A
>> Interrupt line = 104
>> CPU Interrupt = 80020018h
>> Capabilities Pointer = 44h
>> Capability ID = 1h - Power Management
>> Capabilities = 803h - 8h
>> Capability ID = 10h - PCI Express
>> Capabilities = 2h - 8d80h
>> Capability ID = 5h - Message Signaled Interrupts
>> Capabilities = 81h - fee00000h Enabled
>>
>> It also seems to use MSIs but is anyway succesfully handling interrupts.
>> Do you see a difference between my device and the one mentioned above which
>> would explain why they have to be initialized differently?
>>
>> Thomas
>>
>>
>>
>> _______________________________________________
>>
>> General
>> http://community.qnx.com/sf/go/post94199
>> To cancel your subscription to this discussion, please e-mail general-
>> community-unsubscribe@community.qnx.com
>
>
>
> _______________________________________________
>
> General
> http://community.qnx.com/sf/go/post94201
> To cancel your subscription to this discussion, please e-mail general-community-unsubscribe@community.qnx.com
>
|
|
|
|
Re: PCI: InterruptAttach() succeeds but handler not called anyway
|
07/11/2012 3:34 PM
post94207
|
Re: PCI: InterruptAttach() succeeds but handler not called anyway
> Thomas,
>
> the IRQ returned by pci_attach_device is completely nonsens :)
> As a workaround try to use the IRQ number returned by pci -vvv.
Hmmm ... aren't they quite ... identical? pci -v says
Class = System Peripherals (Other)
Vendor ID = 10eeh, Xilinx Corporation
Device ID = 1h, EUROCOM for PCI (ECOMP)
<snip>
PCI Int Pin = INT A
Interrupt line = 112
CPU Interrupt = 80020020h <---
while my driver says
Jan 01 00:00:07.559.5 17880 00 enableIrqHandler: FPGA attached: handle=0x806b8e0, Irq=0x80020020 <---
Or do I have to use the "Interrupt line" value?
Thomas
>
> --Armin
>
>
> Thomas Klein wrote:
> >> Do you check the return codes from all the functions to make sure that they
>
> >> succeeded?
> > Yes, I do.
> > I had a look at Hugh's code which Armin posted. The only difference to what
> I did before is that I now call
> >
> > pci_attach_device(NULL, PCI_INIT_ALL | PCI_INIT_ROM | PCI_SHARE |
> PCI_MASTER_ENABLE | PCI_USE_MSI | PCI_USE_MSIX, 0, &g_fpga.pciDevInfo);
> >
> > I regret, it doesn't make a difference. I still can't see a connection
> between irq=0x80020020 and my handler when examining "pidin irq" output. Do I
> perhaps miss any steps between pci_attach_device() and InterruptAttach()? Any
> explanation why InterruptAttach() returns a reasonable id but still the
> respective pciDevInfo.Irq=0x80020020 doesn't appear in "pidin irq" output?
> >
> > Thomas
> >
> >> Steve Reid (stever@qnx.com)
> >> Technical Editor
> >> QNX Software Systems
> >>
> >> -----Original Message-----
> >> From: Thomas Klein [mailto:community-noreply@qnx.com]
> >> Sent: Wednesday, July 11, 2012 12:59 PM
> >> To: general-community
> >> Subject: Re: PCI: InterruptAttach() succeeds but handler not called anyway
> >>
> >>> Hello,
> >>>
> >>> your PCIe interface seems to be initialized for MSI operation ( IRQ =
> >>> 112) So try to use it in MSI mode ... Hugh posted resently the attached
> code
> >> .
> >>> You need QNX 6.5 SP1 ... some structure components used in the example
> >>> are not yet available.
> >> Thanks for your fast reply, Armin! Just to be sure: I took much of my init
> >> code from a driver which operates on the following device:
> >>
> >> Class = Multimedia (Video)
> >> Vendor ID = 104ah, STMicroelectronics
> >> Device ID = cc0dh, Unknown Unknown
> >> <snip>
> >> PCI Int Pin = INT A
> >> Interrupt line = 104
> >> CPU Interrupt = 80020018h
> >> Capabilities Pointer = 44h
> >> Capability ID = 1h - Power Management
> >> Capabilities = 803h - 8h
> >> Capability ID = 10h - PCI Express
> >> Capabilities = 2h - 8d80h
> >> Capability ID = 5h - Message Signaled Interrupts
> >> Capabilities = 81h - fee00000h Enabled
> >>
> >> It also seems to use MSIs but is anyway succesfully handling interrupts.
> >> Do you see a difference between my device and the one mentioned above which
>
> >> would explain why they have to be initialized differently?
> >>
> >> Thomas
|
|
|
|
Re: PCI: InterruptAttach() succeeds but handler not called anyway
|
07/11/2012 3:58 PM
post94208
|
Re: PCI: InterruptAttach() succeeds but handler not called anyway
What platform are you running on - ppc?
--
Hugh Brown
QNX Software Systems Limited
1001 Farrar Rd.,
Ottawa. ON. K2K 0B3.
Telephone: 613-591-0931
On 12-07-11 3:34 PM, "Thomas Klein" <community-noreply@qnx.com> wrote:
>> Thomas,
>>
>> the IRQ returned by pci_attach_device is completely nonsens :)
>> As a workaround try to use the IRQ number returned by pci -vvv.
>
>Hmmm ... aren't they quite ... identical? pci -v says
>
>Class = System Peripherals (Other)
>Vendor ID = 10eeh, Xilinx Corporation
>Device ID = 1h, EUROCOM for PCI (ECOMP)
> <snip>
>PCI Int Pin = INT A
>Interrupt line = 112
>CPU Interrupt = 80020020h <---
>
>while my driver says
>
>Jan 01 00:00:07.559.5 17880 00 enableIrqHandler: FPGA attached:
>handle=0x806b8e0, Irq=0x80020020 <---
>
>Or do I have to use the "Interrupt line" value?
>
>Thomas
>
>>
>> --Armin
>>
>>
>> Thomas Klein wrote:
>> >> Do you check the return codes from all the functions to make sure
>>that they
>>
>> >> succeeded?
>> > Yes, I do.
>> > I had a look at Hugh's code which Armin posted. The only difference
>>to what
>> I did before is that I now call
>> >
>> > pci_attach_device(NULL, PCI_INIT_ALL | PCI_INIT_ROM | PCI_SHARE |
>> PCI_MASTER_ENABLE | PCI_USE_MSI | PCI_USE_MSIX, 0, &g_fpga.pciDevInfo);
>> >
>> > I regret, it doesn't make a difference. I still can't see a
>>connection
>> between irq=0x80020020 and my handler when examining "pidin irq"
>>output. Do I
>> perhaps miss any steps between pci_attach_device() and
>>InterruptAttach()? Any
>> explanation why InterruptAttach() returns a reasonable id but still the
>> respective pciDevInfo.Irq=0x80020020 doesn't appear in "pidin irq"
>>output?
>> >
>> > Thomas
>> >
>> >> Steve Reid (stever@qnx.com)
>> >> Technical Editor
>> >> QNX Software Systems
>> >>
>> >> -----Original Message-----
>> >> From: Thomas Klein [mailto:community-noreply@qnx.com]
>> >> Sent: Wednesday, July 11, 2012 12:59 PM
>> >> To: general-community
>> >> Subject: Re: PCI: InterruptAttach() succeeds but handler not called
>>anyway
>> >>
>> >>> Hello,
>> >>>
>> >>> your PCIe interface seems to be initialized for MSI operation ( IRQ
>>=
>> >>> 112) So try to use it in MSI mode ... Hugh posted resently the
>>attached
>> code
>> >> .
>> >>> You need QNX 6.5 SP1 ... some structure components used in the
>>example
>> >>> are not yet available.
>> >> Thanks for your fast reply, Armin! Just to be sure: I took much of
>>my init
>> >> code from a driver which operates on the following device:
>> >>
>> >> Class = Multimedia (Video)
>> >> Vendor ID = 104ah, STMicroelectronics
>> >> Device ID = cc0dh, Unknown Unknown
>> >> <snip>
>> >> PCI Int Pin = INT A
>> >> Interrupt line = 104
>> >> CPU Interrupt = 80020018h
>> >> Capabilities Pointer = 44h
>> >> Capability ID = 1h - Power Management
>> >> Capabilities = 803h - 8h
>> >> Capability ID = 10h - PCI Express
>> >> Capabilities = 2h - 8d80h
>> >> Capability ID = 5h - Message Signaled Interrupts
>> >> Capabilities = 81h - fee00000h Enabled
>>...
|
|
|
|
Re: PCI: InterruptAttach() succeeds but handler not called anyway
|
07/11/2012 3:46 PM
post94209
|
Re: PCI: InterruptAttach() succeeds but handler not called anyway
> What platform are you running on - ppc?
Intel
>
> --
> Hugh Brown
> QNX Software Systems Limited
> 1001 Farrar Rd.,
> Ottawa. ON. K2K 0B3.
> Telephone: 613-591-0931
>
>
>
>
>
>
>
> On 12-07-11 3:34 PM, "Thomas Klein" <community-noreply@qnx.com> wrote:
>
> >> Thomas,
> >>
> >> the IRQ returned by pci_attach_device is completely nonsens :)
> >> As a workaround try to use the IRQ number returned by pci -vvv.
> >
> >Hmmm ... aren't they quite ... identical? pci -v says
> >
> >Class = System Peripherals (Other)
> >Vendor ID = 10eeh, Xilinx Corporation
> >Device ID = 1h, EUROCOM for PCI (ECOMP)
> > <snip>
> >PCI Int Pin = INT A
> >Interrupt line = 112
> >CPU Interrupt = 80020020h <---
> >
> >while my driver says
> >
> >Jan 01 00:00:07.559.5 17880 00 enableIrqHandler: FPGA attached:
> >handle=0x806b8e0, Irq=0x80020020 <---
> >
> >Or do I have to use the "Interrupt line" value?
> >
> >Thomas
> >
> >>
> >> --Armin
> >>
> >>
> >> Thomas Klein wrote:
> >> >> Do you check the return codes from all the functions to make sure
> >>that they
> >>
> >> >> succeeded?
> >> > Yes, I do.
> >> > I had a look at Hugh's code which Armin posted. The only difference
> >>to what
> >> I did before is that I now call
> >> >
> >> > pci_attach_device(NULL, PCI_INIT_ALL | PCI_INIT_ROM | PCI_SHARE |
> >> PCI_MASTER_ENABLE | PCI_USE_MSI | PCI_USE_MSIX, 0, &g_fpga.pciDevInfo);
> >> >
> >> > I regret, it doesn't make a difference. I still can't see a
> >>connection
> >> between irq=0x80020020 and my handler when examining "pidin irq"
> >>output. Do I
> >> perhaps miss any steps between pci_attach_device() and
> >>InterruptAttach()? Any
> >> explanation why InterruptAttach() returns a reasonable id but still the
> >> respective pciDevInfo.Irq=0x80020020 doesn't appear in "pidin irq"
> >>output?
> >> >
> >> > Thomas
> >> >
> >> >> Steve Reid (stever@qnx.com)
> >> >> Technical Editor
> >> >> QNX Software Systems
> >> >>
> >> >> -----Original Message-----
> >> >> From: Thomas Klein [mailto:community-noreply@qnx.com]
> >> >> Sent: Wednesday, July 11, 2012 12:59 PM
> >> >> To: general-community
> >> >> Subject: Re: PCI: InterruptAttach() succeeds but handler not called
> >>anyway
> >> >>
> >> >>> Hello,
> >> >>>
> >> >>> your PCIe interface seems to be initialized for MSI operation ( IRQ
> >>=
> >> >>> 112) So try to use it in MSI mode ... Hugh posted resently the
> >>attached
> >> code
> >> >> .
> >> >>> You need QNX 6.5 SP1 ... some structure components used in the
> >>example
> >> >>> are not yet available.
> >> >> Thanks for your fast reply, Armin! Just to be sure: I took much of
> >>my init
> >> >> code from a driver which operates on the following device:
> >> >>
> >> >> Class = Multimedia (Video)
> >> >> Vendor ID = 104ah, STMicroelectronics
> >> >> Device ID = cc0dh, Unknown Unknown
> >> >> <snip>
> >> >> PCI Int Pin = INT...
|
|
|
|
Re: PCI: InterruptAttach() succeeds but handler not called anyway
|
07/11/2012 3:56 PM
post94210
|
Re: PCI: InterruptAttach() succeeds but handler not called anyway
Well the interrupt is bogus. There aren't CPU interrupts in the 0x8000000
range on x86. Please can you slay slogger and the pci-bios or pci-bios-v2
and then run 'slogger -s256k' followed by 'pci-bios -vvv or pci-bios-v2
-vvv'. Once you have done this, please post the output from sloginfo.
Thanks, Hugh.
On 12-07-11 3:46 PM, "Thomas Klein" <community-noreply@qnx.com> wrote:
>> What platform are you running on - ppc?
>
>Intel
>
>>
>> --
>> Hugh Brown
>> QNX Software Systems Limited
>> 1001 Farrar Rd.,
>> Ottawa. ON. K2K 0B3.
>> Telephone: 613-591-0931
>>
>>
>>
>>
>>
>>
>>
>> On 12-07-11 3:34 PM, "Thomas Klein" <community-noreply@qnx.com> wrote:
>>
>> >> Thomas,
>> >>
>> >> the IRQ returned by pci_attach_device is completely nonsens :)
>> >> As a workaround try to use the IRQ number returned by pci -vvv.
>> >
>> >Hmmm ... aren't they quite ... identical? pci -v says
>> >
>> >Class = System Peripherals (Other)
>> >Vendor ID = 10eeh, Xilinx Corporation
>> >Device ID = 1h, EUROCOM for PCI (ECOMP)
>> > <snip>
>> >PCI Int Pin = INT A
>> >Interrupt line = 112
>> >CPU Interrupt = 80020020h <---
>> >
>> >while my driver says
>> >
>> >Jan 01 00:00:07.559.5 17880 00 enableIrqHandler: FPGA attached:
>> >handle=0x806b8e0, Irq=0x80020020 <---
>> >
>> >Or do I have to use the "Interrupt line" value?
>> >
>> >Thomas
>> >
>> >>
>> >> --Armin
>> >>
>> >>
>> >> Thomas Klein wrote:
>> >> >> Do you check the return codes from all the functions to make sure
>> >>that they
>> >>
>> >> >> succeeded?
>> >> > Yes, I do.
>> >> > I had a look at Hugh's code which Armin posted. The only difference
>> >>to what
>> >> I did before is that I now call
>> >> >
>> >> > pci_attach_device(NULL, PCI_INIT_ALL | PCI_INIT_ROM | PCI_SHARE |
>> >> PCI_MASTER_ENABLE | PCI_USE_MSI | PCI_USE_MSIX, 0,
>>&g_fpga.pciDevInfo);
>> >> >
>> >> > I regret, it doesn't make a difference. I still can't see a
>> >>connection
>> >> between irq=0x80020020 and my handler when examining "pidin irq"
>> >>output. Do I
>> >> perhaps miss any steps between pci_attach_device() and
>> >>InterruptAttach()? Any
>> >> explanation why InterruptAttach() returns a reasonable id but still
>>the
>> >> respective pciDevInfo.Irq=0x80020020 doesn't appear in "pidin irq"
>> >>output?
>> >> >
>> >> > Thomas
>> >> >
>> >> >> Steve Reid (stever@qnx.com)
>> >> >> Technical Editor
>> >> >> QNX Software Systems
>> >> >>
>> >> >> -----Original Message-----
>> >> >> From: Thomas Klein [mailto:community-noreply@qnx.com]
>> >> >> Sent: Wednesday, July 11, 2012 12:59 PM
>> >> >> To: general-community
>> >> >> Subject: Re: PCI: InterruptAttach() succeeds but handler not
>>called
>> >>anyway
>> >> >>
>> >> >>> Hello,
>> >> >>>
>> >> >>> your PCIe interface seems to be initialized for MSI operation (
>>IRQ
>> >>=
>> >> >>>...
View Full Message
|
|
|
|
Re: PCI: InterruptAttach() succeeds but handler not called anyway
|
07/11/2012 2:53 PM
post94203
|
Re: PCI: InterruptAttach() succeeds but handler not called anyway
Hello,
the capabilities are set by the board specific, serial configuration
EEPROM and they are diferent from board to board.
If you don't use the PCI_MSI_XXX flags ... the interrupt handling falls
back to the local line interrupts.
But this handling has some problems ... it happens often that
pci_attach_device returns a false IRQ number.
So check the IRQ number returned by pci -vvv and the IRQ number returned
by pci_attach_device.
I cross my fingers ...
--Armin
Thomas Klein wrote:
>> Hello,
>>
>> your PCIe interface seems to be initialized for MSI operation ( IRQ = 112)
>> So try to use it in MSI mode ... Hugh posted resently the attached code.
>> You need QNX 6.5 SP1 ... some structure components used in the example
>> are not yet available.
> Thanks for your fast reply, Armin! Just to be sure: I took much of my init code from a driver
> which operates on the following device:
>
> Class = Multimedia (Video)
> Vendor ID = 104ah, STMicroelectronics
> Device ID = cc0dh, Unknown Unknown
> <snip>
> PCI Int Pin = INT A
> Interrupt line = 104
> CPU Interrupt = 80020018h
> Capabilities Pointer = 44h
> Capability ID = 1h - Power Management
> Capabilities = 803h - 8h
> Capability ID = 10h - PCI Express
> Capabilities = 2h - 8d80h
> Capability ID = 5h - Message Signaled Interrupts
> Capabilities = 81h - fee00000h Enabled
>
> It also seems to use MSIs but is anyway succesfully handling interrupts.
> Do you see a difference between my device and the one mentioned above
> which would explain why they have to be initialized differently?
>
> Thomas
>
>
>
> _______________________________________________
>
> General
> http://community.qnx.com/sf/go/post94199
> To cancel your subscription to this discussion, please e-mail general-community-unsubscribe@community.qnx.com
>
|
|
|
|