Skip to contentSkip to conversation

sony-laptop: Kill the BKL

PATCH Applied Alessio Igor Bogani 2 participants 3 messages Mar 20, 2009 – Mar 21, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sony-laptop: Kill the BKL

---
 drivers/platform/x86/sony-laptop.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
drivers/platform/x86/sony-laptop.c +8 -4
index 537959d..15f940b 100644
@@ -46,7 +46,6 @@
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/init.h>
-#include <linux/smp_lock.h>
 #include <linux/types.h>
 #include <linux/backlight.h>
 #include <linux/platform_device.h>
@@ -1934,10 +1933,15 @@ static int sonypi_misc_release(struct inode *inode, struct file *file)
 static int sonypi_misc_open(struct inode *inode, struct file *file)
 {
 	/* Flush input queue on first open */
-	lock_kernel();
+	unsigned long flags;
+
+	spin_lock_irqsave(sonypi_compat.fifo->lock, flags);
+
 	if (atomic_inc_return(&sonypi_compat.open_count) == 1)
-		kfifo_reset(sonypi_compat.fifo);
-	unlock_kernel();
+		__kfifo_reset(sonypi_compat.fifo);
+
+	spin_unlock_irqrestore(sonypi_compat.fifo->lock, flags);
+
 	return 0;
 }
 
Signature · 1 line
1.6.0.4
#1 lore raw

PATCH 1/1 sony-laptop: Kill the BKL

---------- Forwarded message ----------
From: Alessio Igor Bogani <[email protected]>
Date: 2009/3/20
Subject: [PATCH] sony-laptop: Kill the BKL
To: LKML <[email protected]>
Cc: Alessio Igor Bogani <[email protected]>

---
 drivers/platform/x86/sony-laptop.c |   12 ++++++++----

 1 files changed, 8 insertions(+), 4 deletions(-)
(quoted diff) +0 -0

b/drivers/platform/x86/sony-laptop.c
index 537959d..15f940b 100644

drivers/platform/x86/sony-laptop.c +0 -0
@@ -46,7 +46,6 @@

 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/init.h>
-#include <linux/smp_lock.h>
 #include <linux/types.h>
 #include <linux/backlight.h>
 #include <linux/platform_device.h>
@@ -1934,10 +1933,15 @@ static int sonypi_misc_release(struct inode *inode, struct file *file)
 static int sonypi_misc_open(struct inode *inode, struct file *file) {
       /* Flush input queue on first open */
-       lock_kernel();
+       unsigned long flags;
+
+       spin_lock_irqsave(sonypi_compat.fifo->lock, flags); +
       if (atomic_inc_return(&sonypi_compat.open_count) == 1)
-               kfifo_reset(sonypi_compat.fifo);
-       unlock_kernel();
+               __kfifo_reset(sonypi_compat.fifo);
+
+       spin_unlock_irqrestore(sonypi_compat.fifo->lock, flags); +
       return 0;
 }

--
1.6.0.4
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer Applied
#2 lore raw
In reply to Alessio Igor Bogani
Quoted 1 line · Alessio Igor Bogani

Applied, thanks. Will send together with my patch set for .30 soon.

Quoted 44 lines
---
 drivers/platform/x86/sony-laptop.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
drivers/platform/x86/sony-laptop.c +8 -4
index 537959d..15f940b 100644
@@ -46,7 +46,6 @@
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/init.h>
-#include <linux/smp_lock.h>
 #include <linux/types.h>
 #include <linux/backlight.h>
 #include <linux/platform_device.h>
@@ -1934,10 +1933,15 @@ static int sonypi_misc_release(struct inode *inode, struct file *file)
 static int sonypi_misc_open(struct inode *inode, struct file *file)
 {
 	/* Flush input queue on first open */
-	lock_kernel();
+	unsigned long flags;
+
+	spin_lock_irqsave(sonypi_compat.fifo->lock, flags);
+
 	if (atomic_inc_return(&sonypi_compat.open_count) == 1)
-		kfifo_reset(sonypi_compat.fifo);
-	unlock_kernel();
+		__kfifo_reset(sonypi_compat.fifo);
+
+	spin_unlock_irqrestore(sonypi_compat.fifo->lock, flags);
+
 	return 0;
 }
 
Signature · 7 lines
1.6.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Signature · 2 lines
mattia
:wq!