Re: [PATCH] x86, efi: Don't recursively acquire rtc_lock

From: Tony Luck
Date: Wed Aug 03 2011 - 19:10:36 EST


On Wed, Aug 3, 2011 at 2:04 PM, Matt Fleming <matt@xxxxxxxxxxxxxxxxx> wrote:
> From: Matt Fleming <matt.fleming@xxxxxxxxxxxxxxx>
>
> 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>
>
> Move the locking up into the caller of efi.get_time() and provide some
> wrappers for use in other parts of the kernel instead of calling
> efi.get_time(), etc directly. This way we can hide the rtc_lock dance
> inside of arch/x86.

ia64 bits look ok (they build & boot too - which is always a plus :-)

Acked-by: Tony Luck <tony.luck@xxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/