From: jbarnes@sgi.com (Jesse Barnes)

fix console for medusa



 drivers/char/sn_serial.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff -puN drivers/char/sn_serial.c~sn-serial-medusa-fix drivers/char/sn_serial.c
--- 25/drivers/char/sn_serial.c~sn-serial-medusa-fix	2003-12-30 13:24:57.000000000 -0800
+++ 25-akpm/drivers/char/sn_serial.c	2003-12-30 13:24:57.000000000 -0800
@@ -814,13 +814,18 @@ sn_sal_switch_to_asynch(void)
 {
 	unsigned long flags;
 
-	sn_debug_printf("sn_serial: about to switch to asynchronous console\n");
-
 	/* without early_printk, we may be invoked late enough to race
 	 * with other cpus doing console IO at this point, however
 	 * console interrupts will never be enabled */
 	spin_lock_irqsave(&sn_sal_lock, flags);
 
+	if (sn_sal_is_asynch) {
+		spin_unlock_irqrestore(&sn_sal_lock, flags);
+		return;
+	}
+
+	sn_debug_printf("sn_serial: switch to asynchronous console\n");
+
 	/* early_printk invocation may have done this for us */
 	if (!sn_func) {
 		if (IS_RUNNING_ON_SIMULATOR())
@@ -902,8 +907,7 @@ sn_sal_module_init(void)
 	/* when this driver is compiled in, the console initialization
 	 * will have already switched us into asynchronous operation
 	 * before we get here through the module initcalls */
-	if (!sn_sal_is_asynch)
-		sn_sal_switch_to_asynch();
+	sn_sal_switch_to_asynch();
 
 	/* at this point (module_init) we can try to turn on interrupts */
 	if (!IS_RUNNING_ON_SIMULATOR())

_