aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/8250.c
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2006-01-04 14:19:06 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2006-01-04 14:19:06 -0500
commit45e24601921fc1c4ca7932f7f7a475d3ad64ecad (patch)
tree21b64ad15abe3b051a0462096ee2474212274e20 /drivers/serial/8250.c
parent50aec3b561de4e435204ad315e5c5ab58ef9feda (diff)
[SERIAL] Move interrupt-time spinlocking inside serial8250_handle_port()
All call sites for serial8250_handle_port() acquired the port spinlock and released it afterwards. This is a needless duplication of code. Move the spinlocking inside serial8250_handle_port(). Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/serial/8250.c')
-rw-r--r--drivers/serial/8250.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index ad20d2dd85d7..56dcfd93bdc4 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -1281,7 +1281,11 @@ static unsigned int check_modem_status(struct uart_8250_port *up)
1281static inline void 1281static inline void
1282serial8250_handle_port(struct uart_8250_port *up, struct pt_regs *regs) 1282serial8250_handle_port(struct uart_8250_port *up, struct pt_regs *regs)
1283{ 1283{
1284 unsigned int status = serial_inp(up, UART_LSR); 1284 unsigned int status;
1285
1286 spin_lock(&up->port.lock);
1287
1288 status = serial_inp(up, UART_LSR);
1285 1289
1286 DEBUG_INTR("status = %x...", status); 1290 DEBUG_INTR("status = %x...", status);
1287 1291
@@ -1290,6 +1294,8 @@ serial8250_handle_port(struct uart_8250_port *up, struct pt_regs *regs)
1290 check_modem_status(up); 1294 check_modem_status(up);
1291 if (status & UART_LSR_THRE) 1295 if (status & UART_LSR_THRE)
1292 transmit_chars(up); 1296 transmit_chars(up);
1297
1298 spin_unlock(&up->port.lock);
1293} 1299}
1294 1300
1295/* 1301/*
@@ -1325,9 +1331,7 @@ static irqreturn_t serial8250_interrupt(int irq, void *dev_id, struct pt_regs *r
1325 1331
1326 iir = serial_in(up, UART_IIR); 1332 iir = serial_in(up, UART_IIR);
1327 if (!(iir & UART_IIR_NO_INT)) { 1333 if (!(iir & UART_IIR_NO_INT)) {
1328 spin_lock(&up->port.lock);
1329 serial8250_handle_port(up, regs); 1334 serial8250_handle_port(up, regs);
1330 spin_unlock(&up->port.lock);
1331 1335
1332 handled = 1; 1336 handled = 1;
1333 1337
@@ -1426,11 +1430,8 @@ static void serial8250_timeout(unsigned long data)
1426 unsigned int iir; 1430 unsigned int iir;
1427 1431
1428 iir = serial_in(up, UART_IIR); 1432 iir = serial_in(up, UART_IIR);
1429 if (!(iir & UART_IIR_NO_INT)) { 1433 if (!(iir & UART_IIR_NO_INT))
1430 spin_lock(&up->port.lock);
1431 serial8250_handle_port(up, NULL); 1434 serial8250_handle_port(up, NULL);
1432 spin_unlock(&up->port.lock);
1433 }
1434 1435
1435 timeout = up->port.timeout; 1436 timeout = up->port.timeout;
1436 timeout = timeout > 6 ? (timeout / 2 - 2) : 1; 1437 timeout = timeout > 6 ? (timeout / 2 - 2) : 1;