RE: next-20130627 breaks i.MX6 sabre sd UART console

From: Thomas Gleixner
Date: Mon Jul 01 2013 - 09:04:30 EST


On Mon, 1 Jul 2013, Stehle Vincent-B46079 wrote:

So up to this point everything looks ok. mxc timer is the broadcast
and the local timer is preferred over the dummy timer.

But after switching the clocksource:

> Switched to clocksource mxc_timer1
> ------------[ cut here ]------------
> WARNING: CPU: 2 PID: 0 at kernel/time/clockevents.c:212 clockevents_program_event+0x134/0x148()

That's when clockevents_program_event() is called with a negative
expiry time.

And its called from:

[<800613f4>] (clockevents_program_event+0x134/0x148) from [<80061900>]
(tick_handle_periodic+0x64/0x88)

Which calculates the expiry value via:

next = ktime_add(dev->next_event, tick_period);

So something is hosed there.

Can you please apply the patch below and provide the output?

Thanks,

tglx
---
diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c
index edd45f6..5617628 100644
--- a/kernel/time/tick-common.c
+++ b/kernel/time/tick-common.c
@@ -94,6 +94,13 @@ void tick_handle_periodic(struct clock_event_device *dev)
*/
next = ktime_add(dev->next_event, tick_period);
for (;;) {
+ if (next.tv64 < 0) {
+ pr_err("next %llx nevt %llx per %llx nxtp %llx now %llx\n",
+ next.tv64, dev->next_event.tv64,
+ tick_period.tv64, tick_next_period.tv64,
+ ktime_get().tv64);
+ }
+
if (!clockevents_program_event(dev, next, false))
return;
/*
--
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/