Skip to contentSkip to conversation

MSI support in Xenomai

Xenomai-core krishna m 3 participants 12 messages Mar 16, 2011 – Mar 29, 2011

lore
Share & tools
lore

krishna m

author
#0 lore raw

Hi All,
I wanted to know if the latest Xenomai [Version xenomai-2.5.6] supports MSI interrupts. I am using the adeos Patch [version adeos-ipipe-2.6.37-x86-2.9-00] and corresponding Linux kernel [version: linux-2.6.37]. I have read in the Xenomai FAQ that MSI is not supported by the ipipe patch just wanted to know if the latest Xenomai and Ipipe supports MSI.

thanks,
Krishna

#1 lore raw
Quoted 6 lines · krishna m

Hi All, I wanted to know if the latest Xenomai [Version xenomai-2.5.6] supports MSI interrupts. I am using the adeos Patch [version adeos-ipipe-2.6.37-x86-2.9-00] and corresponding Linux kernel [version: linux-2.6.37]. I have read in the Xenomai FAQ that MSI is not supported by the ipipe patch just wanted to know if the latest Xenomai and Ipipe supports MSI.

No.

Signature · 1 line
					    Gilles.
#2 lore raw
Quoted 9 lines · Gilles Chanteperdrix
Quoted 6 lines · krishna m

Hi All, I wanted to know if the latest Xenomai [Version xenomai-2.5.6] supports MSI interrupts. I am using the adeos Patch [version adeos-ipipe-2.6.37-x86-2.9-00] and corresponding Linux kernel [version: linux-2.6.37]. I have read in the Xenomai FAQ that MSI is not supported by the ipipe patch just wanted to know if the latest Xenomai and Ipipe supports MSI.

No.

Strictly spoken, but it works in practice. See

http://thread.gmane.org/gmane.linux.real-time.xenomai.users/12135

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
author
#3 lore raw
Quoted 16 lines

Date: Thu, 17 Mar 2011 09:30:37 +0100
From: [email protected]
To: [email protected] [email protected]
CC: [email protected]
Subject: Re: MSI support in Xenomai

Quoted 8 lines · Gilles Chanteperdrix
Quoted 6 lines · krishna m

Hi All, I wanted to know if the latest Xenomai [Version xenomai-2.5.6] supports MSI interrupts. I am using the adeos Patch [version adeos-ipipe-2.6.37-x86-2.9-00] and corresponding Linux kernel [version: linux-2.6.37]. I have read in the Xenomai FAQ that MSI is not supported by the ipipe patch just wanted to know if the latest Xenomai and Ipipe supports MSI.

Quoted 11 lines
Quoted 1 line

No.

Strictly spoken, but it works in practice. See

http://thread.gmane.org/gmane.linux.real-time.xenomai.users/12135

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

Hi Jan,

Thanks for the reply. I got the following info from you post and i had few questions related to this post:

Quoted 1 line
Quoted 1 line

- MSI[-X] usage for RTDM (ie. RT) drivers is basically fine as long as you avoid enabling/disabling from RT context (also used for quite a while here, no known issues under this restriction)

my question is are you mentioninig here that i must not be doing pci_enable_msi() and pci_disable_msi() inside the RTDM driver ? if not then where should these calls be done ?

Right now i have ported my standerd linux driver for the PCIe card to RTDM drvier. This driver uses MSI. I am not enabeling or disabling MSI or IRQ any where in the driver while processing [i.e. in ISR or read/write]. I am enabeling MSI in the PCI Probe and disabeling it in the PCI remove functions. The problem i am facing is as soon as i get the First MSI interrupt the kernel oops and i get the following dump:Mar 21 21:08:34 barch kernel: BUG: unable to handle kernel paging request at 7f45402d

