diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2011-07-26 23:08:20 (GMT) |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-26 23:49:42 (GMT) |
commit | b830ac1d9a2262093bb0f3f6a2fd2a1c8278daf5 (patch) | |
tree | 580f61a7a8a621792e8ac48d2ec4a9721165eecd /drivers/rtc/rtc-wm8350.c | |
parent | 431e2bcc371016824f419baa745f82388258f3ee (diff) | |
download | linux-b830ac1d9a2262093bb0f3f6a2fd2a1c8278daf5.tar.xz |
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 'drivers/rtc/rtc-wm8350.c')
0 files changed, 0 insertions, 0 deletions