Shared hardware interrupt problem with Linux

Shared hardware interrupt problem with Linux

am 26.05.2006 14:58:37 von sujith sankar

Hi All,

Our team is developing a USB OTG Controller driver for Linux 2.6.16.11
kernel on a board which runs on ARM Core . The driver is for ARC USB
OTG Controller.

There are three modules involved viz
Host Controller Driver
Device Controller Driver
OTG Controller Driver
These three modules are sharing the same device space.

We are trying to integrate the three modules.
The modules are initialized and ISRs (shared interrupt handlers) are
registered.
Initially, interrupts are received and ISRs are invoked. But when one
of the modules try to reset the controller, the interrupts no longer
come eventhough the interrupts are enabled in the hardware registers.
We also found out that the interrupt vector controller registers the
USB interrupt.

We tried running a stand-alone code which does similar operations.
But, we are getting the interrupts even after repeated resets. So
that makes it clear that the problem is not with the hardware.

In Linux, the three modules use the same remapped controller address
space and IRQ resources. Since the controller can work as a host
controller, device controller or OTG controller, we have introduced
three platform device structures and three resource
structures in the ARCH/ARM/Machine specific directory. All the three
resource structures have the same iomem start and IRQ start values.

/* USB OTG */
static struct resource ab300_usb_otg_resources [] = {
[0] = {
.start = USB_PHYS,
.end = (USB_PHYS + SZ_4K - 1),
.flags = IORESOURCE_MEM,
},
[1] = {
.start = IRQ_USB,
.end = IRQ_USB,
.flags = IORESOURCE_IRQ,
},
};

static struct platform_device ab300_usb_otg_device = {
.name = "ab300_otg_usb",
.id = 0,
.dev = {
.dma_mask = (u64 *)~0,
.coherent_dma_mask = (u64)~0,
},
.num_resources = ARRAY_SIZE (ab300_usb_otg_resources),
.resource = ab300_usb_otg_resources,
};
/* USB UDC */
static struct resource ab300_usb_udc_resources [] = {
[0] = {
.start = USB_PHYS,
.end = (USB_PHYS + SZ_4K - 1),
.flags = IORESOURCE_MEM,
},
[1] = {
.start = IRQ_USB,
.end = IRQ_USB,
.flags = IORESOURCE_IRQ,
},
};

static struct platform_device ab300_usb_udc_device = {
.name = "ab300_udc_usb",
.id = 1,
.dev = {
.dma_mask = (u64 *)~0,
.coherent_dma_mask = (u64)~0,
},
.num_resources = ARRAY_SIZE (ab300_usb_udc_resources),
.resource = ab300_usb_udc_resources,
};

/* USB EHCI */
static struct resource ab300_usb_host_resources [] = {
[0] = {
.start = USB_PHYS,
.end = (USB_PHYS + SZ_4K - 1),
.flags = IORESOURCE_MEM,
},
[1] = {
.start = IRQ_USB,
.end = IRQ_USB,
.flags = IORESOURCE_IRQ,
},
};

static struct platform_device ab300_usb_host_device = {
.name = "ab300_ehci_usb",
.id = 0,
.dev = {
.dma_mask = (u64 *)~0,
.coherent_dma_mask = (u64)~0,
},
.num_resources = ARRAY_SIZE (ab300_usb_host_resources),
.resource = ab300_usb_host_resources,
};

static struct platform_device *ab300_platform_devs[] __initdata = {
#if defined (CONFIG_MACH_AB300)
&ab300_usb_otg_device,
&ab300_usb_udc_device,
&ab300_usb_host_device,
};

The above code snippet was added so that our driver modules can
request resources in their respective module initialization.

Can the problem be of kernel porting?

Could anyone throw some light on the root cause of the problem?

Thanks,
Sujith
-
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: Shared hardware interrupt problem with Linux

am 26.05.2006 15:47:49 von Scott Taylor

Dewd,

This is the Admin list, not really a driver dev. list. There are many
lists for kernel.org, you may want to check some of the others out, like
"linux-kernel" for a more apropos answer.

Have a look around: http://vger.kernel.org/vger-lists.html

