linux-cvs-patches
[Top] [All Lists]

CVS Update@linux-mips.org: linux

To: linux-cvs-patches@linux-mips.org
Subject: CVS Update@linux-mips.org: linux
From: ralf@linux-mips.org
Date: Tue, 16 Aug 2005 17:04:20 +0100
Reply-to: linux-mips@linux-mips.org
Sender: linux-cvs-patches-bounce@linux-mips.org
CVSROOT:        /home/cvs
Module name:    linux
Changes by:     ralf@ftp.linux-mips.org 05/08/16 17:04:14

Modified files:
        drivers/serial : 8250.c 

Log message:
        Serial8250_console_write() is fiddling with the UART's IER register
        without taking the lock.  So things go really wrong if an interrupt
        ends up fiddling with IER as well.

diff -urN linux/drivers/serial/8250.c linux/drivers/serial/8250.c
--- linux/drivers/serial/8250.c 2005/07/12 09:19:16     1.39
+++ linux/drivers/serial/8250.c 2005/08/16 16:04:14     1.40
@@ -2137,8 +2137,10 @@
        unsigned int ier;
        int i;
 
+       spin_lock(&up->port.lock); 
+
        /*
-        *      First save the UER then disable the interrupts
+        *      First save the IER then disable the interrupts
         */
        ier = serial_in(up, UART_IER);
 
@@ -2170,6 +2172,8 @@
         */
        wait_for_xmitr(up);
        serial_out(up, UART_IER, ier);
+
+       spin_unlock(&up->port.lock);
 }
 
 static int serial8250_console_setup(struct console *co, char *options)

<Prev in Thread] Current Thread [Next in Thread>