[PATCH 13/14] specialix; Kill the BKL

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Alan Cox
Date: Thursday, April 1, 2010 - 9:07 am

Use the port mutex instead

Signed-off-by: Alan Cox <alan@linux.intel.com>
---

 drivers/char/specialix.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)


diff --git a/drivers/char/specialix.c b/drivers/char/specialix.c
index 2c24fcd..7be456f 100644
--- a/drivers/char/specialix.c
+++ b/drivers/char/specialix.c
@@ -1863,8 +1863,7 @@ static int sx_set_serial_info(struct specialix_port *port,
 		return -EFAULT;
 	}
 
-	lock_kernel();
-
+	mutex_lock(&port->port.mutex);
 	change_speed = ((port->port.flags & ASYNC_SPD_MASK) !=
 			(tmp.flags & ASYNC_SPD_MASK));
 	change_speed |= (tmp.custom_divisor != port->custom_divisor);
@@ -1875,7 +1874,7 @@ static int sx_set_serial_info(struct specialix_port *port,
 		    ((tmp.flags & ~ASYNC_USR_MASK) !=
 		     (port->port.flags & ~ASYNC_USR_MASK))) {
 			func_exit();
-			unlock_kernel();
+			mutex_unlock(&port->port.mutex);
 			return -EPERM;
 		}
 		port->port.flags = ((port->port.flags & ~ASYNC_USR_MASK) |
@@ -1892,7 +1891,7 @@ static int sx_set_serial_info(struct specialix_port *port,
 		sx_change_speed(bp, port);
 
 	func_exit();
-	unlock_kernel();
+	mutex_unlock(&port->port.mutex);
 	return 0;
 }
 
@@ -1906,7 +1905,7 @@ static int sx_get_serial_info(struct specialix_port *port,
 	func_enter();
 
 	memset(&tmp, 0, sizeof(tmp));
-	lock_kernel();
+	mutex_lock(&port->port.mutex);
 	tmp.type = PORT_CIRRUS;
 	tmp.line = port - sx_port;
 	tmp.port = bp->base;
@@ -1917,7 +1916,7 @@ static int sx_get_serial_info(struct specialix_port *port,
 	tmp.closing_wait = port->port.closing_wait * HZ/100;
 	tmp.custom_divisor =  port->custom_divisor;
 	tmp.xmit_fifo_size = CD186x_NFIFO;
-	unlock_kernel();
+	mutex_unlock(&port->port.mutex);
 	if (copy_to_user(retinfo, &tmp, sizeof(tmp))) {
 		func_exit();
 		return -EFAULT;

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 04/14] vc: Locking clean up, Alan Cox, (Thu Apr 1, 9:04 am)
[PATCH 05/14] stallion: prune lock_kernel calls, Alan Cox, (Thu Apr 1, 9:05 am)
[PATCH 07/14] riscom8: kill use of lock_kernel, Alan Cox, (Thu Apr 1, 9:05 am)
[PATCH 08/14] isicom: kill off the BKL, Alan Cox, (Thu Apr 1, 9:05 am)
[PATCH 09/14] rocket: kill BKL, Alan Cox, (Thu Apr 1, 9:06 am)
[PATCH 10/14] synclink: kill the big kernel lock, Alan Cox, (Thu Apr 1, 9:06 am)
[PATCH 11/14] cyclades: Kill off BKL usage, Alan Cox, (Thu Apr 1, 9:06 am)
[PATCH 12/14] epca: Kill the big kernel lock, Alan Cox, (Thu Apr 1, 9:06 am)
[PATCH 13/14] specialix; Kill the BKL, Alan Cox, (Thu Apr 1, 9:07 am)
[PATCH 14/14] synclink: reworking locking a bit, Alan Cox, (Thu Apr 1, 9:07 am)
Re: [PATCH 05/14] stallion: prune lock_kernel calls, Arnd Bergmann, (Thu Apr 29, 2:29 pm)
Re: [PATCH 05/14] stallion: prune lock_kernel calls, Alan Cox, (Fri Apr 30, 12:32 pm)
Re: [PATCH 04/14] vc: Locking clean up, Arnd Bergmann, (Fri Apr 30, 1:30 pm)