From 0b30d668a20acd2ffd4268f7bbe799b0dd73d5cf Mon Sep 17 00:00:00 2001 From: Sergei Shtylyov Date: Sat, 9 Sep 2006 22:23:56 +0400 Subject: [SERIAL] 8250 resourse management fixes I think register ranges obviously need to be claimed/released for all UARTs including those with UPIO_MEM32 and UPIO_TSI iotype. Also, serial8250_request_rsa_resources() returns false positives with UPIO_MEM32, UPIO_AU, and UPIO_TSI iotype -- I don't think this makes any sense. Signed-off-by: Sergei Shtylyov Signed-off-by: Russell King --- drivers/serial/8250.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'drivers/serial/8250.c') diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index 0ae9ced00ed..8d7ef69312a 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c @@ -1949,6 +1949,8 @@ static int serial8250_request_std_resource(struct uart_8250_port *up) case UPIO_AU: size = 0x100000; /* fall thru */ + case UPIO_TSI: + case UPIO_MEM32: case UPIO_MEM: if (!up->port.mapbase) break; @@ -1984,6 +1986,8 @@ static void serial8250_release_std_resource(struct uart_8250_port *up) case UPIO_AU: size = 0x100000; /* fall thru */ + case UPIO_TSI: + case UPIO_MEM32: case UPIO_MEM: if (!up->port.mapbase) break; @@ -2007,17 +2011,15 @@ static int serial8250_request_rsa_resource(struct uart_8250_port *up) { unsigned long start = UART_RSA_BASE << up->port.regshift; unsigned int size = 8 << up->port.regshift; - int ret = 0; + int ret = -EINVAL; switch (up->port.iotype) { - case UPIO_MEM: - ret = -EINVAL; - break; - case UPIO_HUB6: case UPIO_PORT: start += up->port.iobase; - if (!request_region(start, size, "serial-rsa")) + if (request_region(start, size, "serial-rsa")) + ret = 0; + else ret = -EBUSY; break; } @@ -2031,9 +2033,6 @@ static void serial8250_release_rsa_resource(struct uart_8250_port *up) unsigned int size = 8 << up->port.regshift; switch (up->port.iotype) { - case UPIO_MEM: - break; - case UPIO_HUB6: case UPIO_PORT: release_region(up->port.iobase + offset, size); -- cgit v1.2.3 From a4b775735c0dff5a8d59a877ff0033526b469116 Mon Sep 17 00:00:00 2001 From: Sergei Shtylyov Date: Mon, 11 Sep 2006 20:32:58 +0400 Subject: [SERIAL] suspend/resume handlers don't have level arg anymore 8250.c and serial_txx9.c port suspend/resume handler still have this obsolete argument documented... Signed-off-by: Sergei Shtylyov Signed-off-by: Russell King --- drivers/serial/8250.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'drivers/serial/8250.c') diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index 8d7ef69312a..cef03e68771 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c @@ -2396,7 +2396,6 @@ int __init early_serial_setup(struct uart_port *port) /** * serial8250_suspend_port - suspend one serial port * @line: serial line number - * @level: the level of port suspension, as per uart_suspend_port * * Suspend one serial port. */ @@ -2408,7 +2407,6 @@ void serial8250_suspend_port(int line) /** * serial8250_resume_port - resume one serial port * @line: serial line number - * @level: the level of port resumption, as per uart_resume_port * * Resume one serial port. */ -- cgit v1.2.3 From 255341c6fded73204b1ee6feb5fe16e125b27f62 Mon Sep 17 00:00:00 2001 From: Jonathan McDowell Date: Mon, 14 Aug 2006 23:05:32 -0700 Subject: [SERIAL] OMAP1510 serial fix for 115200 baud The patch below is necessary for 115200 baud on an OMAP1510 internal UART. It's been in the linux-omap tree for some time and with it applied to a vanilla Linus git tree the serial console on the Amstrad Delta (which is OMAP1510 based and whose initial bootloader runs at 115200) works fine (it doesn't without it). Signed-off-by: Jonathan McDowell Signed-off-by: Andrew Morton Signed-off-by: Russell King --- drivers/serial/8250.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'drivers/serial/8250.c') diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index cef03e68771..a07442ffefb 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c @@ -1896,6 +1896,17 @@ serial8250_set_termios(struct uart_port *port, struct termios *termios, serial_outp(up, UART_EFR, efr); } +#ifdef CONFIG_ARCH_OMAP15XX + /* Workaround to enable 115200 baud on OMAP1510 internal ports */ + if (cpu_is_omap1510() && is_omap_port((unsigned int)up->port.membase)) { + if (baud == 115200) { + quot = 1; + serial_out(up, UART_OMAP_OSC_12M_SEL, 1); + } else + serial_out(up, UART_OMAP_OSC_12M_SEL, 0); + } +#endif + if (up->capabilities & UART_NATSEMI) { /* Switch to bank 2 not bank 1, to avoid resetting EXCR2 */ serial_outp(up, UART_LCR, 0xe0); -- cgit v1.2.3 From e480af09c49736848f749a43dff2c902104f6691 Mon Sep 17 00:00:00 2001 From: Dave Jones Date: Mon, 25 Sep 2006 16:51:26 -0700 Subject: [SERIAL] tickle NMI watchdog on serial output. Serial is _slow_ sometimes. So slow, that the NMI watchdog kicks in. NMI Watchdog detected LOCKUP on CPU2CPU 2 Modules linked in: loop usb_storage md5 ipv6 parport_pc lp parport autofs4 i2c_dev i2c_core rfcomm l2cap bluetooth sunrpc pcdPid: 3138, comm: gpm Not tainted 2.6.11-1.1290_FC4smp RIP: 0010:[] {serial_in+106} RSP: 0018:ffff81003afc3d50 EFLAGS: 00000002 RAX: 0000000000000020 RBX: 0000000000000020 RCX: 0000000000000000 RDX: 00000000000003fd RSI: 0000000000000005 RDI: ffffffff804dcd60 RBP: 00000000000024fc R08: 000000000000000a R09: 0000000000000033 R10: ffff81001beb7c20 R11: 0000000000000020 R12: ffffffff804dcd60 R13: ffffffff804ade76 R14: 000000000000002b R15: 000000000000002c FS: 00002aaaaaac4920(0000) GS:ffffffff804fca00(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b CR2: 00002aaaaabcb000 CR3: 000000003c0d0000 CR4: 00000000000006e0 Process gpm (pid: 3138, threadinfo ffff81003afc2000, task ffff81003eb63780) Stack: ffffffff80275f2e 0000000000000000 ffffffff80448380 0000000000007d6b 000000000000002c fffffffffffffbbf 0000000000000292 0000000000008000 ffffffff80138e8c 0000000000007d97 Call Trace:{serial8250_console_write+270} {__call_console_drivers+76} {release_console_sem+315} {con_open+149} {tty_open+537} {chrdev_open+387} {dentry_open+260} {filp_open+68} {get_unused_fd+227} {sys_open+76} {tracesys+209} Code: 0f b6 c0 c3 66 90 41 57 49 89 f7 41 56 41 be 00 01 00 00 41 console shuts up ... I initially did the patch below a year ago for the Fedora kernel, and have been keeping it up to date since. I recently got the same thing happening on a vanilla kernel, so figured it was time to repost this. Signed-off-by: Dave Jones Acked-by: Alan Cox Signed-off-by: Andrew Morton Signed-off-by: Russell King --- drivers/serial/8250.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers/serial/8250.c') diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index a07442ffefb..0ede0ee6424 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c @@ -2232,9 +2232,10 @@ static inline void wait_for_xmitr(struct uart_8250_port *up, int bits) /* Wait up to 1s for flow control if necessary */ if (up->port.flags & UPF_CONS_FLOW) { tmout = 1000000; - while (--tmout && - ((serial_in(up, UART_MSR) & UART_MSR_CTS) == 0)) + while (!(serial_in(up, UART_MSR) & UART_MSR_CTS) && --tmout) { udelay(1); + touch_nmi_watchdog(); + } } } -- cgit v1.2.3