浏览代码

sonypi: BKL pushdown

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Arnd Bergmann 17 年之前
父节点
当前提交
f8f2c79d59
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      drivers/char/sonypi.c

+ 3 - 0
drivers/char/sonypi.c

@@ -49,6 +49,7 @@
 #include <linux/err.h>
 #include <linux/kfifo.h>
 #include <linux/platform_device.h>
+#include <linux/smp_lock.h>
 
 #include <asm/uaccess.h>
 #include <asm/io.h>
@@ -906,12 +907,14 @@ static int sonypi_misc_release(struct inode *inode, struct file *file)
 
 static int sonypi_misc_open(struct inode *inode, struct file *file)
 {
+	lock_kernel();
 	mutex_lock(&sonypi_device.lock);
 	/* Flush input queue on first open */
 	if (!sonypi_device.open_count)
 		kfifo_reset(sonypi_device.fifo);
 	sonypi_device.open_count++;
 	mutex_unlock(&sonypi_device.lock);
+	unlock_kernel();
 	return 0;
 }