aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/serial')
-rw-r--r--drivers/serial/8250.c5
-rw-r--r--drivers/serial/8250_pnp.c2
-rw-r--r--drivers/serial/dz.c48
-rw-r--r--drivers/serial/mpc52xx_uart.c4
-rw-r--r--drivers/serial/sa1100.c4
-rw-r--r--drivers/serial/serial_core.c84
6 files changed, 82 insertions, 65 deletions
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index 3742753241ee..e08510d09ff6 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -999,7 +999,10 @@ static void autoconfig(struct uart_8250_port *up, unsigned int probeflags)
999 serial_outp(up, UART_MCR, save_mcr); 999 serial_outp(up, UART_MCR, save_mcr);
1000 serial8250_clear_fifos(up); 1000 serial8250_clear_fifos(up);
1001 (void)serial_in(up, UART_RX); 1001 (void)serial_in(up, UART_RX);
1002 serial_outp(up, UART_IER, 0); 1002 if (up->capabilities & UART_CAP_UUE)
1003 serial_outp(up, UART_IER, UART_IER_UUE);
1004 else
1005 serial_outp(up, UART_IER, 0);
1003 1006
1004 out: 1007 out:
1005 spin_unlock_irqrestore(&up->port.lock, flags); 1008 spin_unlock_irqrestore(&up->port.lock, flags);
diff --git a/drivers/serial/8250_pnp.c b/drivers/serial/8250_pnp.c
index 5d8660a42b77..b79ed0665d51 100644
--- a/drivers/serial/8250_pnp.c
+++ b/drivers/serial/8250_pnp.c
@@ -323,6 +323,8 @@ static const struct pnp_device_id pnp_dev_table[] = {
323 { "USR9180", 0 }, 323 { "USR9180", 0 },
324 /* U.S. Robotics 56K Voice INT PnP*/ 324 /* U.S. Robotics 56K Voice INT PnP*/
325 { "USR9190", 0 }, 325 { "USR9190", 0 },
326 /* HP Compaq Tablet PC tc1100 Wacom tablet */
327 { "WACF005", 0 },
326 /* Rockwell's (PORALiNK) 33600 INT PNP */ 328 /* Rockwell's (PORALiNK) 33600 INT PNP */
327 { "WCI0003", 0 }, 329 { "WCI0003", 0 },
328 /* Unkown PnP modems */ 330 /* Unkown PnP modems */
diff --git a/drivers/serial/dz.c b/drivers/serial/dz.c
index e63b9dffc8d7..4d8516d1bb71 100644
--- a/drivers/serial/dz.c
+++ b/drivers/serial/dz.c
@@ -1,9 +1,9 @@
1/* 1/*
2 * dz.c: Serial port driver for DECStations equiped 2 * dz.c: Serial port driver for DECStations equiped
3 * with the DZ chipset. 3 * with the DZ chipset.
4 * 4 *
5 * Copyright (C) 1998 Olivier A. D. Lebaillif 5 * Copyright (C) 1998 Olivier A. D. Lebaillif
6 * 6 *
7 * Email: olivier.lebaillif@ifrsys.com 7 * Email: olivier.lebaillif@ifrsys.com
8 * 8 *
9 * [31-AUG-98] triemer 9 * [31-AUG-98] triemer
@@ -11,14 +11,14 @@
11 * removed base_addr code - moving address assignment to setup.c 11 * removed base_addr code - moving address assignment to setup.c
12 * Changed name of dz_init to rs_init to be consistent with tc code 12 * Changed name of dz_init to rs_init to be consistent with tc code
13 * [13-NOV-98] triemer fixed code to receive characters 13 * [13-NOV-98] triemer fixed code to receive characters
14 * after patches by harald to irq code. 14 * after patches by harald to irq code.
15 * [09-JAN-99] triemer minor fix for schedule - due to removal of timeout 15 * [09-JAN-99] triemer minor fix for schedule - due to removal of timeout
16 * field from "current" - somewhere between 2.1.121 and 2.1.131 16 * field from "current" - somewhere between 2.1.121 and 2.1.131
17 Qua Jun 27 15:02:26 BRT 2001 17 Qua Jun 27 15:02:26 BRT 2001
18 * [27-JUN-2001] Arnaldo Carvalho de Melo <acme@conectiva.com.br> - cleanups 18 * [27-JUN-2001] Arnaldo Carvalho de Melo <acme@conectiva.com.br> - cleanups
19 * 19 *
20 * Parts (C) 1999 David Airlie, airlied@linux.ie 20 * Parts (C) 1999 David Airlie, airlied@linux.ie
21 * [07-SEP-99] Bugfixes 21 * [07-SEP-99] Bugfixes
22 * 22 *
23 * [06-Jan-2002] Russell King <rmk@arm.linux.org.uk> 23 * [06-Jan-2002] Russell King <rmk@arm.linux.org.uk>
24 * Converted to new serial core 24 * Converted to new serial core
@@ -64,7 +64,7 @@ static struct dz_port dz_ports[DZ_NB_PORT];
64 64
65#ifdef DEBUG_DZ 65#ifdef DEBUG_DZ
66/* 66/*
67 * debugging code to send out chars via prom 67 * debugging code to send out chars via prom
68 */ 68 */
69static void debug_console(const char *s, int count) 69static void debug_console(const char *s, int count)
70{ 70{
@@ -82,7 +82,7 @@ static void debug_console(const char *s, int count)
82 * ------------------------------------------------------------ 82 * ------------------------------------------------------------
83 * dz_in () and dz_out () 83 * dz_in () and dz_out ()
84 * 84 *
85 * These routines are used to access the registers of the DZ 85 * These routines are used to access the registers of the DZ
86 * chip, hiding relocation differences between implementation. 86 * chip, hiding relocation differences between implementation.
87 * ------------------------------------------------------------ 87 * ------------------------------------------------------------
88 */ 88 */
@@ -106,8 +106,8 @@ static inline void dz_out(struct dz_port *dport, unsigned offset,
106 * ------------------------------------------------------------ 106 * ------------------------------------------------------------
107 * rs_stop () and rs_start () 107 * rs_stop () and rs_start ()
108 * 108 *
109 * These routines are called before setting or resetting 109 * These routines are called before setting or resetting
110 * tty->stopped. They enable or disable transmitter interrupts, 110 * tty->stopped. They enable or disable transmitter interrupts,
111 * as necessary. 111 * as necessary.
112 * ------------------------------------------------------------ 112 * ------------------------------------------------------------
113 */ 113 */
@@ -156,17 +156,17 @@ static void dz_enable_ms(struct uart_port *port)
156 156
157/* 157/*
158 * ------------------------------------------------------------ 158 * ------------------------------------------------------------
159 * Here starts the interrupt handling routines. All of the 159 * Here starts the interrupt handling routines. All of the
160 * following subroutines are declared as inline and are folded 160 * following subroutines are declared as inline and are folded
161 * into dz_interrupt. They were separated out for readability's 161 * into dz_interrupt. They were separated out for readability's
162 * sake. 162 * sake.
163 * 163 *
164 * Note: rs_interrupt() is a "fast" interrupt, which means that it 164 * Note: rs_interrupt() is a "fast" interrupt, which means that it
165 * runs with interrupts turned off. People who may want to modify 165 * runs with interrupts turned off. People who may want to modify
166 * rs_interrupt() should try to keep the interrupt handler as fast as 166 * rs_interrupt() should try to keep the interrupt handler as fast as
167 * possible. After you are done making modifications, it is not a bad 167 * possible. After you are done making modifications, it is not a bad
168 * idea to do: 168 * idea to do:
169 * 169 *
170 * make drivers/serial/dz.s 170 * make drivers/serial/dz.s
171 * 171 *
172 * and look at the resulting assemble code in dz.s. 172 * and look at the resulting assemble code in dz.s.
@@ -403,7 +403,7 @@ static void dz_set_mctrl(struct uart_port *uport, unsigned int mctrl)
403 * startup () 403 * startup ()
404 * 404 *
405 * various initialization tasks 405 * various initialization tasks
406 * ------------------------------------------------------------------- 406 * -------------------------------------------------------------------
407 */ 407 */
408static int dz_startup(struct uart_port *uport) 408static int dz_startup(struct uart_port *uport)
409{ 409{
@@ -430,13 +430,13 @@ static int dz_startup(struct uart_port *uport)
430 return 0; 430 return 0;
431} 431}
432 432
433/* 433/*
434 * ------------------------------------------------------------------- 434 * -------------------------------------------------------------------
435 * shutdown () 435 * shutdown ()
436 * 436 *
437 * This routine will shutdown a serial port; interrupts are disabled, and 437 * This routine will shutdown a serial port; interrupts are disabled, and
438 * DTR is dropped if the hangup on close termio flag is on. 438 * DTR is dropped if the hangup on close termio flag is on.
439 * ------------------------------------------------------------------- 439 * -------------------------------------------------------------------
440 */ 440 */
441static void dz_shutdown(struct uart_port *uport) 441static void dz_shutdown(struct uart_port *uport)
442{ 442{
@@ -451,7 +451,7 @@ static void dz_shutdown(struct uart_port *uport)
451 * release the bus after transmitting. This must be done when 451 * release the bus after transmitting. This must be done when
452 * the transmit shift register is empty, not be done when the 452 * the transmit shift register is empty, not be done when the
453 * transmit holding register is empty. This functionality 453 * transmit holding register is empty. This functionality
454 * allows an RS485 driver to be written in user space. 454 * allows an RS485 driver to be written in user space.
455 */ 455 */
456static unsigned int dz_tx_empty(struct uart_port *uport) 456static unsigned int dz_tx_empty(struct uart_port *uport)
457{ 457{
@@ -645,9 +645,9 @@ static void __init dz_init_ports(void)
645 645
646 if (mips_machtype == MACH_DS23100 || 646 if (mips_machtype == MACH_DS23100 ||
647 mips_machtype == MACH_DS5100) 647 mips_machtype == MACH_DS5100)
648 base = (unsigned long) KN01_DZ11_BASE; 648 base = CKSEG1ADDR(KN01_SLOT_BASE + KN01_DZ11);
649 else 649 else
650 base = (unsigned long) KN02_DZ11_BASE; 650 base = CKSEG1ADDR(KN02_SLOT_BASE + KN02_DZ11);
651 651
652 for (i = 0, dport = dz_ports; i < DZ_NB_PORT; i++, dport++) { 652 for (i = 0, dport = dz_ports; i < DZ_NB_PORT; i++, dport++) {
653 spin_lock_init(&dport->port.lock); 653 spin_lock_init(&dport->port.lock);
@@ -695,13 +695,13 @@ static void dz_console_put_char(struct dz_port *dport, unsigned char ch)
695 695
696 spin_unlock_irqrestore(&dport->port.lock, flags); 696 spin_unlock_irqrestore(&dport->port.lock, flags);
697} 697}
698/* 698/*
699 * ------------------------------------------------------------------- 699 * -------------------------------------------------------------------
700 * dz_console_print () 700 * dz_console_print ()
701 * 701 *
702 * dz_console_print is registered for printk. 702 * dz_console_print is registered for printk.
703 * The console must be locked when we get here. 703 * The console must be locked when we get here.
704 * ------------------------------------------------------------------- 704 * -------------------------------------------------------------------
705 */ 705 */
706static void dz_console_print(struct console *cons, 706static void dz_console_print(struct console *cons,
707 const char *str, 707 const char *str,
diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c
index 5d3cb8486447..b8727d9bf690 100644
--- a/drivers/serial/mpc52xx_uart.c
+++ b/drivers/serial/mpc52xx_uart.c
@@ -725,7 +725,7 @@ mpc52xx_uart_probe(struct platform_device *dev)
725 int i, idx, ret; 725 int i, idx, ret;
726 726
727 /* Check validity & presence */ 727 /* Check validity & presence */
728 idx = pdev->id; 728 idx = dev->id;
729 if (idx < 0 || idx >= MPC52xx_PSC_MAXNUM) 729 if (idx < 0 || idx >= MPC52xx_PSC_MAXNUM)
730 return -EINVAL; 730 return -EINVAL;
731 731
@@ -748,7 +748,7 @@ mpc52xx_uart_probe(struct platform_device *dev)
748 port->ops = &mpc52xx_uart_ops; 748 port->ops = &mpc52xx_uart_ops;
749 749
750 /* Search for IRQ and mapbase */ 750 /* Search for IRQ and mapbase */
751 for (i=0 ; i<pdev->num_resources ; i++, res++) { 751 for (i=0 ; i<dev->num_resources ; i++, res++) {
752 if (res->flags & IORESOURCE_MEM) 752 if (res->flags & IORESOURCE_MEM)
753 port->mapbase = res->start; 753 port->mapbase = res->start;
754 else if (res->flags & IORESOURCE_IRQ) 754 else if (res->flags & IORESOURCE_IRQ)
diff --git a/drivers/serial/sa1100.c b/drivers/serial/sa1100.c
index fd9deee20e05..0e3daf6d7b50 100644
--- a/drivers/serial/sa1100.c
+++ b/drivers/serial/sa1100.c
@@ -156,7 +156,7 @@ static void sa1100_stop_tx(struct uart_port *port)
156} 156}
157 157
158/* 158/*
159 * interrupts may not be disabled on entry 159 * port locked and interrupts disabled
160 */ 160 */
161static void sa1100_start_tx(struct uart_port *port) 161static void sa1100_start_tx(struct uart_port *port)
162{ 162{
@@ -164,11 +164,9 @@ static void sa1100_start_tx(struct uart_port *port)
164 unsigned long flags; 164 unsigned long flags;
165 u32 utcr3; 165 u32 utcr3;
166 166
167 spin_lock_irqsave(&sport->port.lock, flags);
168 utcr3 = UART_GET_UTCR3(sport); 167 utcr3 = UART_GET_UTCR3(sport);
169 sport->port.read_status_mask |= UTSR0_TO_SM(UTSR0_TFS); 168 sport->port.read_status_mask |= UTSR0_TO_SM(UTSR0_TFS);
170 UART_PUT_UTCR3(sport, utcr3 | UTCR3_TIE); 169 UART_PUT_UTCR3(sport, utcr3 | UTCR3_TIE);
171 spin_unlock_irqrestore(&sport->port.lock, flags);
172} 170}
173 171
174/* 172/*
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c
index 427a23858076..2331296e1e17 100644
--- a/drivers/serial/serial_core.c
+++ b/drivers/serial/serial_core.c
@@ -209,33 +209,45 @@ static void uart_shutdown(struct uart_state *state)
209 struct uart_info *info = state->info; 209 struct uart_info *info = state->info;
210 struct uart_port *port = state->port; 210 struct uart_port *port = state->port;
211 211
212 if (!(info->flags & UIF_INITIALIZED))
213 return;
214
215 /* 212 /*
216 * Turn off DTR and RTS early. 213 * Set the TTY IO error marker
217 */ 214 */
218 if (!info->tty || (info->tty->termios->c_cflag & HUPCL)) 215 if (info->tty)
219 uart_clear_mctrl(port, TIOCM_DTR | TIOCM_RTS); 216 set_bit(TTY_IO_ERROR, &info->tty->flags);
220 217
221 /* 218 if (info->flags & UIF_INITIALIZED) {
222 * clear delta_msr_wait queue to avoid mem leaks: we may free 219 info->flags &= ~UIF_INITIALIZED;
223 * the irq here so the queue might never be woken up. Note
224 * that we won't end up waiting on delta_msr_wait again since
225 * any outstanding file descriptors should be pointing at
226 * hung_up_tty_fops now.
227 */
228 wake_up_interruptible(&info->delta_msr_wait);
229 220
230 /* 221 /*
231 * Free the IRQ and disable the port. 222 * Turn off DTR and RTS early.
232 */ 223 */
233 port->ops->shutdown(port); 224 if (!info->tty || (info->tty->termios->c_cflag & HUPCL))
225 uart_clear_mctrl(port, TIOCM_DTR | TIOCM_RTS);
226
227 /*
228 * clear delta_msr_wait queue to avoid mem leaks: we may free
229 * the irq here so the queue might never be woken up. Note
230 * that we won't end up waiting on delta_msr_wait again since
231 * any outstanding file descriptors should be pointing at
232 * hung_up_tty_fops now.
233 */
234 wake_up_interruptible(&info->delta_msr_wait);
235
236 /*
237 * Free the IRQ and disable the port.
238 */
239 port->ops->shutdown(port);
240
241 /*
242 * Ensure that the IRQ handler isn't running on another CPU.
243 */
244 synchronize_irq(port->irq);
245 }
234 246
235 /* 247 /*
236 * Ensure that the IRQ handler isn't running on another CPU. 248 * kill off our tasklet
237 */ 249 */
238 synchronize_irq(port->irq); 250 tasklet_kill(&info->tlet);
239 251
240 /* 252 /*
241 * Free the transmit buffer page. 253 * Free the transmit buffer page.
@@ -244,15 +256,6 @@ static void uart_shutdown(struct uart_state *state)
244 free_page((unsigned long)info->xmit.buf); 256 free_page((unsigned long)info->xmit.buf);
245 info->xmit.buf = NULL; 257 info->xmit.buf = NULL;
246 } 258 }
247
248 /*
249 * kill off our tasklet
250 */
251 tasklet_kill(&info->tlet);
252 if (info->tty)
253 set_bit(TTY_IO_ERROR, &info->tty->flags);
254
255 info->flags &= ~UIF_INITIALIZED;
256} 259}
257 260
258/** 261/**
@@ -1928,14 +1931,25 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *port)
1928 1931
1929 if (state->info && state->info->flags & UIF_INITIALIZED) { 1932 if (state->info && state->info->flags & UIF_INITIALIZED) {
1930 struct uart_ops *ops = port->ops; 1933 struct uart_ops *ops = port->ops;
1934 int ret;
1931 1935
1932 ops->set_mctrl(port, 0); 1936 ops->set_mctrl(port, 0);
1933 ops->startup(port); 1937 ret = ops->startup(port);
1934 uart_change_speed(state, NULL); 1938 if (ret == 0) {
1935 spin_lock_irq(&port->lock); 1939 uart_change_speed(state, NULL);
1936 ops->set_mctrl(port, port->mctrl); 1940 spin_lock_irq(&port->lock);
1937 ops->start_tx(port); 1941 ops->set_mctrl(port, port->mctrl);
1938 spin_unlock_irq(&port->lock); 1942 ops->start_tx(port);
1943 spin_unlock_irq(&port->lock);
1944 } else {
1945 /*
1946 * Failed to resume - maybe hardware went away?
1947 * Clear the "initialized" flag so we won't try
1948 * to call the low level drivers shutdown method.
1949 */
1950 state->info->flags &= ~UIF_INITIALIZED;
1951 uart_shutdown(state);
1952 }
1939 } 1953 }
1940 1954
1941 up(&state->sem); 1955 up(&state->sem);