diff options
| -rw-r--r-- | arch/x86/platform/efi/efi.c | 39 |
1 files changed, 33 insertions, 6 deletions
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c index 474356b98ede..b8823d5a0117 100644 --- a/arch/x86/platform/efi/efi.c +++ b/arch/x86/platform/efi/efi.c | |||
| @@ -79,26 +79,50 @@ early_param("add_efi_memmap", setup_add_efi_memmap); | |||
| 79 | 79 | ||
| 80 | static efi_status_t virt_efi_get_time(efi_time_t *tm, efi_time_cap_t *tc) | 80 | static efi_status_t virt_efi_get_time(efi_time_t *tm, efi_time_cap_t *tc) |
| 81 | { | 81 | { |
| 82 | return efi_call_virt2(get_time, tm, tc); | 82 | unsigned long flags; |
| 83 | efi_status_t status; | ||
| 84 | |||
| 85 | spin_lock_irqsave(&rtc_lock, flags); | ||
| 86 | status = efi_call_virt2(get_time, tm, tc); | ||
| 87 | spin_unlock_irqrestore(&rtc_lock, flags); | ||
| 88 | return status; | ||
| 83 | } | 89 | } |
| 84 | 90 | ||
| 85 | static efi_status_t virt_efi_set_time(efi_time_t *tm) | 91 | static efi_status_t virt_efi_set_time(efi_time_t *tm) |
| 86 | { | 92 | { |
| 87 | return efi_call_virt1(set_time, tm); | 93 | unsigned long flags; |
| 94 | efi_status_t status; | ||
| 95 | |||
| 96 | spin_lock_irqsave(&rtc_lock, flags); | ||
| 97 | status = efi_call_virt1(set_time, tm); | ||
| 98 | spin_unlock_irqrestore(&rtc_lock, flags); | ||
| 99 | return status; | ||
| 88 | } | 100 | } |
| 89 | 101 | ||
| 90 | static efi_status_t virt_efi_get_wakeup_time(efi_bool_t *enabled, | 102 | static efi_status_t virt_efi_get_wakeup_time(efi_bool_t *enabled, |
| 91 | efi_bool_t *pending, | 103 | efi_bool_t *pending, |
| 92 | efi_time_t *tm) | 104 | efi_time_t *tm) |
| 93 | { | 105 | { |
| 94 | return efi_call_virt3(get_wakeup_time, | 106 | unsigned long flags; |
| 95 | enabled, pending, tm); | 107 | efi_status_t status; |
| 108 | |||
| 109 | spin_lock_irqsave(&rtc_lock, flags); | ||
| 110 | status = efi_call_virt3(get_wakeup_time, | ||
| 111 | enabled, pending, tm); | ||
| 112 | spin_unlock_irqrestore(&rtc_lock, flags); | ||
| 113 | return status; | ||
| 96 | } | 114 | } |
| 97 | 115 | ||
| 98 | static efi_status_t virt_efi_set_wakeup_time(efi_bool_t enabled, efi_time_t *tm) | 116 | static efi_status_t virt_efi_set_wakeup_time(efi_bool_t enabled, efi_time_t *tm) |
| 99 | { | 117 | { |
| 100 | return efi_call_virt2(set_wakeup_time, | 118 | unsigned long flags; |
| 101 | enabled, tm); | 119 | efi_status_t status; |
| 120 | |||
| 121 | spin_lock_irqsave(&rtc_lock, flags); | ||
| 122 | status = efi_call_virt2(set_wakeup_time, | ||
| 123 | enabled, tm); | ||
| 124 | spin_unlock_irqrestore(&rtc_lock, flags); | ||
| 125 | return status; | ||
| 102 | } | 126 | } |
| 103 | 127 | ||
| 104 | static efi_status_t virt_efi_get_variable(efi_char16_t *name, | 128 | static efi_status_t virt_efi_get_variable(efi_char16_t *name, |
| @@ -164,11 +188,14 @@ static efi_status_t __init phys_efi_set_virtual_address_map( | |||
| 164 | static efi_status_t __init phys_efi_get_time(efi_time_t *tm, | 188 | static efi_status_t __init phys_efi_get_time(efi_time_t *tm, |
| 165 | efi_time_cap_t *tc) | 189 | efi_time_cap_t *tc) |
| 166 | { | 190 | { |
| 191 | unsigned long flags; | ||
| 167 | efi_status_t status; | 192 | efi_status_t status; |
| 168 | 193 | ||
| 194 | spin_lock_irqsave(&rtc_lock, flags); | ||
| 169 | efi_call_phys_prelog(); | 195 | efi_call_phys_prelog(); |
| 170 | status = efi_call_phys2(efi_phys.get_time, tm, tc); | 196 | status = efi_call_phys2(efi_phys.get_time, tm, tc); |
| 171 | efi_call_phys_epilog(); | 197 | efi_call_phys_epilog(); |
| 198 | spin_unlock_irqrestore(&rtc_lock, flags); | ||
| 172 | return status; | 199 | return status; |
| 173 | } | 200 | } |
| 174 | 201 | ||
