diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2011-07-26 16:08:20 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-26 16:49:42 -0700 |
commit | b830ac1d9a2262093bb0f3f6a2fd2a1c8278daf5 (patch) | |
tree | 580f61a7a8a621792e8ac48d2ec4a9721165eecd /include/linux/swap.h | |
parent | 431e2bcc371016824f419baa745f82388258f3ee (diff) | |
download | talos-obmc-linux-b830ac1d9a2262093bb0f3f6a2fd2a1c8278daf5.tar.gz talos-obmc-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 'include/linux/swap.h')
0 files changed, 0 insertions, 0 deletions