Re: [2.6.31-git17] WARNING: at kernel/hrtimer.c:648 hres_timers_resume+0x40/0x50()/WARNING: at drivers/base/sys.c:353 __sysdev_resume+0xc3/0xe0()

From: Yong Zhang
Date: Wed Sep 30 2009 - 04:01:45 EST


On Wed, Sep 30, 2009 at 3:50 PM, Michal Schmidt <mschmidt@xxxxxxxxxx> wrote:
> Dne Tue, 29 Sep 2009 17:31:43 +0800
> Yong Zhang <yong.zhang0@xxxxxxxxx> napsal(a):
>
>> On Tue, Sep 29, 2009 at 3:24 PM, Ingo Molnar <mingo@xxxxxxx> wrote:
>> > Could you try this with .32-rc1? This commit should have fixed the
>> > message above:
>> >
>> > 89133f9: clocksource: Resume clocksource without taking the
>> > clocksource mutex
>> >
>>
>> Hi Ingo,
>>
>> Indeed, Maciej said this issue is gone with .32-rc1. But I don't think
>> this is the same
>> issue with 89133f9 because in this one timekeeping_resume() is called
>> with irq enabled.
>> This is very odd and the bug exists in other parts.
>
> It is the same issue. Maciej has CONFIG_PREEMPT_VOLUNTARY=y which means
> taking the mutex in clocksource_resume() could have called into
> schedule(), thus enabling irqs.
>

>From my previous mail, I have ask Maciej to test the blow patch:
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index fb0f46f..4a00a1a 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -569,6 +569,9 @@ static int timekeeping_resume(struct sys_device *dev)
unsigned long flags;
struct timespec ts;

+ WARN_ONCE(!irqs_disabled(),
+ KERN_INFO "timekeeping_resume() called with IRQs enabled!");
+
read_persistent_clock(&ts);

clocksource_resume();

And indeed, the warning is showed. That means irq is enabled before
entering timekeeping_resume().
So is there other way to call clocksource_resume() and lead to this issue?

Best Regards,
Yong

> Michal
>
--
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/