X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fserial%2F8250.c;h=10c2daab99ac1522ca224a6a7407eb6168fa6b19;hb=6ebfc0e20b409f13e62bbb84ce70102b49945cfd;hp=e001ea0606ec86ec86718de00cdb167f3ad92f5e;hpb=a88d75b257b2b28b26d7d4d2b640f05feb00ad53;p=pandora-kernel.git diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index e001ea0606ec..10c2daab99ac 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c @@ -19,7 +19,6 @@ * mapbase is the physical address of the IO port. * membase is an 'ioremapped' cookie. */ -#include #if defined(CONFIG_SERIAL_8250_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) #define SUPPORT_SYSRQ @@ -49,7 +48,7 @@ /* * Configuration: - * share_irqs - whether we pass SA_SHIRQ to request_irq(). This option + * share_irqs - whether we pass IRQF_SHARED to request_irq(). This option * is unsafe when used on edge-triggered interrupts. */ static unsigned int share_irqs = SERIAL8250_SHARE_IRQS; @@ -300,6 +299,7 @@ static inline int map_8250_out_reg(struct uart_8250_port *up, int offset) static unsigned int serial_in(struct uart_8250_port *up, int offset) { + unsigned int tmp; offset = map_8250_in_reg(up, offset) << up->port.regshift; switch (up->port.iotype) { @@ -318,6 +318,13 @@ static unsigned int serial_in(struct uart_8250_port *up, int offset) return __raw_readl(up->port.membase + offset); #endif + case UPIO_TSI: + if (offset == UART_IIR) { + tmp = readl(up->port.membase + (UART_IIR & ~3)); + return (tmp >> 16) & 0xff; /* UART_IIR % 4 == 2 */ + } else + return readb(up->port.membase + offset); + default: return inb(up->port.iobase + offset); } @@ -347,6 +354,10 @@ serial_out(struct uart_8250_port *up, int offset, int value) __raw_writel(value, up->port.membase + offset); break; #endif + case UPIO_TSI: + if (!((offset == UART_IER) && (value & UART_IER_UUE))) + writeb(value, up->port.membase + offset); + break; default: outb(value, up->port.iobase + offset); @@ -1401,7 +1412,7 @@ static void serial_do_unlink(struct irq_info *i, struct uart_8250_port *up) static int serial_link_irq_chain(struct uart_8250_port *up) { struct irq_info *i = irq_lists + up->port.irq; - int ret, irq_flags = up->port.flags & UPF_SHARE_IRQ ? SA_SHIRQ : 0; + int ret, irq_flags = up->port.flags & UPF_SHARE_IRQ ? IRQF_SHARED : 0; spin_lock_irq(&i->lock); @@ -2235,10 +2246,21 @@ static void serial8250_console_write(struct console *co, const char *s, unsigned int count) { struct uart_8250_port *up = &serial8250_ports[co->index]; + unsigned long flags; unsigned int ier; + int locked = 1; touch_nmi_watchdog(); + local_irq_save(flags); + if (up->port.sysrq) { + /* serial8250_handle_port() already took the lock */ + locked = 0; + } else if (oops_in_progress) { + locked = spin_trylock(&up->port.lock); + } else + spin_lock(&up->port.lock); + /* * First save the IER then disable the interrupts */ @@ -2257,6 +2279,10 @@ serial8250_console_write(struct console *co, const char *s, unsigned int count) */ wait_for_xmitr(up, BOTH_EMPTY); serial_out(up, UART_IER, ier); + + if (locked) + spin_unlock(&up->port.lock); + local_irq_restore(flags); } static int serial8250_console_setup(struct console *co, char *options) @@ -2344,7 +2370,6 @@ int __init serial8250_start_console(struct uart_port *port, char *options) static struct uart_driver serial8250_reg = { .owner = THIS_MODULE, .driver_name = "serial", - .devfs_name = "tts/", .dev_name = "ttyS", .major = TTY_MAJOR, .minor = 64,