On Fri, May 26, 2006 05:58, sujith sankar wrote:
> Hi All,
>
> Our team is developing a USB OTG Controller driver for Linux 2.6.16.11
> kernel on a board which runs on ARM Core . The driver is for ARC USB
> OTG Controller.
>
> There are three modules involved viz
> Host Controller Driver
> Device Controller Driver
> OTG Controller Driver
> These three modules are sharing the same device space.
>
> We are trying to integrate the three modules.
> The modules are initialized and ISRs (shared interrupt handlers) are
> registered.
> Initially, interrupts are received and ISRs are invoked. But when one
> of the modules try to reset the controller, the interrupts no longer
> come eventhough the interrupts are enabled in the hardware registers.
> We also found out that the interrupt vector controller registers the
> USB interrupt.
>
> We tried running a stand-alone code which does similar operations.
> But, we are getting the interrupts even after repeated resets. So
> that makes it clear that the problem is not with the hardware.
>
> In Linux, the three modules use the same remapped controller address
> space and IRQ resources. Since the controller can work as a host
> controller, device controller or OTG controller, we have introduced
> three platform device structures and three resource
> structures in the ARCH/ARM/Machine specific directory. All the three
> resource structures have the same iomem start and IRQ start values.
>
> /* USB OTG */
> static struct resource ab300_usb_otg_resources [] = {
> [0] = {
> .start = USB_PHYS,
> .end = (USB_PHYS + SZ_4K - 1),
> .flags = IORESOURCE_MEM,
> },
> [1] = {
> .start = IRQ_USB,
> .end = IRQ_USB,
> .flags = IORESOURCE_IRQ,
> },
> };
>
> static struct platform_device ab300_usb_otg_device = {
> .name = "ab300_otg_usb",
> .id = 0,
> .dev = {
> .dma_mask = (u64 *)~0,
> .coherent_dma_mask = (u64)~0,
> },
> .num_resources = ARRAY_SIZE (ab300_usb_otg_resources),
> .resource = ab300_usb_otg_resources,
> };
> /* USB UDC */
> static struct resource ab300_usb_udc_resources [] = {
> [0] = {
> .start = USB_PHYS,
> .end = (USB_PHYS + SZ_4K - 1),
> .flags = IORESOURCE_MEM,
> },
> [1] = {
> .start = IRQ_USB,
> .end = IRQ_USB,
> .flags = IORESOURCE_IRQ,
> },
> };
>
> static struct platform_device ab300_usb_udc_device = {
> .name = "ab300_udc_usb",
> .id = 1,
> .dev = {
> .dma_mask = (u64 *)~0,
> .coherent_dma_mask = (u64)~0,
> },
> .num_resources = ARRAY_SIZE (ab300_usb_udc_resources),
> .resource = ab300_usb_udc_resources,
> };
>
> /* USB EHCI */
> static struct resource ab300_usb_host_resources [] = {
> [0] = {
> .start = USB_PHYS,
> .end = (USB_PHYS + SZ_4K - 1),
> .flags = IORESOURCE_MEM,
> },
> [1] = {
> .start = IRQ_USB,
> .end = IRQ_USB,
> .flags = IORESOURCE_IRQ,
> },
> };
>
> static struct platform_device ab300_usb_host_device = {
> .name = "ab300_ehci_usb",
> .id = 0,
> .dev = {
> .dma_mask = (u64 *)~0,
> .coherent_dma_mask = (u64)~0,
> },
> .num_resources = ARRAY_SIZE (ab300_usb_host_resources),
> .resource = ab300_usb_host_resources,
> };
>
> static struct platform_device *ab300_platform_devs[] __initdata = {
> #if defined (CONFIG_MACH_AB300)
> &ab300_usb_otg_device,
> &ab300_usb_udc_device,
> &ab300_usb_host_device,
> };
>
> The above code snippet was added so that our driver modules can
> request resources in their respective module initialization.
>
> Can the problem be of kernel porting?
>
> Could anyone throw some light on the root cause of the problem?
>
> Thanks,
> Sujith
> -
> To unsubscribe from this list: send the line "unsubscribe linux-admin" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>


--
Scott

-
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html