aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/serial_core.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-10-03 12:13:29 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-03 12:13:29 -0400
commit6f3a28f7d1f0a65a78443c273b6e8ec01becf301 (patch)
treeea57276725b31ba115f44cb5267a7d85b133e6fb /drivers/serial/serial_core.c
parent6ebfc0e20b409f13e62bbb84ce70102b49945cfd (diff)
parent75fde2eddcfcd1dcc87a72dc6cd3c859420b6148 (diff)
Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-serial
* 'devel' of master.kernel.org:/home/rmk/linux-2.6-serial: (21 commits) [SERIAL] add PNP IDs for FPI based touchscreens [SERIAL] Magic SysRq SAK does nothing on serial consoles [SERIAL] tickle NMI watchdog on serial output. [SERIAL] Fix oops when removing suspended serial port [SERIAL] Fix resume handling bug [SERIAL] Remove wrong asm/serial.h inclusions [SERIAL] CONFIG_PM=n slim: drivers/serial/8250_pci.c [SERIAL] OMAP1510 serial fix for 115200 baud [SERIAL] returning proper error from serial core driver [SERIAL] Make uart_line_info() correctly tell MMIO from I/O port [SERIAL] suspend/resume handlers don't have level arg anymore [SERIAL] 8250 resourse management fixes [SERIAL] serial_cs: Add quirk for brainboxes 2-port RS232 card [SERIAL] serial_cs: handle Nokia multi->single port bodge via config quirk [SERIAL] serial_cs: add configuration quirk [SERIAL] serial_cs: Convert Oxford 950 / Possio GCC wakeup quirk [SERIAL] serial_cs: convert IBM post-init handling to a quirk [SERIAL] serial_cs: allow wildcarded quirks [SERIAL] serial_cs: convert multi-port table to quirk table [SERIAL] serial_cs: Use clean up multiport card detection ...
Diffstat (limited to 'drivers/serial/serial_core.c')
-rw-r--r--drivers/serial/serial_core.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c
index de5e8930a6fd..c67b05e9a451 100644
--- a/drivers/serial/serial_core.c
+++ b/drivers/serial/serial_core.c
@@ -792,6 +792,7 @@ static int uart_set_info(struct uart_state *state,
792 * We failed anyway. 792 * We failed anyway.
793 */ 793 */
794 retval = -EBUSY; 794 retval = -EBUSY;
795 goto exit; // Added to return the correct error -Ram Gupta
795 } 796 }
796 } 797 }
797 798
@@ -1662,16 +1663,16 @@ static int uart_line_info(char *buf, struct uart_driver *drv, int i)
1662 struct uart_port *port = state->port; 1663 struct uart_port *port = state->port;
1663 char stat_buf[32]; 1664 char stat_buf[32];
1664 unsigned int status; 1665 unsigned int status;
1665 int ret; 1666 int mmio, ret;
1666 1667
1667 if (!port) 1668 if (!port)
1668 return 0; 1669 return 0;
1669 1670
1671 mmio = port->iotype >= UPIO_MEM;
1670 ret = sprintf(buf, "%d: uart:%s %s%08lX irq:%d", 1672 ret = sprintf(buf, "%d: uart:%s %s%08lX irq:%d",
1671 port->line, uart_type(port), 1673 port->line, uart_type(port),
1672 port->iotype == UPIO_MEM ? "mmio:0x" : "port:", 1674 mmio ? "mmio:0x" : "port:",
1673 port->iotype == UPIO_MEM ? port->mapbase : 1675 mmio ? port->mapbase : (unsigned long) port->iobase,
1674 (unsigned long) port->iobase,
1675 port->irq); 1676 port->irq);
1676 1677
1677 if (port->type == PORT_UNKNOWN) { 1678 if (port->type == PORT_UNKNOWN) {
@@ -1939,6 +1940,9 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *port)
1939 if (state->info && state->info->flags & UIF_INITIALIZED) { 1940 if (state->info && state->info->flags & UIF_INITIALIZED) {
1940 const struct uart_ops *ops = port->ops; 1941 const struct uart_ops *ops = port->ops;
1941 1942
1943 state->info->flags = (state->info->flags & ~UIF_INITIALIZED)
1944 | UIF_SUSPENDED;
1945
1942 spin_lock_irq(&port->lock); 1946 spin_lock_irq(&port->lock);
1943 ops->stop_tx(port); 1947 ops->stop_tx(port);
1944 ops->set_mctrl(port, 0); 1948 ops->set_mctrl(port, 0);
@@ -2005,7 +2009,7 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *port)
2005 console_start(port->cons); 2009 console_start(port->cons);
2006 } 2010 }
2007 2011
2008 if (state->info && state->info->flags & UIF_INITIALIZED) { 2012 if (state->info && state->info->flags & UIF_SUSPENDED) {
2009 const struct uart_ops *ops = port->ops; 2013 const struct uart_ops *ops = port->ops;
2010 int ret; 2014 int ret;
2011 2015
@@ -2017,15 +2021,17 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *port)
2017 ops->set_mctrl(port, port->mctrl); 2021 ops->set_mctrl(port, port->mctrl);
2018 ops->start_tx(port); 2022 ops->start_tx(port);
2019 spin_unlock_irq(&port->lock); 2023 spin_unlock_irq(&port->lock);
2024 state->info->flags |= UIF_INITIALIZED;
2020 } else { 2025 } else {
2021 /* 2026 /*
2022 * Failed to resume - maybe hardware went away? 2027 * Failed to resume - maybe hardware went away?
2023 * Clear the "initialized" flag so we won't try 2028 * Clear the "initialized" flag so we won't try
2024 * to call the low level drivers shutdown method. 2029 * to call the low level drivers shutdown method.
2025 */ 2030 */
2026 state->info->flags &= ~UIF_INITIALIZED;
2027 uart_shutdown(state); 2031 uart_shutdown(state);
2028 } 2032 }
2033
2034 state->info->flags &= ~UIF_SUSPENDED;
2029 } 2035 }
2030 2036
2031 mutex_unlock(&state->mutex); 2037 mutex_unlock(&state->mutex);