Thomas Gleixner 3c8bb90efb 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().

Cc: stable@kernel.org
Reported-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: John Stultz <john.stultz@linaro.org>
2011-07-26 14:49:59 -07:00
..
2011-04-26 14:01:41 -07:00
2011-07-26 14:49:59 -07:00
2011-03-31 11:26:23 -03:00
2009-02-11 14:25:36 -08:00
2011-06-01 19:29:39 -07:00
2009-02-05 12:56:46 -08:00
2011-03-22 17:44:16 -07:00
2009-04-01 08:59:24 -07:00
2011-05-26 17:12:33 -07:00
2011-03-31 11:26:23 -03:00
2009-04-02 01:05:32 +00:00
2009-09-23 07:39:43 -07:00
2011-05-26 17:12:33 -07:00
2011-05-26 17:12:33 -07:00
2008-11-21 01:24:38 -08:00
2008-11-14 16:37:54 -08:00
2011-03-31 11:26:23 -03:00