> 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
>
> Jan Kiszka wrote:
> > On 2011-03-22 16:55, krishna m wrote:
>
> >> 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...
> >
> >> 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. ]
> >
> >> 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 ?
>
>
> --
> 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);
....
>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
_______________________________________________
Xenomai-core mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-core