Commit a5ee6dc9 authored by Thomas Gleixner's avatar Thomas Gleixner

rtc: Remove BKL from efirtc

BKL locking came to efirtc via the big BKL push down, but the access
to the efi functions is protected by efi_rtc_lock already.

Remove it.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
LKML-Reference: <20091010153350.046644063@linutronix.de>
parent d2d23559
...@@ -27,8 +27,6 @@ ...@@ -27,8 +27,6 @@
* - Add module support * - Add module support
*/ */
#include <linux/smp_lock.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/miscdevice.h> #include <linux/miscdevice.h>
...@@ -174,13 +172,12 @@ static long efi_rtc_ioctl(struct file *file, unsigned int cmd, ...@@ -174,13 +172,12 @@ static long efi_rtc_ioctl(struct file *file, unsigned int cmd,
return -EINVAL; return -EINVAL;
case RTC_RD_TIME: case RTC_RD_TIME:
lock_kernel();
spin_lock_irqsave(&efi_rtc_lock, flags); spin_lock_irqsave(&efi_rtc_lock, flags);
status = efi.get_time(&eft, &cap); status = efi.get_time(&eft, &cap);
spin_unlock_irqrestore(&efi_rtc_lock,flags); spin_unlock_irqrestore(&efi_rtc_lock,flags);
unlock_kernel();
if (status != EFI_SUCCESS) { if (status != EFI_SUCCESS) {
/* should never happen */ /* should never happen */
printk(KERN_ERR "efitime: can't read time\n"); printk(KERN_ERR "efitime: can't read time\n");
...@@ -202,13 +199,11 @@ static long efi_rtc_ioctl(struct file *file, unsigned int cmd, ...@@ -202,13 +199,11 @@ static long efi_rtc_ioctl(struct file *file, unsigned int cmd,
convert_to_efi_time(&wtime, &eft); convert_to_efi_time(&wtime, &eft);
lock_kernel();
spin_lock_irqsave(&efi_rtc_lock, flags); spin_lock_irqsave(&efi_rtc_lock, flags);
status = efi.set_time(&eft); status = efi.set_time(&eft);
spin_unlock_irqrestore(&efi_rtc_lock,flags); spin_unlock_irqrestore(&efi_rtc_lock,flags);
unlock_kernel();
return status == EFI_SUCCESS ? 0 : -EINVAL; return status == EFI_SUCCESS ? 0 : -EINVAL;
...@@ -224,7 +219,6 @@ static long efi_rtc_ioctl(struct file *file, unsigned int cmd, ...@@ -224,7 +219,6 @@ static long efi_rtc_ioctl(struct file *file, unsigned int cmd,
convert_to_efi_time(&wtime, &eft); convert_to_efi_time(&wtime, &eft);
lock_kernel();
spin_lock_irqsave(&efi_rtc_lock, flags); spin_lock_irqsave(&efi_rtc_lock, flags);
/* /*
* XXX Fixme: * XXX Fixme:
...@@ -235,19 +229,16 @@ static long efi_rtc_ioctl(struct file *file, unsigned int cmd, ...@@ -235,19 +229,16 @@ static long efi_rtc_ioctl(struct file *file, unsigned int cmd,
status = efi.set_wakeup_time((efi_bool_t)enabled, &eft); status = efi.set_wakeup_time((efi_bool_t)enabled, &eft);
spin_unlock_irqrestore(&efi_rtc_lock,flags); spin_unlock_irqrestore(&efi_rtc_lock,flags);
unlock_kernel();
return status == EFI_SUCCESS ? 0 : -EINVAL; return status == EFI_SUCCESS ? 0 : -EINVAL;
case RTC_WKALM_RD: case RTC_WKALM_RD:
lock_kernel();
spin_lock_irqsave(&efi_rtc_lock, flags); spin_lock_irqsave(&efi_rtc_lock, flags);
status = efi.get_wakeup_time((efi_bool_t *)&enabled, (efi_bool_t *)&pending, &eft); status = efi.get_wakeup_time((efi_bool_t *)&enabled, (efi_bool_t *)&pending, &eft);
spin_unlock_irqrestore(&efi_rtc_lock,flags); spin_unlock_irqrestore(&efi_rtc_lock,flags);
unlock_kernel();
if (status != EFI_SUCCESS) return -EINVAL; if (status != EFI_SUCCESS) return -EINVAL;
...@@ -277,7 +268,6 @@ static int efi_rtc_open(struct inode *inode, struct file *file) ...@@ -277,7 +268,6 @@ static int efi_rtc_open(struct inode *inode, struct file *file)
* We do accept multiple open files at the same time as we * We do accept multiple open files at the same time as we
* synchronize on the per call operation. * synchronize on the per call operation.
*/ */
cycle_kernel_lock();
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment