Matt Fleming 47997d756a x86/rtc: Don't recursively acquire rtc_lock
A deadlock was introduced on x86 in commit ef68c8f87ed1 ("x86:
Serialize EFI time accesses on rtc_lock") because efi_get_time()
and friends can be called with rtc_lock already held by
read_persistent_time(), e.g.:

 timekeeping_init()
    read_persistent_clock()     <-- acquire rtc_lock
        efi_get_time()
            phys_efi_get_time() <-- acquire rtc_lock <DEADLOCK>

To fix this let's push the locking down into the get_wallclock()
and set_wallclock() implementations.  Only the clock
implementations that access the x86 RTC directly need to acquire
rtc_lock, so it makes sense to push the locking down into the
rtc, vrtc and efi code.

The virtualization implementations don't require rtc_lock to be
held because they provide their own serialization.

Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Acked-by: Jan Beulich <jbeulich@novell.com>
Acked-by: Avi Kivity <avi@redhat.com> [for the virtualization aspect]
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Josh Boyer <jwboyer@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2011-09-21 16:16:09 +02:00
..
2011-07-26 16:49:47 -07:00
2011-07-01 10:37:15 +02:00
2010-07-21 11:33:27 -07:00
2009-07-19 18:27:51 +02:00
2010-08-27 11:12:29 -07:00
2011-07-01 10:37:14 +02:00
2011-07-26 16:49:47 -07:00
2011-02-17 14:59:22 +01:00
2011-03-18 10:39:30 +01:00
2011-07-26 16:49:47 -07:00
2011-07-01 11:06:38 +02:00
2011-07-24 11:49:36 +03:00
2011-03-18 10:39:30 +01:00
2011-07-01 11:06:38 +02:00
2011-07-21 10:26:00 +02:00
2011-05-26 13:51:35 +02:00
2011-07-14 21:46:20 -07:00
2011-08-04 16:13:49 -07:00
2011-03-18 10:39:30 +01:00
2011-03-18 10:39:30 +01:00
2011-01-13 17:32:41 -08:00
2011-03-18 10:39:30 +01:00