RE: [PATCH 1/1] [ARM] ep93xx clockevent support

From: H Hartley Sweeten
Date: Thu Jul 30 2009 - 18:49:38 EST


On Thursday, July 30, 2009 3:18 PM, H Hartley Sweeten wrote:
>> From: Ahmed Ammar <aammar@xxxxxxxxxxxxxxx>
>>
>> Based on previous work by Thomas Gleixner.
>>
>> Signed-off-by: Ahmed Ammar <aammar@xxxxxxxxxxxxxxx>
>
> Hmm.. With kernel 2.6.30.2 this does not build. See below.

Oops.. My bad. One of the issues was my fault...

[snip]

>> static irqreturn_t ep93xx_timer_interrupt(int irq, void *dev_id)
>> {
>> - __raw_writel(1, EP93XX_TIMER1_CLEAR);
>> - while ((signed long)
>> - (__raw_readl(EP93XX_TIMER4_VALUE_LOW) - last_jiffy_time)
>> - >= TIMER4_TICKS_PER_JIFFY) {
>> - last_jiffy_time += TIMER4_TICKS_PER_JIFFY;
>> - timer_tick();
>> - }
>> -
>> + struct clock_event_device *evt = dev_id;
>> + __raw_writel(EP93XX_TC_CLEAR, EP93XX_TIMER1_CLEAR);
>> + evt->event_handler(evt);
>
> Here I get "error: dereferencing pointer to incomplete type"

I added a typo that caused this... ;-)

[snip]

>> - setup_irq(IRQ_EP93XX_TIMER1, &ep93xx_timer_irq);
>> +cycle_t ep93xx_get_cycles(void)
>> +{
>> + return __raw_readl(EP93XX_TIMER4_VALUE_LOW);
>> }
>>
>> -static unsigned long ep93xx_gettimeoffset(void)
>> +static struct clocksource clocksource_ep93xx = {
>> + .name = "ep93xx_timer4",
>> + .rating = 200,
>> + .read = ep93xx_get_cycles,
>
> Here I get "warning: initialization from incompatible pointer type"

This one is real.

The read callback is supposed to be:

cycle_t (*read)(struct clocksource *cs);

You need to fix the ep93xx_get_cycles() function and the call below.

>> + .mask = 0xFFFFFFFF,
>> + .shift = 20,
>> + .flags = CLOCK_SOURCE_IS_CONTINUOUS,
>> +};
>> +
>> +/*
>> + * Returns current time from boot in nsecs. It's OK for this to wrap
>> + * around for now, as it's just a relative time stamp.
>> + */
>> +unsigned long long sched_clock(void)
>> {
>> - int offset;
>> + return cyc2ns(&clocksource_ep93xx, ep93xx_get_cycles());

Here.

Regards,
Hartley
--
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/