]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
Ben reported a lockup related to rtc. The lockup happens due to:
authorThomas Gleixner <tglx@linutronix.de>
Tue, 26 Jul 2011 10:14:58 +0000 (20:14 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 27 Jul 2011 03:26:54 +0000 (13:26 +1000)
commit09f185925811e61f43b4c66c1672042c8071c712
tree3c60939ed46d8401e5814ffc3660f60cfcf2ef3d
parent5fc5c9d1bfeec7c87b5b90174eb1a1bf8c8d5f6f
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>
drivers/rtc/interface.c