Commit efe45ab1ee04551936f8343bd4ca1ff02ffc23bb

Authored by Linus Torvalds

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

Showing 16 changed files Side-by-side Diff

... ... @@ -446,8 +446,19 @@
446 446 int pty_limit = NR_UNIX98_PTY_DEFAULT;
447 447 static int pty_limit_min;
448 448 static int pty_limit_max = NR_UNIX98_PTY_MAX;
  449 +static int tty_count;
449 450 static int pty_count;
450 451  
  452 +static inline void pty_inc_count(void)
  453 +{
  454 + pty_count = (++tty_count) / 2;
  455 +}
  456 +
  457 +static inline void pty_dec_count(void)
  458 +{
  459 + pty_count = (--tty_count) / 2;
  460 +}
  461 +
451 462 static struct cdev ptmx_cdev;
452 463  
453 464 static struct ctl_table pty_table[] = {
... ... @@ -542,6 +553,7 @@
542 553  
543 554 static void pty_unix98_shutdown(struct tty_struct *tty)
544 555 {
  556 + tty_driver_remove_tty(tty->driver, tty);
545 557 /* We have our own method as we don't use the tty index */
546 558 kfree(tty->termios);
547 559 }
... ... @@ -588,7 +600,8 @@
588 600 */
589 601 tty_driver_kref_get(driver);
590 602 tty->count++;
591   - pty_count++;
  603 + pty_inc_count(); /* tty */
  604 + pty_inc_count(); /* tty->link */
592 605 return 0;
593 606 err_free_mem:
594 607 deinitialize_tty_struct(o_tty);
... ... @@ -602,7 +615,7 @@
602 615  
603 616 static 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  
608 621 static const struct tty_operations ptm_unix98_ops = {
drivers/tty/serial/8250.c
... ... @@ -1819,6 +1819,8 @@
1819 1819 unsigned int iir, ier = 0, lsr;
1820 1820 unsigned long flags;
1821 1821  
  1822 + spin_lock_irqsave(&up->port.lock, flags);
  1823 +
1822 1824 /*
1823 1825 * Must disable interrupts or else we risk racing with the interrupt
1824 1826 * based handler.
1825 1827  
... ... @@ -1836,10 +1838,8 @@
1836 1838 * the "Diva" UART used on the management processor on many HP
1837 1839 * ia64 and parisc boxes.
1838 1840 */
1839   - spin_lock_irqsave(&up->port.lock, flags);
1840 1841 lsr = serial_in(up, UART_LSR);
1841 1842 up->lsr_saved_flags |= lsr & LSR_SAVE_FLAGS;
1842   - spin_unlock_irqrestore(&up->port.lock, flags);
1843 1843 if ((iir & UART_IIR_NO_INT) && (up->ier & UART_IER_THRI) &&
1844 1844 (!uart_circ_empty(&up->port.state->xmit) || up->port.x_char) &&
1845 1845 (lsr & UART_LSR_THRE)) {
1846 1846  
... ... @@ -1848,10 +1848,12 @@
1848 1848 }
1849 1849  
1850 1850 if (!(iir & UART_IIR_NO_INT))
1851   - serial8250_handle_port(up);
  1851 + transmit_chars(up);
1852 1852  
1853 1853 if (is_real_interrupt(up->port.irq))
1854 1854 serial_out(up, UART_IER, ier);
  1855 +
  1856 + spin_unlock_irqrestore(&up->port.lock, flags);
1855 1857  
1856 1858 /* Standard timer interval plus 0.2s to keep the port running */
1857 1859 mod_timer(&up->timer,
drivers/tty/serial/8250_pci.c
... ... @@ -1599,11 +1599,6 @@
1599 1599 .device = 0x800D,
1600 1600 .init = pci_eg20t_init,
1601 1601 },
1602   - {
1603   - .vendor = 0x10DB,
1604   - .device = 0x800D,
1605   - .init = pci_eg20t_init,
1606   - },
1607 1602 /*
1608 1603 * Cronyx Omega PCI (PLX-chip based)
1609 1604 */
1610 1605  
... ... @@ -4021,12 +4016,16 @@
4021 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 4022 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9865,
4028 4023 0xA000, 0x1000,
4029 4024 0, 0, pbn_b0_1_115200 },
  4025 +
  4026 + { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9865,
  4027 + 0xA000, 0x3002,
  4028 + 0, 0, pbn_b0_bt_2_115200 },
4030 4029  
4031 4030 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9865,
4032 4031 0xA000, 0x3004,
drivers/tty/serial/8250_pnp.c
... ... @@ -109,6 +109,9 @@
109 109 /* IBM */
110 110 /* IBM Thinkpad 701 Internal Modem Voice */
111 111 { "IBM0033", 0 },
  112 + /* Intermec */
  113 + /* Intermec CV60 touchscreen port */
  114 + { "PNP4972", 0 },
112 115 /* Intertex */
113 116 /* Intertex 28k8 33k6 Voice EXT PnP */
114 117 { "IXDC801", 0 },
drivers/tty/serial/atmel_serial.c
... ... @@ -1609,9 +1609,11 @@
1609 1609 static int __init atmel_console_init(void)
1610 1610 {
1611 1611 if (atmel_default_console_device) {
1612   - add_preferred_console(ATMEL_DEVICENAME,
1613   - atmel_default_console_device->id, NULL);
1614   - atmel_init_port(&atmel_ports[atmel_default_console_device->id],
  1612 + struct atmel_uart_data *pdata =
  1613 + atmel_default_console_device->dev.platform_data;
  1614 +
  1615 + add_preferred_console(ATMEL_DEVICENAME, pdata->num, NULL);
  1616 + atmel_init_port(&atmel_ports[pdata->num],
1615 1617 atmel_default_console_device);
1616 1618 register_console(&atmel_console);
1617 1619 }
drivers/tty/serial/max3107-aava.c
... ... @@ -340,6 +340,6 @@
340 340  
341 341 MODULE_DESCRIPTION("MAX3107 driver");
342 342 MODULE_AUTHOR("Aavamobile");
343   -MODULE_ALIAS("aava-max3107-spi");
  343 +MODULE_ALIAS("spi:aava-max3107");
344 344 MODULE_LICENSE("GPL v2");
drivers/tty/serial/max3107.c
... ... @@ -1209,6 +1209,6 @@
1209 1209  
1210 1210 MODULE_DESCRIPTION("MAX3107 driver");
1211 1211 MODULE_AUTHOR("Aavamobile");
1212   -MODULE_ALIAS("max3107-spi");
  1212 +MODULE_ALIAS("spi:max3107");
1213 1213 MODULE_LICENSE("GPL v2");
drivers/tty/serial/mrst_max3110.c
... ... @@ -917,5 +917,5 @@
917 917 module_exit(serial_m3110_exit);
918 918  
919 919 MODULE_LICENSE("GPL v2");
920   -MODULE_ALIAS("max3110-uart");
  920 +MODULE_ALIAS("spi:max3110-uart");
drivers/tty/serial/omap-serial.c
... ... @@ -806,8 +806,7 @@
806 806  
807 807 serial_omap_set_mctrl(&up->port, up->port.mctrl);
808 808 /* Software Flow Control Configuration */
809   - if (termios->c_iflag & (IXON | IXOFF))
810   - serial_omap_configure_xonxoff(up, termios);
  809 + serial_omap_configure_xonxoff(up, termios);
811 810  
812 811 spin_unlock_irqrestore(&up->port.lock, flags);
813 812 dev_dbg(up->port.dev, "serial_omap_set_termios+%d\n", up->pdev->id);
drivers/tty/serial/pch_uart.c
... ... @@ -598,7 +598,8 @@
598 598 dma_cap_zero(mask);
599 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 603 information */
603 604 /* Set Tx DMA */
604 605 param = &priv->param_tx;
drivers/tty/serial/samsung.c
... ... @@ -1225,15 +1225,19 @@
1225 1225 .suspend = s3c24xx_serial_suspend,
1226 1226 .resume = s3c24xx_serial_resume,
1227 1227 };
  1228 +#define SERIAL_SAMSUNG_PM_OPS (&s3c24xx_serial_pm_ops)
  1229 +
1228 1230 #else /* !CONFIG_PM_SLEEP */
1229   -#define s3c24xx_serial_pm_ops NULL
  1231 +
  1232 +#define SERIAL_SAMSUNG_PM_OPS NULL
1230 1233 #endif /* CONFIG_PM_SLEEP */
1231 1234  
1232 1235 int s3c24xx_serial_init(struct platform_driver *drv,
1233 1236 struct s3c24xx_uart_info *info)
1234 1237 {
1235 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 1242 return platform_driver_register(drv);
1239 1243 }
drivers/tty/serial/serial_core.c
... ... @@ -200,6 +200,11 @@
200 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 208 if (retval && capable(CAP_SYS_ADMIN))
204 209 retval = 0;
205 210  
drivers/tty/serial/ucc_uart.c
... ... @@ -235,7 +235,7 @@
235 235 return qe_port->bd_virt + (addr - qe_port->bd_dma_addr);
236 236  
237 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 239 BUG();
240 240 return NULL;
241 241 }
drivers/tty/tty_io.c
... ... @@ -1295,8 +1295,7 @@
1295 1295 *
1296 1296 * Locking: tty_mutex for now
1297 1297 */
1298   -static void tty_driver_remove_tty(struct tty_driver *driver,
1299   - struct tty_struct *tty)
  1298 +void tty_driver_remove_tty(struct tty_driver *driver, struct tty_struct *tty)
1300 1299 {
1301 1300 if (driver->ops->remove)
1302 1301 driver->ops->remove(driver, tty);
... ... @@ -421,6 +421,8 @@
421 421 extern void tty_throttle(struct tty_struct *tty);
422 422 extern void tty_unthrottle(struct tty_struct *tty);
423 423 extern int tty_do_resize(struct tty_struct *tty, struct winsize *ws);
  424 +extern void tty_driver_remove_tty(struct tty_driver *driver,
  425 + struct tty_struct *tty);
424 426 extern void tty_shutdown(struct tty_struct *tty);
425 427 extern void tty_free_termios(struct tty_struct *tty);
426 428 extern int is_current_pgrp_orphaned(void);
include/linux/tty_driver.h
... ... @@ -47,6 +47,9 @@
47 47 *
48 48 * This routine is called synchronously when a particular tty device
49 49 * is closed for the last time freeing up the resources.
  50 + * Note that tty_shutdown() is not called if ops->shutdown is defined.
  51 + * This means one is responsible to take care of calling ops->remove (e.g.
  52 + * via tty_driver_remove_tty) and releasing tty->termios.
50 53 *
51 54 *
52 55 * void (*cleanup)(struct tty_struct * tty);