aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-01-21 10:37:20 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-01-21 10:37:20 -0500
commitbdeef61cd053b6a88be7d2c82fd43e12f8c9f75e (patch)
tree6980d178f5402260dfc3c35840b95dc5584cf85e
parent4caca5f917ce991dc67fbb42fa82a1f044538e23 (diff)
parent703625118069f9f8960d356676662d3db5a9d116 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6: tty: fix race in tty_fasync serial: serial_cs: oxsemi quirk breaks resume serial: imx: bit &/| confusion serial: Fix crash if the minimum rate of the device is > 9600 baud serial-core: resume serial hardware with no_console_suspend serial: 8250_pnp: use wildcard for serial Wacom tablets nozomi: quick fix for the close/close bug compat_ioctl: Supress "unknown cmd" message on serial /dev/console
-rw-r--r--drivers/char/nozomi.c2
-rw-r--r--drivers/char/tty_io.c2
-rw-r--r--drivers/serial/8250_pnp.c10
-rw-r--r--drivers/serial/imx.c2
-rw-r--r--drivers/serial/serial_core.c105
-rw-r--r--drivers/serial/serial_cs.c3
-rw-r--r--fs/compat_ioctl.c3
7 files changed, 54 insertions, 73 deletions
diff --git a/drivers/char/nozomi.c b/drivers/char/nozomi.c
index 7d73cd430340..2ad7d37afbd0 100644
--- a/drivers/char/nozomi.c
+++ b/drivers/char/nozomi.c
@@ -1651,10 +1651,10 @@ static void ntty_close(struct tty_struct *tty, struct file *file)
1651 1651
1652 dc->open_ttys--; 1652 dc->open_ttys--;
1653 port->count--; 1653 port->count--;
1654 tty_port_tty_set(port, NULL);
1655 1654
1656 if (port->count == 0) { 1655 if (port->count == 0) {
1657 DBG1("close: %d", nport->token_dl); 1656 DBG1("close: %d", nport->token_dl);
1657 tty_port_tty_set(port, NULL);
1658 spin_lock_irqsave(&dc->spin_mutex, flags); 1658 spin_lock_irqsave(&dc->spin_mutex, flags);
1659 dc->last_ier &= ~(nport->token_dl); 1659 dc->last_ier &= ~(nport->token_dl);
1660 writew(dc->last_ier, dc->reg_ier); 1660 writew(dc->last_ier, dc->reg_ier);
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index f15df40bc318..c6f3b48be9dd 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -1951,8 +1951,8 @@ static int tty_fasync(int fd, struct file *filp, int on)
1951 pid = task_pid(current); 1951 pid = task_pid(current);
1952 type = PIDTYPE_PID; 1952 type = PIDTYPE_PID;
1953 } 1953 }
1954 spin_unlock_irqrestore(&tty->ctrl_lock, flags);
1955 retval = __f_setown(filp, pid, type, 0); 1954 retval = __f_setown(filp, pid, type, 0);
1955 spin_unlock_irqrestore(&tty->ctrl_lock, flags);
1956 if (retval) 1956 if (retval)
1957 goto out; 1957 goto out;
1958 } else { 1958 } else {
diff --git a/drivers/serial/8250_pnp.c b/drivers/serial/8250_pnp.c
index b5496a19d967..24485cc62ff8 100644
--- a/drivers/serial/8250_pnp.c
+++ b/drivers/serial/8250_pnp.c
@@ -328,15 +328,7 @@ static const struct pnp_device_id pnp_dev_table[] = {
328 /* U.S. Robotics 56K Voice INT PnP*/ 328 /* U.S. Robotics 56K Voice INT PnP*/
329 { "USR9190", 0 }, 329 { "USR9190", 0 },
330 /* Wacom tablets */ 330 /* Wacom tablets */
331 { "WACF004", 0 }, 331 { "WACFXXX", 0 },
332 { "WACF005", 0 },
333 { "WACF006", 0 },
334 { "WACF007", 0 },
335 { "WACF008", 0 },
336 { "WACF009", 0 },
337 { "WACF00A", 0 },
338 { "WACF00B", 0 },
339 { "WACF00C", 0 },
340 /* Compaq touchscreen */ 332 /* Compaq touchscreen */
341 { "FPI2002", 0 }, 333 { "FPI2002", 0 },
342 /* Fujitsu Stylistic touchscreens */ 334 /* Fujitsu Stylistic touchscreens */
diff --git a/drivers/serial/imx.c b/drivers/serial/imx.c
index 18130f11238e..60d665a17a88 100644
--- a/drivers/serial/imx.c
+++ b/drivers/serial/imx.c
@@ -1088,7 +1088,7 @@ imx_console_get_options(struct imx_port *sport, int *baud,
1088 int *parity, int *bits) 1088 int *parity, int *bits)
1089{ 1089{
1090 1090
1091 if ( readl(sport->port.membase + UCR1) | UCR1_UARTEN ) { 1091 if (readl(sport->port.membase + UCR1) & UCR1_UARTEN) {
1092 /* ok, the port was enabled */ 1092 /* ok, the port was enabled */
1093 unsigned int ucr2, ubir,ubmr, uartclk; 1093 unsigned int ucr2, ubir,ubmr, uartclk;
1094 unsigned int baud_raw; 1094 unsigned int baud_raw;
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c
index 047530b285bb..7f2830709512 100644
--- a/drivers/serial/serial_core.c
+++ b/drivers/serial/serial_core.c
@@ -385,13 +385,20 @@ uart_get_baud_rate(struct uart_port *port, struct ktermios *termios,
385 } 385 }
386 386
387 /* 387 /*
388 * As a last resort, if the quotient is zero, 388 * As a last resort, if the range cannot be met then clip to
389 * default to 9600 bps 389 * the nearest chip supported rate.
390 */ 390 */
391 if (!hung_up) 391 if (!hung_up) {
392 tty_termios_encode_baud_rate(termios, 9600, 9600); 392 if (baud <= min)
393 tty_termios_encode_baud_rate(termios,
394 min + 1, min + 1);
395 else
396 tty_termios_encode_baud_rate(termios,
397 max - 1, max - 1);
398 }
393 } 399 }
394 400 /* Should never happen */
401 WARN_ON(1);
395 return 0; 402 return 0;
396} 403}
397 404
@@ -2006,12 +2013,6 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *uport)
2006 2013
2007 mutex_lock(&port->mutex); 2014 mutex_lock(&port->mutex);
2008 2015
2009 if (!console_suspend_enabled && uart_console(uport)) {
2010 /* we're going to avoid suspending serial console */
2011 mutex_unlock(&port->mutex);
2012 return 0;
2013 }
2014
2015 tty_dev = device_find_child(uport->dev, &match, serial_match_port); 2016 tty_dev = device_find_child(uport->dev, &match, serial_match_port);
2016 if (device_may_wakeup(tty_dev)) { 2017 if (device_may_wakeup(tty_dev)) {
2017 enable_irq_wake(uport->irq); 2018 enable_irq_wake(uport->irq);
@@ -2019,20 +2020,23 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *uport)
2019 mutex_unlock(&port->mutex); 2020 mutex_unlock(&port->mutex);
2020 return 0; 2021 return 0;
2021 } 2022 }
2022 uport->suspended = 1; 2023 if (console_suspend_enabled || !uart_console(uport))
2024 uport->suspended = 1;
2023 2025
2024 if (port->flags & ASYNC_INITIALIZED) { 2026 if (port->flags & ASYNC_INITIALIZED) {
2025 const struct uart_ops *ops = uport->ops; 2027 const struct uart_ops *ops = uport->ops;
2026 int tries; 2028 int tries;
2027 2029
2028 set_bit(ASYNCB_SUSPENDED, &port->flags); 2030 if (console_suspend_enabled || !uart_console(uport)) {
2029 clear_bit(ASYNCB_INITIALIZED, &port->flags); 2031 set_bit(ASYNCB_SUSPENDED, &port->flags);
2032 clear_bit(ASYNCB_INITIALIZED, &port->flags);
2030 2033
2031 spin_lock_irq(&uport->lock); 2034 spin_lock_irq(&uport->lock);
2032 ops->stop_tx(uport); 2035 ops->stop_tx(uport);
2033 ops->set_mctrl(uport, 0); 2036 ops->set_mctrl(uport, 0);
2034 ops->stop_rx(uport); 2037 ops->stop_rx(uport);
2035 spin_unlock_irq(&uport->lock); 2038 spin_unlock_irq(&uport->lock);
2039 }
2036 2040
2037 /* 2041 /*
2038 * Wait for the transmitter to empty. 2042 * Wait for the transmitter to empty.
@@ -2047,16 +2051,18 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *uport)
2047 drv->dev_name, 2051 drv->dev_name,
2048 drv->tty_driver->name_base + uport->line); 2052 drv->tty_driver->name_base + uport->line);
2049 2053
2050 ops->shutdown(uport); 2054 if (console_suspend_enabled || !uart_console(uport))
2055 ops->shutdown(uport);
2051 } 2056 }
2052 2057
2053 /* 2058 /*
2054 * Disable the console device before suspending. 2059 * Disable the console device before suspending.
2055 */ 2060 */
2056 if (uart_console(uport)) 2061 if (console_suspend_enabled && uart_console(uport))
2057 console_stop(uport->cons); 2062 console_stop(uport->cons);
2058 2063
2059 uart_change_pm(state, 3); 2064 if (console_suspend_enabled || !uart_console(uport))
2065 uart_change_pm(state, 3);
2060 2066
2061 mutex_unlock(&port->mutex); 2067 mutex_unlock(&port->mutex);
2062 2068
@@ -2073,29 +2079,6 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *uport)
2073 2079
2074 mutex_lock(&port->mutex); 2080 mutex_lock(&port->mutex);
2075 2081
2076 if (!console_suspend_enabled && uart_console(uport)) {
2077 /* no need to resume serial console, it wasn't suspended */
2078 /*
2079 * First try to use the console cflag setting.
2080 */
2081 memset(&termios, 0, sizeof(struct ktermios));
2082 termios.c_cflag = uport->cons->cflag;
2083 /*
2084 * If that's unset, use the tty termios setting.
2085 */
2086 if (termios.c_cflag == 0)
2087 termios = *state->port.tty->termios;
2088 else {
2089 termios.c_ispeed = termios.c_ospeed =
2090 tty_termios_input_baud_rate(&termios);
2091 termios.c_ispeed = termios.c_ospeed =
2092 tty_termios_baud_rate(&termios);
2093 }
2094 uport->ops->set_termios(uport, &termios, NULL);
2095 mutex_unlock(&port->mutex);
2096 return 0;
2097 }
2098
2099 tty_dev = device_find_child(uport->dev, &match, serial_match_port); 2082 tty_dev = device_find_child(uport->dev, &match, serial_match_port);
2100 if (!uport->suspended && device_may_wakeup(tty_dev)) { 2083 if (!uport->suspended && device_may_wakeup(tty_dev)) {
2101 disable_irq_wake(uport->irq); 2084 disable_irq_wake(uport->irq);
@@ -2121,21 +2104,23 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *uport)
2121 spin_lock_irq(&uport->lock); 2104 spin_lock_irq(&uport->lock);
2122 ops->set_mctrl(uport, 0); 2105 ops->set_mctrl(uport, 0);
2123 spin_unlock_irq(&uport->lock); 2106 spin_unlock_irq(&uport->lock);
2124 ret = ops->startup(uport); 2107 if (console_suspend_enabled || !uart_console(uport)) {
2125 if (ret == 0) { 2108 ret = ops->startup(uport);
2126 uart_change_speed(state, NULL); 2109 if (ret == 0) {
2127 spin_lock_irq(&uport->lock); 2110 uart_change_speed(state, NULL);
2128 ops->set_mctrl(uport, uport->mctrl); 2111 spin_lock_irq(&uport->lock);
2129 ops->start_tx(uport); 2112 ops->set_mctrl(uport, uport->mctrl);
2130 spin_unlock_irq(&uport->lock); 2113 ops->start_tx(uport);
2131 set_bit(ASYNCB_INITIALIZED, &port->flags); 2114 spin_unlock_irq(&uport->lock);
2132 } else { 2115 set_bit(ASYNCB_INITIALIZED, &port->flags);
2133 /* 2116 } else {
2134 * Failed to resume - maybe hardware went away? 2117 /*
2135 * Clear the "initialized" flag so we won't try 2118 * Failed to resume - maybe hardware went away?
2136 * to call the low level drivers shutdown method. 2119 * Clear the "initialized" flag so we won't try
2137 */ 2120 * to call the low level drivers shutdown method.
2138 uart_shutdown(state); 2121 */
2122 uart_shutdown(state);
2123 }
2139 } 2124 }
2140 2125
2141 clear_bit(ASYNCB_SUSPENDED, &port->flags); 2126 clear_bit(ASYNCB_SUSPENDED, &port->flags);
diff --git a/drivers/serial/serial_cs.c b/drivers/serial/serial_cs.c
index 0ee7239c5d69..df854401af2d 100644
--- a/drivers/serial/serial_cs.c
+++ b/drivers/serial/serial_cs.c
@@ -146,7 +146,8 @@ static void quirk_wakeup_oxsemi(struct pcmcia_device *link)
146{ 146{
147 struct serial_info *info = link->priv; 147 struct serial_info *info = link->priv;
148 148
149 outb(12, info->c950ctrl + 1); 149 if (info->c950ctrl)
150 outb(12, info->c950ctrl + 1);
150} 151}
151 152
152/* request_region? oxsemi branch does no request_region too... */ 153/* request_region? oxsemi branch does no request_region too... */
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
index 332dd00f0894..c5c45de1a2ee 100644
--- a/fs/compat_ioctl.c
+++ b/fs/compat_ioctl.c
@@ -1005,6 +1005,9 @@ COMPATIBLE_IOCTL(SCSI_IOCTL_SEND_COMMAND)
1005COMPATIBLE_IOCTL(SCSI_IOCTL_PROBE_HOST) 1005COMPATIBLE_IOCTL(SCSI_IOCTL_PROBE_HOST)
1006COMPATIBLE_IOCTL(SCSI_IOCTL_GET_PCI) 1006COMPATIBLE_IOCTL(SCSI_IOCTL_GET_PCI)
1007#endif 1007#endif
1008/* Big V (don't complain on serial console) */
1009IGNORE_IOCTL(VT_OPENQRY)
1010IGNORE_IOCTL(VT_GETMODE)
1008/* Little p (/dev/rtc, /dev/envctrl, etc.) */ 1011/* Little p (/dev/rtc, /dev/envctrl, etc.) */
1009COMPATIBLE_IOCTL(RTC_AIE_ON) 1012COMPATIBLE_IOCTL(RTC_AIE_ON)
1010COMPATIBLE_IOCTL(RTC_AIE_OFF) 1013COMPATIBLE_IOCTL(RTC_AIE_OFF)