Commit 20a8305b authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] sn: serial update

From: Pat Gefre <pfg@sgi.com>
      Jesse Barnes <jbarnes@tomahawk.engr.sgi.com>
parent 9c5a4934
...@@ -21,8 +21,9 @@ ...@@ -21,8 +21,9 @@
#include <linux/sysrq.h> #include <linux/sysrq.h>
#include <linux/circ_buf.h> #include <linux/circ_buf.h>
#include <linux/serial_reg.h> #include <linux/serial_reg.h>
#include <asm/uaccess.h>
#include <asm/sn/sn_sal.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/simulator.h>
#include <asm/sn/sn2/sn_private.h> #include <asm/sn/sn2/sn_private.h>
...@@ -771,7 +772,7 @@ sn_sal_read_proc(char *page, char **start, off_t off, int count, ...@@ -771,7 +772,7 @@ sn_sal_read_proc(char *page, char **start, off_t off, int count,
off_t begin = 0; off_t begin = 0;
len += sprintf(page, "sn_serial: nasid:%d irq:%d tx:%d rx:%d\n", 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); sn_total_tx_count, sn_total_rx_count);
*eof = 1; *eof = 1;
...@@ -813,13 +814,18 @@ sn_sal_switch_to_asynch(void) ...@@ -813,13 +814,18 @@ sn_sal_switch_to_asynch(void)
{ {
unsigned long flags; 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 /* without early_printk, we may be invoked late enough to race
* with other cpus doing console IO at this point, however * with other cpus doing console IO at this point, however
* console interrupts will never be enabled */ * console interrupts will never be enabled */
spin_lock_irqsave(&sn_sal_lock, flags); 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 */ /* early_printk invocation may have done this for us */
if (!sn_func) { if (!sn_func) {
if (IS_RUNNING_ON_SIMULATOR()) if (IS_RUNNING_ON_SIMULATOR())
...@@ -901,8 +907,7 @@ sn_sal_module_init(void) ...@@ -901,8 +907,7 @@ sn_sal_module_init(void)
/* when this driver is compiled in, the console initialization /* when this driver is compiled in, the console initialization
* will have already switched us into asynchronous operation * will have already switched us into asynchronous operation
* before we get here through the module initcalls */ * 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 */ /* at this point (module_init) we can try to turn on interrupts */
if (!IS_RUNNING_ON_SIMULATOR()) if (!IS_RUNNING_ON_SIMULATOR())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment