diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2011-07-26 16:08:20 -0700 |
---|---|---|
committer | Jonas ABERG <jonas.aberg@stericsson.com> | 2011-10-28 11:05:27 +0200 |
commit | f5d3e752d38e5b95c6e0f09ba35c1429d74fce45 (patch) | |
tree | e50eb602f408704dc1b40cf47d192ddbf7985015 /drivers/block | |
parent | d49cbd476f67ee54a8fec45a6d0ad866c8fc0e9a (diff) |
rtc: fix hrtimer deadlock
commit b830ac1d9a2262093bb0f3f6a2fd2a1c8278daf5 upstream.
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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Change-Id: I2b1a13e50b81eda763e175c58c7886e7c7b7f692
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/35594
Tested-by: Per VAHLNE <per.xx.vahlne@stericsson.com>
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
Diffstat (limited to 'drivers/block')
0 files changed, 0 insertions, 0 deletions