# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.1431  -> 1.1432 
#	drivers/char/sn_serial.c	1.1     -> 1.2    
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/11/07	jbarnes@tomahawk.engr.sgi.com	1.1432
# sn serial update
# --------------------------------------------
#


---

 25-akpm/drivers/char/sn_serial.c |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diff -puN drivers/char/sn_serial.c~sn09 drivers/char/sn_serial.c
--- 25/drivers/char/sn_serial.c~sn09	Thu Jan  8 15:17:09 2004
+++ 25-akpm/drivers/char/sn_serial.c	Thu Jan  8 15:17:09 2004
@@ -21,8 +21,9 @@
 #include <linux/sysrq.h>
 #include <linux/circ_buf.h>
 #include <linux/serial_reg.h>
+#include <asm/uaccess.h>
 #include <asm/sn/sn_sal.h>
-#include <asm/sn/pci/pciio.h>		/* this is needed for get_console_nasid */
+#include <asm/sn/pci/pciio.h>
 #include <asm/sn/simulator.h>
 #include <asm/sn/sn2/sn_private.h>
 
@@ -771,7 +772,7 @@ sn_sal_read_proc(char *page, char **star
 	off_t	begin = 0;
 
 	len += sprintf(page, "sn_serial: nasid:%d irq:%d tx:%d rx:%d\n",
-		       get_console_nasid(), sn_sal_irq,
+		       ia64_sn_get_console_nasid(), sn_sal_irq,
 		       sn_total_tx_count, sn_total_rx_count);
 	*eof = 1;
 
@@ -813,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())
@@ -901,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())

_