From: Ralf Baechle <ralf@linux-mips.org>

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.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 drivers/serial/8250.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletion(-)

diff -puN drivers/serial/8250.c~8250-serial-console-locking-bug-spelling-fix drivers/serial/8250.c
--- devel/drivers/serial/8250.c~8250-serial-console-locking-bug-spelling-fix	2005-08-21 23:49:47.000000000 -0700
+++ devel-akpm/drivers/serial/8250.c	2005-08-21 23:49:47.000000000 -0700
@@ -2193,8 +2193,10 @@ serial8250_console_write(struct console 
 	unsigned int ier;
 	int i;
 
+	spin_lock_irq(&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);
 
@@ -2226,6 +2228,7 @@ serial8250_console_write(struct console 
 	 */
 	wait_for_xmitr(up);
 	serial_out(up, UART_IER, ier);
+	spin_unlock_irq(&up->port.lock);
 }
 
 static int serial8250_console_setup(struct console *co, char *options)
_