Skip to content

Commit a5ee6dc

Browse files
committed
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: Thomas Gleixner <tglx@linutronix.de> LKML-Reference: <20091010153350.046644063@linutronix.de>
1 parent d2d2355 commit a5ee6dc

1 file changed

Lines changed: 1 addition & 11 deletions

File tree

‎drivers/char/efirtc.c‎

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
* - Add module support
2828
*/
2929

30-
31-
#include <linux/smp_lock.h>
3230
#include <linux/types.h>
3331
#include <linux/errno.h>
3432
#include <linux/miscdevice.h>
@@ -174,13 +172,12 @@ static long efi_rtc_ioctl(struct file *file, unsigned int cmd,
174172
return -EINVAL;
175173

176174
case RTC_RD_TIME:
177-
lock_kernel();
178175
spin_lock_irqsave(&efi_rtc_lock, flags);
179176

180177
status = efi.get_time(&eft, &cap);
181178

182179
spin_unlock_irqrestore(&efi_rtc_lock,flags);
183-
unlock_kernel();
180+
184181
if (status != EFI_SUCCESS) {
185182
/* should never happen */
186183
printk(KERN_ERR "efitime: can't read time\n");
@@ -202,13 +199,11 @@ static long efi_rtc_ioctl(struct file *file, unsigned int cmd,
202199

203200
convert_to_efi_time(&wtime, &eft);
204201

205-
lock_kernel();
206202
spin_lock_irqsave(&efi_rtc_lock, flags);
207203

208204
status = efi.set_time(&eft);
209205

210206
spin_unlock_irqrestore(&efi_rtc_lock,flags);
211-
unlock_kernel();
212207

213208
return status == EFI_SUCCESS ? 0 : -EINVAL;
214209

@@ -224,7 +219,6 @@ static long efi_rtc_ioctl(struct file *file, unsigned int cmd,
224219

225220
convert_to_efi_time(&wtime, &eft);
226221

227-
lock_kernel();
228222
spin_lock_irqsave(&efi_rtc_lock, flags);
229223
/*
230224
* XXX Fixme:
@@ -235,19 +229,16 @@ static long efi_rtc_ioctl(struct file *file, unsigned int cmd,
235229
status = efi.set_wakeup_time((efi_bool_t)enabled, &eft);
236230

237231
spin_unlock_irqrestore(&efi_rtc_lock,flags);
238-
unlock_kernel();
239232

240233
return status == EFI_SUCCESS ? 0 : -EINVAL;
241234

242235
case RTC_WKALM_RD:
243236

244-
lock_kernel();
245237
spin_lock_irqsave(&efi_rtc_lock, flags);
246238

247239
status = efi.get_wakeup_time((efi_bool_t *)&enabled, (efi_bool_t *)&pending, &eft);
248240

249241
spin_unlock_irqrestore(&efi_rtc_lock,flags);
250-
unlock_kernel();
251242

252243
if (status != EFI_SUCCESS) return -EINVAL;
253244

@@ -277,7 +268,6 @@ static int efi_rtc_open(struct inode *inode, struct file *file)
277268
* We do accept multiple open files at the same time as we
278269
* synchronize on the per call operation.
279270
*/
280-
cycle_kernel_lock();
281271
return 0;
282272
}
283273

0 commit comments

Comments
 (0)