Re: [PATCH 08/57] microblaze_v7: Interrupt handling, timer support,selfmod code

From: Thomas Gleixner
Date: Fri Mar 20 2009 - 05:59:02 EST


On Fri, 20 Mar 2009, Michal Simek wrote:

> Thomas,
>
> just one other question.
> For me will be useful to use second timer which is inside timer IP core.
> There are two timers with one interrupt line. And I can of course resolve which
> counter cause it. That's no problem.
>
> My question is about timer_irqaction where is dev_id. What should be there?
> Point to clocksource structure or clockevent?
>
> static struct irqaction timer_irqaction = {
> .handler = timer_interrupt,
> .flags = IRQF_DISABLED | IRQF_TIMER,
> .name = "timer",
> .dev_id = &clocksource_microblaze,
> };

The clockevent of course. It's the one which emits the interrupts.

Just for clarification. The clocksource is basically a counter to read
out the current time. Such a counter usually does not deliver
interrupts. It wraps at some point, but that is handled by the generic
time keeping code. If you setup the 32 bit counter to count up and let
it run free then the counter will wrap from 0xffffffff to 0. Nothing
you have to worry about. You just provide a function to read it.

The clockevent is the device which delivers either periodic or oneshot
interrupts. Sa you dont have to worry about the shared interrupt line
in that case.

Thanks,

tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/