Re: [PATCH] x86: serialize EFI time accesses on rtc_lock

From: Matthew Garrett
Date: Tue Jul 19 2011 - 13:54:48 EST

On Tue, Jul 19, 2011 at 11:32:05PM +0600, Rakib Mullick wrote:

> If I'm not missing anything, this implementation (serialization) could
> be simpler by holding rtc_lock at the time of calling those functions.
> I mean, holding rtc_lock before calling EFI services
> virt_efi_get/set_time and virt_efi_get/set_wakeup_time - something
> like below:
> spin_lock_irqsave(&rtc_lock, flags);
> efi.get_time = virt_efi_get_time;
> efi.set_time = virt_efi_set_time;
> efi.get_wakeup_time = virt_efi_get_wakeup_time;
> efi.set_wakeup_time = virt_efi_set_wakeup_time;
> spin_unlock_irqrestore(&rtc_lock, flags);

That's just assigning some function pointers, not actually making the
calls. There's potentially several routes to each of the calls, so it
makes sense to do the locking there.

Matthew Garrett | mjg59@xxxxxxxxxxxxx
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at