aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-08-26 16:06:06 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-08-26 16:06:06 -0400
commitefe45ab1ee04551936f8343bd4ca1ff02ffc23bb (patch)
treef2bc88ccd5a01770b6a8efe3f6023068179f610b /drivers
parent3ab47029d91993745212624e49d16a75abc8f207 (diff)
parentb280a97d1caf6fe1d38b51ebb31219391f5ad1a0 (diff)
Merge branch 'tty-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6
* 'tty-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6: omap-serial: Allow IXON and IXOFF to be disabled. TTY: serial, document ignoring of uart->ops->startup error TTY: pty, fix pty counting 8250: Fix race condition in serial8250_backup_timeout(). serial/8250_pci: delete duplicate data definition 8250_pci: add support for Rosewill RC-305 4x serial port card tty: Add "spi:" prefix for spi modalias atmel_serial: fix atmel_default_console_device serial: 8250_pnp: add Intermec CV60 touchscreen device drivers/serial/ucc_uart.c: Fix compiler warning pch_uart: Set PCIe bus number using probe parameter serial: samsung: Fix build error
Diffstat (limited to 'drivers')
-rw-r--r--drivers/tty/pty.c17
-rw-r--r--drivers/tty/serial/8250.c8
-rw-r--r--drivers/tty/serial/8250_pci.c11
-rw-r--r--drivers/tty/serial/8250_pnp.c3
-rw-r--r--drivers/tty/serial/atmel_serial.c8
-rw-r--r--drivers/tty/serial/max3107-aava.c2
-rw-r--r--drivers/tty/serial/max3107.c2
-rw-r--r--drivers/tty/serial/mrst_max3110.c2
-rw-r--r--drivers/tty/serial/omap-serial.c3
-rw-r--r--drivers/tty/serial/pch_uart.c3
-rw-r--r--drivers/tty/serial/samsung.c8
-rw-r--r--drivers/tty/serial/serial_core.c5
-rw-r--r--drivers/tty/serial/ucc_uart.c2
-rw-r--r--drivers/tty/tty_io.c3
14 files changed, 52 insertions, 25 deletions
diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
index 98b6e3bdb000..e809e9d4683c 100644
--- a/drivers/tty/pty.c
+++ b/drivers/tty/pty.c
@@ -446,8 +446,19 @@ static inline void legacy_pty_init(void) { }
446int pty_limit = NR_UNIX98_PTY_DEFAULT; 446int pty_limit = NR_UNIX98_PTY_DEFAULT;
447static int pty_limit_min; 447static int pty_limit_min;
448static int pty_limit_max = NR_UNIX98_PTY_MAX; 448static int pty_limit_max = NR_UNIX98_PTY_MAX;
449static int tty_count;
449static int pty_count; 450static int pty_count;
450 451
452static inline void pty_inc_count(void)
453{
454 pty_count = (++tty_count) / 2;
455}
456
457static inline void pty_dec_count(void)
458{
459 pty_count = (--tty_count) / 2;
460}
461
451static struct cdev ptmx_cdev; 462static struct cdev ptmx_cdev;
452 463
453static struct ctl_table pty_table[] = { 464static struct ctl_table pty_table[] = {
@@ -542,6 +553,7 @@ static struct tty_struct *pts_unix98_lookup(struct tty_driver *driver,
542 553
543static void pty_unix98_shutdown(struct tty_struct *tty) 554static void pty_unix98_shutdown(struct tty_struct *tty)
544{ 555{
556 tty_driver_remove_tty(tty->driver, tty);
545 /* We have our own method as we don't use the tty index */ 557 /* We have our own method as we don't use the tty index */
546 kfree(tty->termios); 558 kfree(tty->termios);
547} 559}
@@ -588,7 +600,8 @@ static int pty_unix98_install(struct tty_driver *driver, struct tty_struct *tty)
588 */ 600 */
589 tty_driver_kref_get(driver); 601 tty_driver_kref_get(driver);
590 tty->count++; 602 tty->count++;
591 pty_count++; 603 pty_inc_count(); /* tty */
604 pty_inc_count(); /* tty->link */
592 return 0; 605 return 0;
593err_free_mem: 606err_free_mem:
594 deinitialize_tty_struct(o_tty); 607 deinitialize_tty_struct(o_tty);
@@ -602,7 +615,7 @@ err_free_tty:
602 615
603static void pty_unix98_remove(struct tty_driver *driver, struct tty_struct *tty) 616static void pty_unix98_remove(struct tty_driver *driver, struct tty_struct *tty)
604{ 617{
605 pty_count--; 618 pty_dec_count();
606} 619}
607 620
608static const struct tty_operations ptm_unix98_ops = { 621static const struct tty_operations ptm_unix98_ops = {
diff --git a/drivers/tty/serial/8250.c b/drivers/tty/serial/8250.c
index f2dfec82faf8..7f50999eebc2 100644
--- a/drivers/tty/serial/8250.c
+++ b/drivers/tty/serial/8250.c
@@ -1819,6 +1819,8 @@ static void serial8250_backup_timeout(unsigned long data)
1819 unsigned int iir, ier = 0, lsr; 1819 unsigned int iir, ier = 0, lsr;
1820 unsigned long flags; 1820 unsigned long flags;
1821 1821
1822 spin_lock_irqsave(&up->port.lock, flags);
1823
1822 /* 1824 /*
1823 * Must disable interrupts or else we risk racing with the interrupt 1825 * Must disable interrupts or else we risk racing with the interrupt
1824 * based handler. 1826 * based handler.
@@ -1836,10 +1838,8 @@ static void serial8250_backup_timeout(unsigned long data)
1836 * the "Diva" UART used on the management processor on many HP 1838 * the "Diva" UART used on the management processor on many HP
1837 * ia64 and parisc boxes. 1839 * ia64 and parisc boxes.
1838 */ 1840 */
1839 spin_lock_irqsave(&up->port.lock, flags);
1840 lsr = serial_in(up, UART_LSR); 1841 lsr = serial_in(up, UART_LSR);
1841 up->lsr_saved_flags |= lsr & LSR_SAVE_FLAGS; 1842 up->lsr_saved_flags |= lsr & LSR_SAVE_FLAGS;
1842 spin_unlock_irqrestore(&up->port.lock, flags);
1843 if ((iir & UART_IIR_NO_INT) && (up->ier & UART_IER_THRI) && 1843 if ((iir & UART_IIR_NO_INT) && (up->ier & UART_IER_THRI) &&
1844 (!uart_circ_empty(&up->port.state->xmit) || up->port.x_char) && 1844 (!uart_circ_empty(&up->port.state->xmit) || up->port.x_char) &&
1845 (lsr & UART_LSR_THRE)) { 1845 (lsr & UART_LSR_THRE)) {
@@ -1848,11 +1848,13 @@ static void serial8250_backup_timeout(unsigned long data)
1848 } 1848 }
1849 1849
1850 if (!(iir & UART_IIR_NO_INT)) 1850 if (!(iir & UART_IIR_NO_INT))
1851 serial8250_handle_port(up); 1851 transmit_chars(up);
1852 1852
1853 if (is_real_interrupt(up->port.irq)) 1853 if (is_real_interrupt(up->port.irq))
1854 serial_out(up, UART_IER, ier); 1854 serial_out(up, UART_IER, ier);
1855 1855
1856 spin_unlock_irqrestore(&up->port.lock, flags);
1857
1856 /* Standard timer interval plus 0.2s to keep the port running */ 1858 /* Standard timer interval plus 0.2s to keep the port running */
1857 mod_timer(&up->timer, 1859 mod_timer(&up->timer,
1858 jiffies + uart_poll_timeout(&up->port) + HZ / 5); 1860 jiffies + uart_poll_timeout(&up->port) + HZ / 5);
diff --git a/drivers/tty/serial/8250_pci.c b/drivers/tty/serial/8250_pci.c
index 6b887d90a205..3abeca2a2a1b 100644
--- a/drivers/tty/serial/8250_pci.c
+++ b/drivers/tty/serial/8250_pci.c
@@ -1599,11 +1599,6 @@ static struct pci_serial_quirk pci_serial_quirks[] __refdata = {
1599 .device = 0x800D, 1599 .device = 0x800D,
1600 .init = pci_eg20t_init, 1600 .init = pci_eg20t_init,
1601 }, 1601 },
1602 {
1603 .vendor = 0x10DB,
1604 .device = 0x800D,
1605 .init = pci_eg20t_init,
1606 },
1607 /* 1602 /*
1608 * Cronyx Omega PCI (PLX-chip based) 1603 * Cronyx Omega PCI (PLX-chip based)
1609 */ 1604 */
@@ -4021,7 +4016,7 @@ static struct pci_device_id serial_pci_tbl[] = {
4021 0, 0, pbn_NETMOS9900_2s_115200 }, 4016 0, 0, pbn_NETMOS9900_2s_115200 },
4022 4017
4023 /* 4018 /*
4024 * Best Connectivity PCI Multi I/O cards 4019 * Best Connectivity and Rosewill PCI Multi I/O cards
4025 */ 4020 */
4026 4021
4027 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9865, 4022 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9865,
@@ -4029,6 +4024,10 @@ static struct pci_device_id serial_pci_tbl[] = {
4029 0, 0, pbn_b0_1_115200 }, 4024 0, 0, pbn_b0_1_115200 },
4030 4025
4031 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9865, 4026 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9865,
4027 0xA000, 0x3002,
4028 0, 0, pbn_b0_bt_2_115200 },
4029
4030 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9865,
4032 0xA000, 0x3004, 4031 0xA000, 0x3004,
4033 0, 0, pbn_b0_bt_4_115200 }, 4032 0, 0, pbn_b0_bt_4_115200 },
4034 /* Intel CE4100 */ 4033 /* Intel CE4100 */
diff --git a/drivers/tty/serial/8250_pnp.c b/drivers/tty/serial/8250_pnp.c
index fc301f6722e1..a2f236510ff1 100644
--- a/drivers/tty/serial/8250_pnp.c
+++ b/drivers/tty/serial/8250_pnp.c
@@ -109,6 +109,9 @@ static const struct pnp_device_id pnp_dev_table[] = {
109 /* IBM */ 109 /* IBM */
110 /* IBM Thinkpad 701 Internal Modem Voice */ 110 /* IBM Thinkpad 701 Internal Modem Voice */
111 { "IBM0033", 0 }, 111 { "IBM0033", 0 },
112 /* Intermec */
113 /* Intermec CV60 touchscreen port */
114 { "PNP4972", 0 },
112 /* Intertex */ 115 /* Intertex */
113 /* Intertex 28k8 33k6 Voice EXT PnP */ 116 /* Intertex 28k8 33k6 Voice EXT PnP */
114 { "IXDC801", 0 }, 117 { "IXDC801", 0 },
diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index af9b7814965a..b922f5d2e61e 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -1609,9 +1609,11 @@ static struct console atmel_console = {
1609static int __init atmel_console_init(void) 1609static int __init atmel_console_init(void)
1610{ 1610{
1611 if (atmel_default_console_device) { 1611 if (atmel_default_console_device) {
1612 add_preferred_console(ATMEL_DEVICENAME, 1612 struct atmel_uart_data *pdata =
1613 atmel_default_console_device->id, NULL); 1613 atmel_default_console_device->dev.platform_data;
1614 atmel_init_port(&atmel_ports[atmel_default_console_device->id], 1614
1615 add_preferred_console(ATMEL_DEVICENAME, pdata->num, NULL);
1616 atmel_init_port(&atmel_ports[pdata->num],
1615 atmel_default_console_device); 1617 atmel_default_console_device);
1616 register_console(&atmel_console); 1618 register_console(&atmel_console);
1617 } 1619 }
diff --git a/drivers/tty/serial/max3107-aava.c b/drivers/tty/serial/max3107-aava.c
index a1fe304f2f52..d73aadd7a9ad 100644
--- a/drivers/tty/serial/max3107-aava.c
+++ b/drivers/tty/serial/max3107-aava.c
@@ -340,5 +340,5 @@ module_exit(max3107_exit);
340 340
341MODULE_DESCRIPTION("MAX3107 driver"); 341MODULE_DESCRIPTION("MAX3107 driver");
342MODULE_AUTHOR("Aavamobile"); 342MODULE_AUTHOR("Aavamobile");
343MODULE_ALIAS("aava-max3107-spi"); 343MODULE_ALIAS("spi:aava-max3107");
344MODULE_LICENSE("GPL v2"); 344MODULE_LICENSE("GPL v2");
diff --git a/drivers/tty/serial/max3107.c b/drivers/tty/serial/max3107.c
index 750b4f627315..a8164601c0ea 100644
--- a/drivers/tty/serial/max3107.c
+++ b/drivers/tty/serial/max3107.c
@@ -1209,5 +1209,5 @@ module_exit(max3107_exit);
1209 1209
1210MODULE_DESCRIPTION("MAX3107 driver"); 1210MODULE_DESCRIPTION("MAX3107 driver");
1211MODULE_AUTHOR("Aavamobile"); 1211MODULE_AUTHOR("Aavamobile");
1212MODULE_ALIAS("max3107-spi"); 1212MODULE_ALIAS("spi:max3107");
1213MODULE_LICENSE("GPL v2"); 1213MODULE_LICENSE("GPL v2");
diff --git a/drivers/tty/serial/mrst_max3110.c b/drivers/tty/serial/mrst_max3110.c
index a764bf99743b..23bc743f2a22 100644
--- a/drivers/tty/serial/mrst_max3110.c
+++ b/drivers/tty/serial/mrst_max3110.c
@@ -917,4 +917,4 @@ module_init(serial_m3110_init);
917module_exit(serial_m3110_exit); 917module_exit(serial_m3110_exit);
918 918
919MODULE_LICENSE("GPL v2"); 919MODULE_LICENSE("GPL v2");
920MODULE_ALIAS("max3110-uart"); 920MODULE_ALIAS("spi:max3110-uart");
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index c37df8d0fa28..5e713d3ef1f4 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -806,8 +806,7 @@ serial_omap_set_termios(struct uart_port *port, struct ktermios *termios,
806 806
807 serial_omap_set_mctrl(&up->port, up->port.mctrl); 807 serial_omap_set_mctrl(&up->port, up->port.mctrl);
808 /* Software Flow Control Configuration */ 808 /* Software Flow Control Configuration */
809 if (termios->c_iflag & (IXON | IXOFF)) 809 serial_omap_configure_xonxoff(up, termios);
810 serial_omap_configure_xonxoff(up, termios);
811 810
812 spin_unlock_irqrestore(&up->port.lock, flags); 811 spin_unlock_irqrestore(&up->port.lock, flags);
813 dev_dbg(up->port.dev, "serial_omap_set_termios+%d\n", up->pdev->id); 812 dev_dbg(up->port.dev, "serial_omap_set_termios+%d\n", up->pdev->id);
diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c
index 846dfcd3ce0d..b46218d679e2 100644
--- a/drivers/tty/serial/pch_uart.c
+++ b/drivers/tty/serial/pch_uart.c
@@ -598,7 +598,8 @@ static void pch_request_dma(struct uart_port *port)
598 dma_cap_zero(mask); 598 dma_cap_zero(mask);
599 dma_cap_set(DMA_SLAVE, mask); 599 dma_cap_set(DMA_SLAVE, mask);
600 600
601 dma_dev = pci_get_bus_and_slot(2, PCI_DEVFN(0xa, 0)); /* Get DMA's dev 601 dma_dev = pci_get_bus_and_slot(priv->pdev->bus->number,
602 PCI_DEVFN(0xa, 0)); /* Get DMA's dev
602 information */ 603 information */
603 /* Set Tx DMA */ 604 /* Set Tx DMA */
604 param = &priv->param_tx; 605 param = &priv->param_tx;
diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
index afc629423152..6edafb5ace18 100644
--- a/drivers/tty/serial/samsung.c
+++ b/drivers/tty/serial/samsung.c
@@ -1225,15 +1225,19 @@ static const struct dev_pm_ops s3c24xx_serial_pm_ops = {
1225 .suspend = s3c24xx_serial_suspend, 1225 .suspend = s3c24xx_serial_suspend,
1226 .resume = s3c24xx_serial_resume, 1226 .resume = s3c24xx_serial_resume,
1227}; 1227};
1228#define SERIAL_SAMSUNG_PM_OPS (&s3c24xx_serial_pm_ops)
1229
1228#else /* !CONFIG_PM_SLEEP */ 1230#else /* !CONFIG_PM_SLEEP */
1229#define s3c24xx_serial_pm_ops NULL 1231
1232#define SERIAL_SAMSUNG_PM_OPS NULL
1230#endif /* CONFIG_PM_SLEEP */ 1233#endif /* CONFIG_PM_SLEEP */
1231 1234
1232int s3c24xx_serial_init(struct platform_driver *drv, 1235int s3c24xx_serial_init(struct platform_driver *drv,
1233 struct s3c24xx_uart_info *info) 1236 struct s3c24xx_uart_info *info)
1234{ 1237{
1235 dbg("s3c24xx_serial_init(%p,%p)\n", drv, info); 1238 dbg("s3c24xx_serial_init(%p,%p)\n", drv, info);
1236 drv->driver.pm = &s3c24xx_serial_pm_ops; 1239
1240 drv->driver.pm = SERIAL_SAMSUNG_PM_OPS;
1237 1241
1238 return platform_driver_register(drv); 1242 return platform_driver_register(drv);
1239} 1243}
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index db7912cb7ae0..a3efbea5dbba 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -200,6 +200,11 @@ static int uart_startup(struct tty_struct *tty, struct uart_state *state, int in
200 clear_bit(TTY_IO_ERROR, &tty->flags); 200 clear_bit(TTY_IO_ERROR, &tty->flags);
201 } 201 }
202 202
203 /*
204 * This is to allow setserial on this port. People may want to set
205 * port/irq/type and then reconfigure the port properly if it failed
206 * now.
207 */
203 if (retval && capable(CAP_SYS_ADMIN)) 208 if (retval && capable(CAP_SYS_ADMIN))
204 retval = 0; 209 retval = 0;
205 210
diff --git a/drivers/tty/serial/ucc_uart.c b/drivers/tty/serial/ucc_uart.c
index c327218cad44..9af9f0879a24 100644
--- a/drivers/tty/serial/ucc_uart.c
+++ b/drivers/tty/serial/ucc_uart.c
@@ -235,7 +235,7 @@ static inline void *qe2cpu_addr(dma_addr_t addr, struct uart_qe_port *qe_port)
235 return qe_port->bd_virt + (addr - qe_port->bd_dma_addr); 235 return qe_port->bd_virt + (addr - qe_port->bd_dma_addr);
236 236
237 /* something nasty happened */ 237 /* something nasty happened */
238 printk(KERN_ERR "%s: addr=%x\n", __func__, addr); 238 printk(KERN_ERR "%s: addr=%llx\n", __func__, (u64)addr);
239 BUG(); 239 BUG();
240 return NULL; 240 return NULL;
241} 241}
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 150e4f747c7d..4f1fc81112e6 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -1295,8 +1295,7 @@ static int tty_driver_install_tty(struct tty_driver *driver,
1295 * 1295 *
1296 * Locking: tty_mutex for now 1296 * Locking: tty_mutex for now
1297 */ 1297 */
1298static void tty_driver_remove_tty(struct tty_driver *driver, 1298void tty_driver_remove_tty(struct tty_driver *driver, struct tty_struct *tty)
1299 struct tty_struct *tty)
1300{ 1299{
1301 if (driver->ops->remove) 1300 if (driver->ops->remove)
1302 driver->ops->remove(driver, tty); 1301 driver->ops->remove(driver, tty);