Mar 21 21:08:34 barch kernel: Oops: 0000 [#1] PREEMPT SMP 

[note: The normal linux driver works with out any problem].

Please let me know your thoughts. Also is there an example PCIe RTDM driver using MSI that i can refer to understand more about this topic ?

thanks,
krishna

#4 lore raw
Quoted 34 lines · krishna m
Quoted 19 lines

Date: Thu, 17 Mar 2011 09:30:37 +0100
From: [email protected]
To: [email protected]; [email protected]
CC: [email protected]
Subject: Re: MSI support in Xenomai

Quoted 9 lines · Gilles Chanteperdrix
Quoted 6 lines · krishna m

Hi All, I wanted to know if the latest Xenomai [Version xenomai-2.5.6] supports MSI interrupts. I am using the adeos Patch [version adeos-ipipe-2.6.37-x86-2.9-00] and corresponding Linux kernel [version: linux-2.6.37]. I have read in the Xenomai FAQ that MSI is not supported by the ipipe patch just wanted to know if the latest Xenomai and Ipipe supports MSI.

No.

Strictly spoken, but it works in practice. See

Quoted 7 lines

http://thread.gmane.org/gmane.linux.real-time.xenomai.users/12135

Jan

--
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

Hi Jan,

Thanks for the reply. I got the following info from you post and i had few questions related to this post:

Quoted 7 lines
Quoted 1 line
Quoted 1 line

- MSI[-X] usage for RTDM (ie. RT) drivers is basically fine as long as you

avoid enabling/disabling from RT context (also used for quite a while here, no known issues under this restriction)

my question is are you mentioninig here that i must not be doing pci_enable_msi() and pci_disable_msi() inside the RTDM driver ? if not then where should these calls be done ?

pci_enable/disable_msi are initialization services that only need to be executed over Linux context - also in RTDM drivers.

Quoted 8 lines

Right now i have ported my standerd linux driver for the PCIe card to RTDM drvier. This driver uses MSI. I am not enabeling or disabling MSI or IRQ any where in the driver while processing [i.e. in ISR or read/write]. I am enabeling MSI in the PCI Probe and disabeling it in the PCI remove functions. The problem i am facing is as soon as i get the First MSI interrupt the kernel oops and i get the following dump:

Quoted 4 lines

|Mar 21 21:08:34 barch kernel: BUG: unable to handle kernel paging request at 7f45402d

Mar 21 21:08:34 barch kernel: Oops: 0000 [#1] PREEMPT SMP

|

We would need the full backtrace to have at least a chance to help.

Quoted 5 lines

[note: The normal linux driver works with out any problem].

Please let me know your thoughts. Also is there an example PCIe RTDM driver using MSI that i can refer to understand more about this topic ?

Check RTnet's IGB driver. It works with MSI-X interrupts on x86.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
author
#5 lore raw
Quoted 69 lines

Date: Tue, 22 Mar 2011 13:13:16 +0100
From: [email protected]
To: [email protected]
CC: [email protected] [email protected]
Subject: Re: MSI support in Xenomai

Quoted 34 lines · krishna m
Quoted 19 lines

Date: Thu, 17 Mar 2011 09:30:37 +0100
From: [email protected]
To: [email protected] [email protected]
CC: [email protected]
Subject: Re: MSI support in Xenomai

Quoted 9 lines · Gilles Chanteperdrix
Quoted 6 lines · krishna m

Hi All, I wanted to know if the latest Xenomai [Version xenomai-2.5.6] supports MSI interrupts. I am using the adeos Patch [version adeos-ipipe-2.6.37-x86-2.9-00] and corresponding Linux kernel [version: linux-2.6.37]. I have read in the Xenomai FAQ that MSI is not supported by the ipipe patch just wanted to know if the latest Xenomai and Ipipe supports MSI.

No.

Strictly spoken, but it works in practice. See

Quoted 7 lines

http://thread.gmane.org/gmane.linux.real-time.xenomai.users/12135

Jan

--
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

Hi Jan,

Thanks for the reply. I got the following info from you post and i had few questions related to this post:

Quoted 7 lines
Quoted 1 line
Quoted 1 line

- MSI[-X] usage for RTDM (ie. RT) drivers is basically fine as long as you

avoid enabling/disabling from RT context (also used for quite a while here, no known issues under this restriction)

my question is are you mentioninig here that i must not be doing pci_enable_msi() and pci_disable_msi() inside the RTDM driver ? if not then where should these calls be done ?

pci_enable/disable_msi are initialization services that only need to be executed over Linux context - also in RTDM drivers.

Quoted 8 lines

Right now i have ported my standerd linux driver for the PCIe card to RTDM drvier. This driver uses MSI. I am not enabeling or disabling MSI or IRQ any where in the driver while processing [i.e. in ISR or read/write]. I am enabeling MSI in the PCI Probe and disabeling it in the PCI remove functions. The problem i am facing is as soon as i get the First MSI interrupt the kernel oops and i get the following dump:

Quoted 4 lines

|Mar 21 21:08:34 barch kernel: BUG: unable to handle kernel paging request at 7f45402d

Mar 21 21:08:34 barch kernel: Oops: 0000 [#1] PREEMPT SMP

|

We would need the full backtrace to have at least a chance to help.

Quoted 1 line
Quoted 12 lines
Quoted 4 lines

[note: The normal linux driver works with out any problem].

Please let me know your thoughts. Also is there an example PCIe RTDM driver using MSI that i can refer to understand more about this topic ?

Check RTnet's IGB driver. It works with MSI-X interrupts on x86.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

Hi Jan,
Thanks again for the reply. Here is the full backtrace:

Mar 22 21:12:47 localhost kernel: test_dev: Probe for device function=0
Mar 22 21:12:47 localhost kernel: test_dev 0000:15:00.0: found PCI INT A -> IRQ 10
Mar 22 21:12:47 localhost kernel: pci_bar = 0xfe000000 
Mar 22 21:12:47 localhost kernel: Xenomai: RTDM: RT open handler is deprecated, driver requires update.
Mar 22 21:12:47 localhost kernel: Xenomai: RTDM: RT close handler is deprecated, driver requires update.
Mar 22 21:12:47 localhost kernel: test_dev: IRQ 16 successfully assigned to the device.
Mar 22 21:12:47 localhost kernel: test_dev: Probe for device function=1
Mar 22 21:12:47 localhost kernel: test_dev: Successfully added test_dev Device Driver.
Mar 22 21:13:58 localhost kernel: BUG: unable to handle kernel paging request at d84050c0
Mar 22 21:13:58 localhost kernel: IP: [<c0468f84>] __ipipe_set_irq_pending+0x36/0x49
Mar 22 21:13:58 localhost kernel: *pde = 00000000 
Mar 22 21:13:58 localhost kernel: Oops: 0002 [#1] PREEMPT SMP 
Mar 22 21:13:58 localhost kernel: last sysfs file: /sys/devices/pci0000:00/0000:00:1a.0/0000:1f:00.0/0000:20:05.0/0000:2d:00.0/class
Mar 22 21:13:58 localhost kernel: Modules linked in: test_dev autofs4 hidp l2cap crc16 bluetooth sunrpc ip6t_REJECT xt_tcpudp ip6table_filter ip6_tables x_tables ipv6 snd soundcore sata_sil24 libata sd_mod scsi_mod ext3 jbd uhci_hcd ohci_hcd ehci_hcd [last unloaded: snd_page_alloc]
Mar 22 21:13:58 localhost kernel: 
Mar 22 21:13:58 localhost kernel: Pid: 2414, comm: ptg Not tainted 2.6.37_xenomai-2.5.6 #2 To be filled by O.E.M./To be filled by O.E.M.
Mar 22 21:13:58 localhost kernel: EIP: 0060:[<c0468f84>] EFLAGS: 00010207 CPU: 0
Mar 22 21:13:58 localhost kernel: EIP is at __ipipe_set_irq_pending+0x36/0x49
Mar 22 21:13:58 localhost kernel: EAX: 07ffffff EBX: ffffffff ECX: d74050c0 EDX: c08bc6c0
Mar 22 21:13:58 localhost kernel: ESI: c08bc640 EDI: ffffffc0 EBP: c08bc644 ESP: d69a9f8c
Mar 22 21:13:58 localhost kernel:  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
Mar 22 21:13:58 localhost kernel: Process ptg (pid: 2414, ti=d69a8000 task=d6b2a920 task.ti=d69a8000)
Mar 22 21:13:58 localhost kernel: I-pipe domain Linux
Mar 22 21:13:58 localhost kernel: Stack:
Mar 22 21:13:58 localhost kernel:  ffffffff c0416272 d69a9fb4 00000000 c088f180 00000000 00000001 00000001
Mar 22 21:13:58 localhost kernel:  bfa2e138 c0402c69 00000000 00000000 88000000 00000001 00000001 bfa2e138
Mar 22 21:13:58 localhost kernel:  b781e000 0000007b 0000007b 00000000 00000000 ffffffd7 0804b20a 00000073
Mar 22 21:13:58 localhost kernel: Call Trace:
Mar 22 21:13:58 localhost kernel:  [<c0416272>] ? __ipipe_handle_irq+0xf4/0x212
Mar 22 21:13:58 localhost kernel:  [<c0402c69>] ? common_interrupt+0x29/0x38
Mar 22 21:13:58 localhost kernel: Code: e0 b3 82 c0 01 d1 69 10 a0 09 00 00 01 d1 9c 5a 89 da c1 e2 06 8d 94 02 c0 00 00 00 8b 02 a8 20 75 0f 0f ab 59 08 89 d8 c1 e8 05 <0f> ab 41 04 eb 04 0f ab 59 50 ff 84 99 98 00 00 00 5b c3 57 56 
Mar 22 21:13:58 localhost kernel: EIP: [<c0468f84>] __ipipe_set_irq_pending+0x36/0x49 SS:ESP 0068:d69a9f8c
Mar 22 21:13:58 localhost kernel: CR2: 00000000d84050c0
Mar 22 21:13:58 localhost kernel: ---[ end trace 872caaf8551a0ced ]---

Please let me know your inputs.

thanks,
krishna

#6 lore raw
Quoted 84 lines · krishna m
Quoted 45 lines

Date: Tue, 22 Mar 2011 13:13:16 +0100
From: [email protected]
To: [email protected]
CC: [email protected]; [email protected]
Subject: Re: MSI support in Xenomai

Quoted 38 lines · krishna m
Quoted 19 lines

Date: Thu, 17 Mar 2011 09:30:37 +0100
From: [email protected]
To: [email protected]; [email protected]
CC: [email protected]
Subject: Re: MSI support in Xenomai

Quoted 9 lines · Gilles Chanteperdrix
Quoted 6 lines · krishna m

Hi All, I wanted to know if the latest Xenomai [Version xenomai-2.5.6] supports MSI interrupts. I am using the adeos Patch [version adeos-ipipe-2.6.37-x86-2.9-00] and corresponding Linux kernel [version: linux-2.6.37]. I have read in the Xenomai FAQ that MSI is not supported by the ipipe patch just wanted to know if the latest Xenomai and Ipipe supports MSI.

No.

Strictly spoken, but it works in practice. See

Quoted 7 lines

http://thread.gmane.org/gmane.linux.real-time.xenomai.users/12135

Jan

--
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

Hi Jan,

Thanks for the reply. I got the following info from you post and i had few questions related to this post:

Quoted 1 line
Quoted 1 line

- MSI[-X] usage for RTDM (ie. RT) drivers is basically fine as long as you

avoid enabling/disabling from RT context (also used for quite a while here, no known issues under this restriction)

Quoted 11 lines
Quoted 3 lines

my question is are you mentioninig here that i must not be doing pci_enable_msi() and pci_disable_msi() inside the RTDM driver ? if not then where should these calls be done ?

pci_enable/disable_msi are initialization services that only need to be executed over Linux context - also in RTDM drivers.

Quoted 4 lines

Right now i have ported my standerd linux driver for the PCIe card to RTDM drvier. This driver uses MSI. I am not enabeling or disabling MSI or IRQ any where in the driver while processing [i.e. in ISR or read/write]. I am

enabeling

Quoted 1 line
Quoted 1 line

MSI in the PCI Probe and disabeling it in the PCI remove functions. The

problem

Quoted 4 lines
Quoted 4 lines

i am facing is as soon as i get the First MSI interrupt the kernel oops and i get the following dump:

|Mar 21 21:08:34 barch kernel: BUG: unable to handle kernel paging request

at 7f45402d

Quoted 12 lines
Quoted 3 lines
Mar 21 21:08:34 barch kernel: Oops: 0000 [#1] PREEMPT SMP

|

We would need the full backtrace to have at least a chance to help.

Quoted 5 lines

[note: The normal linux driver works with out any problem].

Please let me know your thoughts. Also is there an example PCIe RTDM driver using MSI that i can refer to understand more about this topic ?

Quoted 7 lines

Check RTnet's IGB driver. It works with MSI-X interrupts on x86.

Jan

--
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

Quoted 5 lines

Hi Jan,
Thanks again for the reply. Here is the full backtrace:

Mar 22 21:12:47 localhost kernel: test_dev: Probe for device function=0
Mar 22 21:12:47 localhost kernel: test_dev 0000:15:00.0: found PCI INT A -> IRQ 10

Here you get IRQ 10...

Quoted 5 lines
Mar 22 21:12:47 localhost kernel: pci_bar = 0xfe000000
Mar 22 21:12:47 localhost kernel: Xenomai: RTDM: RT open handler is deprecated, 
driver requires update.
Mar 22 21:12:47 localhost kernel: Xenomai: RTDM: RT close handler is deprecated, 

driver requires update.

[ These messages also have a meaning, though unrelated to the crash. ]

Quoted 2 lines
Mar 22 21:12:47 localhost kernel: test_dev: IRQ 16 successfully assigned to the 

device.

...but here IRQ 16 is assigned. Broken output or a real inconsistency?

Also, where is the MSI? You should see log messages about MSI/MSI-X IRQ number assignment when properly enabling the support at PCI level.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
#7 lore raw
Quoted 15 lines · Jan Kiszka
Quoted 2 lines · krishna m
Mar 22 21:12:47 localhost kernel: test_dev: Probe for device function=0
Mar 22 21:12:47 localhost kernel: test_dev 0000:15:00.0: found PCI INT A -> IRQ 10

Here you get IRQ 10...

Quoted 5 lines
Mar 22 21:12:47 localhost kernel: pci_bar = 0xfe000000
Mar 22 21:12:47 localhost kernel: Xenomai: RTDM: RT open handler is deprecated, 
driver requires update.
Mar 22 21:12:47 localhost kernel: Xenomai: RTDM: RT close handler is deprecated, 

driver requires update.

[ These messages also have a meaning, though unrelated to the crash. ]

Quoted 7 lines
Quoted 2 lines
Mar 22 21:12:47 localhost kernel: test_dev: IRQ 16 successfully assigned to the 

device.

...but here IRQ 16 is assigned. Broken output or a real inconsistency?

Also, where is the MSI? You should see log messages about MSI/MSI-X IRQ number assignment when properly enabling the support at PCI level.

Maybe pci_enable_msi was called after request_irq ?

Signature · 1 line
					    Gilles.
author
#8 lore raw
Quoted 26 lines

Date: Tue, 22 Mar 2011 18:03:43 +0100
From: [email protected]
To: [email protected]
CC: [email protected] [email protected]
Subject: Re: MSI support in Xenomai

Quoted 18 lines · Jan Kiszka
Quoted 2 lines · krishna m
Mar 22 21:12:47 localhost kernel: test_dev: Probe for device function=0
Mar 22 21:12:47 localhost kernel: test_dev 0000:15:00.0: found PCI INT A -> IRQ 10

Here you get IRQ 10...

Quoted 5 lines
Mar 22 21:12:47 localhost kernel: pci_bar = 0xfe000000
Mar 22 21:12:47 localhost kernel: Xenomai: RTDM: RT open handler is deprecated, 
driver requires update.
Mar 22 21:12:47 localhost kernel: Xenomai: RTDM: RT close handler is deprecated, 

driver requires update.

[ These messages also have a meaning, though unrelated to the crash. ]

Quoted 2 lines
Mar 22 21:12:47 localhost kernel: test_dev: IRQ 16 successfully assigned to the 

device.

Quoted 10 lines
Quoted 4 lines

...but here IRQ 16 is assigned. Broken output or a real inconsistency?

Also, where is the MSI? You should see log messages about MSI/MSI-X IRQ number assignment when properly enabling the support at PCI level.

Maybe pci_enable_msi was called after request_irq ?

Signature · 1 line
Gilles.

Just check my code:
i do enable MSI (pci_enable_msi) before rtdm_irq_request pasted the code below part of my PCI probe function in the device driver:

......
rtdm_dev = kmalloc(sizeof(struct rtdm_device), GFP_KERNEL);
if(!rtdm_dev) {
printk(KERN_WARNING "RUBICON: kmalloc failed\n"); ret = -ENOMEM; //Insufficient storage space is available. goto fail_pci;
}

//copy the structure to the new memory
memcpy(rtdm_dev, &rubicon_rtdm_driver, sizeof(struct rtdm_device));

  //create filename
  snprintf(rtdm_dev->device_name,
           RTDM_MAX_DEVNAME_LEN, "rtser%d", 0 /*i*/);
  rtdm_dev->device_id = 0; //i;

//define two other members of the rtdm_device structure rtdm_dev->proc_name = rtdm_dev->device_name;

  ret = rtdm_dev_register(rtdm_dev);
  if(ret < 0) {
   printk(KERN_WARNING"RUBICON: cannot register device\n");
   goto fail_pci;
  }
  g_rubicon_context.xen_device = rtdm_dev;
 
  ret = pci_enable_msi(dev);
  if(ret) {
   printk("RUBICON: Enabling MSI failed wuth error code: 0x%x\n", ret);
   goto fail_pci;
  }

g_rubicon_context.irq = dev->irq; /* save the allocated IRQ */ g_rubicon_context.dev = dev; /* Save the PCI queue h/w device ctx */ dev_set_drvdata(dev,(void *) &(g_rubicon_context));
/* request the irq for the device */
ret = rtdm_irq_request(&g_rubicon_context.irq_handle,

                         g_rubicon_context.irq,
                         rubicon_irq_handler,
                         RTDM_IRQTYPE_SHARED,
                         "rubicon",
                         (void *)&g_rubicon_context);

....

Quoted 1 line

From IRQ number perspective:

Mar 22 21:12:47 localhost kernel: test_dev 0000:15:00.0: found PCI INT A -> IRQ 10  >>>> is the print from the Kernel PCI Probe and 
Mar 22 21:12:47 localhost kernel: test_dev: IRQ 16 successfully assigned >>>>>> is my Print after enabling MSI and registering for irq.

I get the similar print with the Plain Linux kernel with the IRQ being assigned MSI enabled is irq 20. [Below i have pasted the kernel log of plain linux kernel]. I have tested the MSI interrupts and they work fine.

Mar 22 23:47:49 localhost kernel: test_dev: Probe for device function=0
Mar 22 23:47:49 localhost kernel: test_dev 0000:15:00.0: found PCI INT A -> IRQ 10
Mar 22 23:47:49 localhost kernel: pci_bar = 0xfe000000 
Mar 22 23:47:49 localhost kernel: test_dev: IRQ 20 successfully assigned to the device.
Mar 22 23:47:49 localhost kernel: test_dev: Probe for device function=1
Mar 22 23:47:49 localhost kernel: test_dev: Successfully added test_dev Device Driver.

thanks
-krishna

author
#9 lore raw

From: [email protected]
To: [email protected] [email protected]
Date: Tue, 22 Mar 2011 23:50:27 +0530
CC: [email protected]
Subject: Re: [Xenomai-core] MSI support in Xenomai

Quoted 25 lines

Date: Tue, 22 Mar 2011 18:03:43 +0100
From: [email protected]
To: [email protected]
CC: [email protected] [email protected]
Subject: Re: MSI support in Xenomai

Quoted 18 lines · Jan Kiszka
Quoted 2 lines · krishna m
Mar 22 21:12:47 localhost kernel: test_dev: Probe for device function=0
Mar 22 21:12:47 localhost kernel: test_dev 0000:15:00.0: found PCI INT A -> IRQ 10

Here you get IRQ 10...

Quoted 5 lines
Mar 22 21:12:47 localhost kernel: pci_bar = 0xfe000000
Mar 22 21:12:47 localhost kernel: Xenomai: RTDM: RT open handler is deprecated, 
driver requires update.
Mar 22 21:12:47 localhost kernel: Xenomai: RTDM: RT close handler is deprecated, 

driver requires update.

[ These messages also have a meaning, though unrelated to the crash. ]

Quoted 2 lines
Mar 22 21:12:47 localhost kernel: test_dev: IRQ 16 successfully assigned to the 

device.

Quoted 10 lines
Quoted 4 lines

...but here IRQ 16 is assigned. Broken output or a real inconsistency?

Also, where is the MSI? You should see log messages about MSI/MSI-X IRQ number assignment when properly enabling the support at PCI level.

Maybe pci_enable_msi was called after request_irq ?

Signature · 1 line
Gilles.

Just check my code:
i do enable MSI (pci_enable_msi) before rtdm_irq_request pasted the code below part of my PCI probe function in the device driver:

......
rtdm_dev = kmalloc(sizeof(struct rtdm_device), GFP_KERNEL);
if(!rtdm_dev) {
printk(KERN_WARNING "RUBICON: kmalloc failed\n"); ret = -ENOMEM; //Insufficient storage space is available. goto fail_pci;
}

//copy the structure to the new memory
memcpy(rtdm_dev, &rubicon_rtdm_driver, sizeof(struct rtdm_device));

  //create filename
  snprintf(rtdm_dev->device_name,
           RTDM_MAX_DEVNAME_LEN, "rtser%d", 0 /*i*/);
  rtdm_dev->device_id = 0; //i;

//define two other members of the rtdm_device structure rtdm_dev->proc_name = rtdm_dev->device_name;

  ret = rtdm_dev_register(rtdm_dev);
  if(ret < 0) {
   printk(KERN_WARNING"RUBICON: cannot register device\n");
   goto fail_pci;
  }
  g_rubicon_context.xen_device = rtdm_dev;
 
  ret = pci_enable_msi(dev);
  if(ret) {
   printk("RUBICON: Enabling MSI failed wuth error code: 0x%x\n", ret);
   goto fail_pci;
  }

g_rubicon_context.irq = dev->irq; /* save the allocated IRQ */ g_rubicon_context.dev = dev; /* Save the PCI queue h/w device ctx */ dev_set_drvdata(dev,(void *) &(g_rubicon_context));
/* request the irq for the device */
ret = rtdm_irq_request(&g_rubicon_context.irq_handle,

                         g_rubicon_context.irq,
                         rubicon_irq_handler,
                         RTDM_IRQTYPE_SHARED,
                         "rubicon",
                         (void *)&g_rubicon_context);

....

Quoted 1 line

From IRQ number perspective:

Mar 22 21:12:47 localhost kernel: test_dev 0000:15:00.0: found PCI INT A -> IRQ 10  >>>> is the print from the Kernel PCI Probe and 
Mar 22 21:12:47 localhost kernel: test_dev: IRQ 16 successfully assigned >>>>>> is my Print after enabling MSI and registering for irq.

I get the similar print with the Plain Linux kernel with the IRQ being assigned MSI enabled is irq 20. [Below i have pasted the kernel log of plain linux kernel]. I have tested the MSI interrupts and they work fine.

Mar 22 23:47:49 localhost kernel: test_dev: Probe for device function=0
Mar 22 23:47:49 localhost kernel: test_dev 0000:15:00.0: found PCI INT A -> IRQ 10
Mar 22 23:47:49 localhost kernel: pci_bar = 0xfe000000 
Mar 22 23:47:49 localhost kernel: test_dev: IRQ 20 successfully assigned to the device.
Mar 22 23:47:49 localhost kernel: test_dev: Probe for device function=1
Mar 22 23:47:49 localhost kernel: test_dev: Successfully added test_dev Device Driver.

Just wanted to add 3 more questions:
1. Which versions of Linux, Adeos patch and xenomai are tested for stable MSI functionality ? Please let me know.
2. I am using the Xenomai Version linux-2.6.37, xenomai-2.5.6 and adeos-ipipe-2.6.37-x86-2.9-00. Is this combination fine ?
3. I looked at the /proc/interrupts and with out xenomai loaded [i.e. default linux kernel] I see my card beaing assigned MSI-EDGE interrupt and with xenomai kernel i don't see the entry in the /proc/interrupts but in /proc/xenomai/irq i see this entry
IRQ CPU0

16:              0       test_drv
521:             0       [IPI]
524:        869467       [timer]
525:             0       [critical sync]
546:             0       [virtual]

thanks
-krishna

_______________________________________________ Xenomai-core mailing list [email protected] https://mail.gna.org/listinfo/xenomai-core

author
#10 lore raw

rom: [email protected]
To: [email protected] [email protected]
CC: [email protected]
Subject: RE: [Xenomai-core] MSI support in Xenomai
Date: Fri, 25 Mar 2011 17:51:06 +0530

From: [email protected]
To: [email protected] [email protected]
Date: Tue, 22 Mar 2011 23:50:27 +0530
CC: [email protected]
Subject: Re: [Xenomai-core] MSI support in Xenomai

Quoted 25 lines

Date: Tue, 22 Mar 2011 18:03:43 +0100
From: [email protected]
To: [email protected]
CC: [email protected] [email protected]
Subject: Re: MSI support in Xenomai

Quoted 18 lines · Jan Kiszka
Quoted 2 lines · krishna m
Mar 22 21:12:47 localhost kernel: test_dev: Probe for device function=0
Mar 22 21:12:47 localhost kernel: test_dev 0000:15:00.0: found PCI INT A -> IRQ 10

Here you get IRQ 10...

Quoted 5 lines
Mar 22 21:12:47 localhost kernel: pci_bar = 0xfe000000
Mar 22 21:12:47 localhost kernel: Xenomai: RTDM: RT open handler is deprecated, 
driver requires update.
Mar 22 21:12:47 localhost kernel: Xenomai: RTDM: RT close handler is deprecated, 

driver requires update.

[ These messages also have a meaning, though unrelated to the crash. ]

Quoted 2 lines
Mar 22 21:12:47 localhost kernel: test_dev: IRQ 16 successfully assigned to the 

device.

Quoted 10 lines
Quoted 4 lines

...but here IRQ 16 is assigned. Broken output or a real inconsistency?

Also, where is the MSI? You should see log messages about MSI/MSI-X IRQ number assignment when properly enabling the support at PCI level.

Maybe pci_enable_msi was called after request_irq ?

Signature · 1 line
Gilles.

Just check my code:
i do enable MSI (pci_enable_msi) before rtdm_irq_request pasted the code below part of my PCI probe function in the device driver:

......
rtdm_dev = kmalloc(sizeof(struct rtdm_device), GFP_KERNEL);
if(!rtdm_dev) {
printk(KERN_WARNING "RUBICON: kmalloc failed\n"); ret = -ENOMEM; //Insufficient storage space is available. goto fail_pci;
}

//copy the structure to the new memory
memcpy(rtdm_dev, &rubicon_rtdm_driver, sizeof(struct rtdm_device));

  //create filename
  snprintf(rtdm_dev->device_name,
           RTDM_MAX_DEVNAME_LEN, "rtser%d", 0 /*i*/);
  rtdm_dev->device_id = 0; //i;

//define two other members of the rtdm_device structure rtdm_dev->proc_name = rtdm_dev->device_name;

  ret = rtdm_dev_register(rtdm_dev);
  if(ret < 0) {
   printk(KERN_WARNING"RUBICON: cannot register device\n");
   goto fail_pci;
  }
  g_rubicon_context.xen_device = rtdm_dev;
 
  ret = pci_enable_msi(dev);
  if(ret) {
   printk("RUBICON: Enabling MSI failed wuth error code: 0x%x\n", ret);
   goto fail_pci;
  }

g_rubicon_context.irq = dev->irq; /* save the allocated IRQ */ g_rubicon_context.dev = dev; /* Save the PCI queue h/w device ctx */ dev_set_drvdata(dev,(void *) &(g_rubicon_context));
/* request the irq for the device */
ret = rtdm_irq_request(&g_rubicon_context.irq_handle,

                         g_rubicon_context.irq,
                         rubicon_irq_handler,
                         RTDM_IRQTYPE_SHARED,
                         "rubicon",
                         (void *)&g_rubicon_context);

....

Quoted 1 line

From IRQ number perspective:

Mar 22 21:12:47 localhost kernel: test_dev 0000:15:00.0: found PCI INT A -> IRQ 10  >>>> is the print from the Kernel PCI Probe and 
Mar 22 21:12:47 localhost kernel: test_dev: IRQ 16 successfully assigned >>>>>> is my Print after enabling MSI and registering for irq.

I get the similar print with the Plain Linux kernel with the IRQ being assigned MSI enabled is irq 20. [Below i have pasted the kernel log of plain linux kernel]. I have tested the MSI interrupts and they work fine.

Mar 22 23:47:49 localhost kernel: test_dev: Probe for device function=0
Mar 22 23:47:49 localhost kernel: test_dev 0000:15:00.0: found PCI INT A -> IRQ 10
Mar 22 23:47:49 localhost kernel: pci_bar = 0xfe000000 
Mar 22 23:47:49 localhost kernel: test_dev: IRQ 20 successfully assigned to the device.
Mar 22 23:47:49 localhost kernel: test_dev: Probe for device function=1
Mar 22 23:47:49 localhost kernel: test_dev: Successfully added test_dev Device Driver.

Just wanted to add 3 more questions:
1. Which versions of Linux, Adeos patch and xenomai are tested for stable MSI functionality ? Please let me know.
2. I am using the Xenomai Version linux-2.6.37, xenomai-2.5.6 and adeos-ipipe-2.6.37-x86-2.9-00. Is this combination fine ?
3. I looked at the /proc/interrupts and with out xenomai loaded [i.e. default linux kernel] I see my card beaing assigned MSI-EDGE interrupt and with xenomai kernel i don't see the entry in the /proc/interrupts but in /proc/xenomai/irq i see this entry
IRQ CPU0

16:              0       test_drv
521:             0       [IPI]
524:        869467       [timer]
525:             0       [critical sync]
546:             0       [virtual]

Hi Jan and Chanteperdrix,
Any thoughts or inputs on my updates of MSI not working ?

Thanks and Regards,
Krishna

_______________________________________________ Xenomai-core mailing list [email protected] https://mail.gna.org/listinfo/xenomai-core

#11 lore raw
Quoted 5 lines · krishna m

Just wanted to add 3 more questions:
1. Which versions of Linux, Adeos patch and xenomai are tested for stable MSI functionality ? Please let me know.
2. I am using the Xenomai Version linux-2.6.37, xenomai-2.5.6 and adeos-ipipe-2.6.37-x86-2.9-00. Is this combination fine ?
3. I looked at the /proc/interrupts and with out xenomai loaded [i.e. default linux kernel] I see my card beaing assigned MSI-EDGE interrupt and with xenomai kernel i don't see the entry in the /proc/interrupts but in /proc/xenomai/irq i see this entry
IRQ CPU0

Quoted 8 lines
16:              0       test_drv
521:             0       [IPI]
524:        869467       [timer]
525:             0       [critical sync]
546:             0       [virtual]

Hi Jan and Chanteperdrix,
Any thoughts or inputs on my updates of MSI not working ?

Ok. Since you are asking me directly I am going to answer:
my point of view is, as I already told you, that MSI are not supported, so still from my point of view the answer to question 1 is: "none"

Question 2 is yes, it is fine, but since MSI is not supported, it is not supposed to work.

Answer to question 3 is that /proc/interrupts shows the interrupts registered with request_irq whereas /proc/xenomai/irq shows the interrupts which have been registered by xnintr_init, which rtdm_request_irq uses. So, this is not the same code, the two files do not have the same layout.

The reason why I did not answer is that Jan probably has a different point of view for question 1, so, I let him answer you. But as far as I know, Jan asked you some questions, in answer to your last post, to which you did not answer.

Signature · 1 line
					    Gilles.