diff options
author | Thomas Gleixner | 2011-07-27 01:08:20 +0200 |
---|---|---|
committer | Linus Torvalds | 2011-07-27 01:49:42 +0200 |
commit | b830ac1d9a2262093bb0f3f6a2fd2a1c8278daf5 (patch) | |
tree | 580f61a7a8a621792e8ac48d2ec4a9721165eecd /mm/memcontrol.c | |
parent | rtc: limit frequency (diff) | |
download | kernel-qcow2-linux-b830ac1d9a2262093bb0f3f6a2fd2a1c8278daf5.tar.gz kernel-qcow2-linux-b830ac1d9a2262093bb0f3f6a2fd2a1c8278daf5.tar.xz kernel-qcow2-linux-b830ac1d9a2262093bb0f3f6a2fd2a1c8278daf5.zip |
rtc: fix hrtimer deadlock
Ben reported a lockup related to rtc. The lockup happens due to:
CPU0 CPU1
rtc_irq_set_state() __run_hrtimer()
spin_lock_irqsave(&rtc->irq_task_lock) rtc_handle_legacy_irq();
spin_lock(&rtc->irq_task_lock);
hrtimer_cancel()
while (callback_running);
So the running callback never finishes as it's blocked on
rtc->irq_task_lock.
Use hrtimer_try_to_cancel() instead and drop rtc->irq_task_lock while
waiting for the callback. Fix this for both rtc_irq_set_state() and
rtc_irq_set_freq().
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reported-by: Ben Greear <greearb@candelatech.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/memcontrol.c')
0 files changed, 0 insertions, 0 deletions