diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2011-09-26 14:12:45 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2011-09-26 14:12:45 -0400 |
commit | 0d41da2e31e81f5c8aaabe17f769de4304b2d4c8 (patch) | |
tree | 540acefba9bf01d3880d7bacb767fbf9b1fe80b4 /drivers/tty | |
parent | a0089bd617adea27ebc352e1e0871649ab1dbaa6 (diff) | |
parent | e8b364b88cc4001b21c28c1ecf1e1e3ffbe162e6 (diff) |
Merge branch 'pm-fixes' into pm-domains
Merge commit e8b364b88cc4001b21c28c1ecf1e1e3ffbe162e6
(PM / Clocks: Do not acquire a mutex under a spinlock) fixing
a regression in drivers/base/power/clock_ops.c.
Conflicts:
drivers/base/power/clock_ops.c
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/pty.c | 17 | ||||
-rw-r--r-- | drivers/tty/serial/8250.c | 8 | ||||
-rw-r--r-- | drivers/tty/serial/8250_pci.c | 11 | ||||
-rw-r--r-- | drivers/tty/serial/8250_pnp.c | 3 | ||||
-rw-r--r-- | drivers/tty/serial/atmel_serial.c | 8 | ||||
-rw-r--r-- | drivers/tty/serial/crisv10.c | 4 | ||||
-rw-r--r-- | drivers/tty/serial/max3107-aava.c | 2 | ||||
-rw-r--r-- | drivers/tty/serial/max3107.c | 2 | ||||
-rw-r--r-- | drivers/tty/serial/mrst_max3110.c | 2 | ||||
-rw-r--r-- | drivers/tty/serial/omap-serial.c | 3 | ||||
-rw-r--r-- | drivers/tty/serial/pch_uart.c | 3 | ||||
-rw-r--r-- | drivers/tty/serial/samsung.c | 8 | ||||
-rw-r--r-- | drivers/tty/serial/serial_core.c | 5 | ||||
-rw-r--r-- | drivers/tty/serial/sh-sci.c | 71 | ||||
-rw-r--r-- | drivers/tty/serial/ucc_uart.c | 2 | ||||
-rw-r--r-- | drivers/tty/tty_io.c | 3 |
16 files changed, 114 insertions, 38 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) { } | |||
446 | int pty_limit = NR_UNIX98_PTY_DEFAULT; | 446 | int pty_limit = NR_UNIX98_PTY_DEFAULT; |
447 | static int pty_limit_min; | 447 | static int pty_limit_min; |
448 | static int pty_limit_max = NR_UNIX98_PTY_MAX; | 448 | static int pty_limit_max = NR_UNIX98_PTY_MAX; |
449 | static int tty_count; | ||
449 | static int pty_count; | 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 | static struct cdev ptmx_cdev; | 462 | static struct cdev ptmx_cdev; |
452 | 463 | ||
453 | static struct ctl_table pty_table[] = { | 464 | static struct ctl_table pty_table[] = { |
@@ -542,6 +553,7 @@ static struct tty_struct *pts_unix98_lookup(struct tty_driver *driver, | |||
542 | 553 | ||
543 | static void pty_unix98_shutdown(struct tty_struct *tty) | 554 | static 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; |
593 | err_free_mem: | 606 | err_free_mem: |
594 | deinitialize_tty_struct(o_tty); | 607 | deinitialize_tty_struct(o_tty); |
@@ -602,7 +615,7 @@ err_free_tty: | |||
602 | 615 | ||
603 | static void pty_unix98_remove(struct tty_driver *driver, struct tty_struct *tty) | 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 | static const struct tty_operations ptm_unix98_ops = { | 621 | static 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 = { | |||
1609 | static int __init atmel_console_init(void) | 1609 | static 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/crisv10.c b/drivers/tty/serial/crisv10.c index 225123b37f19..58be715913cd 100644 --- a/drivers/tty/serial/crisv10.c +++ b/drivers/tty/serial/crisv10.c | |||
@@ -4450,7 +4450,7 @@ static int __init rs_init(void) | |||
4450 | 4450 | ||
4451 | #if defined(CONFIG_ETRAX_RS485) | 4451 | #if defined(CONFIG_ETRAX_RS485) |
4452 | #if defined(CONFIG_ETRAX_RS485_ON_PA) | 4452 | #if defined(CONFIG_ETRAX_RS485_ON_PA) |
4453 | if (cris_io_interface_allocate_pins(if_ser0, 'a', rs485_pa_bit, | 4453 | if (cris_io_interface_allocate_pins(if_serial_0, 'a', rs485_pa_bit, |
4454 | rs485_pa_bit)) { | 4454 | rs485_pa_bit)) { |
4455 | printk(KERN_CRIT "ETRAX100LX serial: Could not allocate " | 4455 | printk(KERN_CRIT "ETRAX100LX serial: Could not allocate " |
4456 | "RS485 pin\n"); | 4456 | "RS485 pin\n"); |
@@ -4459,7 +4459,7 @@ static int __init rs_init(void) | |||
4459 | } | 4459 | } |
4460 | #endif | 4460 | #endif |
4461 | #if defined(CONFIG_ETRAX_RS485_ON_PORT_G) | 4461 | #if defined(CONFIG_ETRAX_RS485_ON_PORT_G) |
4462 | if (cris_io_interface_allocate_pins(if_ser0, 'g', rs485_pa_bit, | 4462 | if (cris_io_interface_allocate_pins(if_serial_0, 'g', rs485_pa_bit, |
4463 | rs485_port_g_bit)) { | 4463 | rs485_port_g_bit)) { |
4464 | printk(KERN_CRIT "ETRAX100LX serial: Could not allocate " | 4464 | printk(KERN_CRIT "ETRAX100LX serial: Could not allocate " |
4465 | "RS485 pin\n"); | 4465 | "RS485 pin\n"); |
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 | ||
341 | MODULE_DESCRIPTION("MAX3107 driver"); | 341 | MODULE_DESCRIPTION("MAX3107 driver"); |
342 | MODULE_AUTHOR("Aavamobile"); | 342 | MODULE_AUTHOR("Aavamobile"); |
343 | MODULE_ALIAS("aava-max3107-spi"); | 343 | MODULE_ALIAS("spi:aava-max3107"); |
344 | MODULE_LICENSE("GPL v2"); | 344 | MODULE_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 | ||
1210 | MODULE_DESCRIPTION("MAX3107 driver"); | 1210 | MODULE_DESCRIPTION("MAX3107 driver"); |
1211 | MODULE_AUTHOR("Aavamobile"); | 1211 | MODULE_AUTHOR("Aavamobile"); |
1212 | MODULE_ALIAS("max3107-spi"); | 1212 | MODULE_ALIAS("spi:max3107"); |
1213 | MODULE_LICENSE("GPL v2"); | 1213 | MODULE_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); | |||
917 | module_exit(serial_m3110_exit); | 917 | module_exit(serial_m3110_exit); |
918 | 918 | ||
919 | MODULE_LICENSE("GPL v2"); | 919 | MODULE_LICENSE("GPL v2"); |
920 | MODULE_ALIAS("max3110-uart"); | 920 | MODULE_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 | ||
1232 | int s3c24xx_serial_init(struct platform_driver *drv, | 1235 | int 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/sh-sci.c b/drivers/tty/serial/sh-sci.c index a9414facda47..5ea6ec3442e6 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c | |||
@@ -47,6 +47,7 @@ | |||
47 | #include <linux/ctype.h> | 47 | #include <linux/ctype.h> |
48 | #include <linux/err.h> | 48 | #include <linux/err.h> |
49 | #include <linux/dmaengine.h> | 49 | #include <linux/dmaengine.h> |
50 | #include <linux/dma-mapping.h> | ||
50 | #include <linux/scatterlist.h> | 51 | #include <linux/scatterlist.h> |
51 | #include <linux/slab.h> | 52 | #include <linux/slab.h> |
52 | 53 | ||
@@ -95,6 +96,12 @@ struct sci_port { | |||
95 | #endif | 96 | #endif |
96 | 97 | ||
97 | struct notifier_block freq_transition; | 98 | struct notifier_block freq_transition; |
99 | |||
100 | #ifdef CONFIG_SERIAL_SH_SCI_CONSOLE | ||
101 | unsigned short saved_smr; | ||
102 | unsigned short saved_fcr; | ||
103 | unsigned char saved_brr; | ||
104 | #endif | ||
98 | }; | 105 | }; |
99 | 106 | ||
100 | /* Function prototypes */ | 107 | /* Function prototypes */ |
@@ -1076,7 +1083,7 @@ static unsigned int sci_get_mctrl(struct uart_port *port) | |||
1076 | /* This routine is used for getting signals of: DTR, DCD, DSR, RI, | 1083 | /* This routine is used for getting signals of: DTR, DCD, DSR, RI, |
1077 | and CTS/RTS */ | 1084 | and CTS/RTS */ |
1078 | 1085 | ||
1079 | return TIOCM_DTR | TIOCM_RTS | TIOCM_DSR; | 1086 | return TIOCM_DTR | TIOCM_RTS | TIOCM_CTS | TIOCM_DSR; |
1080 | } | 1087 | } |
1081 | 1088 | ||
1082 | #ifdef CONFIG_SERIAL_SH_SCI_DMA | 1089 | #ifdef CONFIG_SERIAL_SH_SCI_DMA |
@@ -1633,11 +1640,25 @@ static unsigned int sci_scbrr_calc(unsigned int algo_id, unsigned int bps, | |||
1633 | return ((freq + 16 * bps) / (32 * bps) - 1); | 1640 | return ((freq + 16 * bps) / (32 * bps) - 1); |
1634 | } | 1641 | } |
1635 | 1642 | ||
1643 | static void sci_reset(struct uart_port *port) | ||
1644 | { | ||
1645 | unsigned int status; | ||
1646 | |||
1647 | do { | ||
1648 | status = sci_in(port, SCxSR); | ||
1649 | } while (!(status & SCxSR_TEND(port))); | ||
1650 | |||
1651 | sci_out(port, SCSCR, 0x00); /* TE=0, RE=0, CKE1=0 */ | ||
1652 | |||
1653 | if (port->type != PORT_SCI) | ||
1654 | sci_out(port, SCFCR, SCFCR_RFRST | SCFCR_TFRST); | ||
1655 | } | ||
1656 | |||
1636 | static void sci_set_termios(struct uart_port *port, struct ktermios *termios, | 1657 | static void sci_set_termios(struct uart_port *port, struct ktermios *termios, |
1637 | struct ktermios *old) | 1658 | struct ktermios *old) |
1638 | { | 1659 | { |
1639 | struct sci_port *s = to_sci_port(port); | 1660 | struct sci_port *s = to_sci_port(port); |
1640 | unsigned int status, baud, smr_val, max_baud; | 1661 | unsigned int baud, smr_val, max_baud; |
1641 | int t = -1; | 1662 | int t = -1; |
1642 | u16 scfcr = 0; | 1663 | u16 scfcr = 0; |
1643 | 1664 | ||
@@ -1657,14 +1678,7 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios, | |||
1657 | 1678 | ||
1658 | sci_port_enable(s); | 1679 | sci_port_enable(s); |
1659 | 1680 | ||
1660 | do { | 1681 | sci_reset(port); |
1661 | status = sci_in(port, SCxSR); | ||
1662 | } while (!(status & SCxSR_TEND(port))); | ||
1663 | |||
1664 | sci_out(port, SCSCR, 0x00); /* TE=0, RE=0, CKE1=0 */ | ||
1665 | |||
1666 | if (port->type != PORT_SCI) | ||
1667 | sci_out(port, SCFCR, scfcr | SCFCR_RFRST | SCFCR_TFRST); | ||
1668 | 1682 | ||
1669 | smr_val = sci_in(port, SCSMR) & 3; | 1683 | smr_val = sci_in(port, SCSMR) & 3; |
1670 | 1684 | ||
@@ -2037,7 +2051,8 @@ static int __devinit serial_console_setup(struct console *co, char *options) | |||
2037 | if (options) | 2051 | if (options) |
2038 | uart_parse_options(options, &baud, &parity, &bits, &flow); | 2052 | uart_parse_options(options, &baud, &parity, &bits, &flow); |
2039 | 2053 | ||
2040 | /* TODO: disable clock */ | 2054 | sci_port_disable(sci_port); |
2055 | |||
2041 | return uart_set_options(port, co, baud, parity, bits, flow); | 2056 | return uart_set_options(port, co, baud, parity, bits, flow); |
2042 | } | 2057 | } |
2043 | 2058 | ||
@@ -2080,6 +2095,36 @@ static int __devinit sci_probe_earlyprintk(struct platform_device *pdev) | |||
2080 | return 0; | 2095 | return 0; |
2081 | } | 2096 | } |
2082 | 2097 | ||
2098 | #define uart_console(port) ((port)->cons->index == (port)->line) | ||
2099 | |||
2100 | static int sci_runtime_suspend(struct device *dev) | ||
2101 | { | ||
2102 | struct sci_port *sci_port = dev_get_drvdata(dev); | ||
2103 | struct uart_port *port = &sci_port->port; | ||
2104 | |||
2105 | if (uart_console(port)) { | ||
2106 | sci_port->saved_smr = sci_in(port, SCSMR); | ||
2107 | sci_port->saved_brr = sci_in(port, SCBRR); | ||
2108 | sci_port->saved_fcr = sci_in(port, SCFCR); | ||
2109 | } | ||
2110 | return 0; | ||
2111 | } | ||
2112 | |||
2113 | static int sci_runtime_resume(struct device *dev) | ||
2114 | { | ||
2115 | struct sci_port *sci_port = dev_get_drvdata(dev); | ||
2116 | struct uart_port *port = &sci_port->port; | ||
2117 | |||
2118 | if (uart_console(port)) { | ||
2119 | sci_reset(port); | ||
2120 | sci_out(port, SCSMR, sci_port->saved_smr); | ||
2121 | sci_out(port, SCBRR, sci_port->saved_brr); | ||
2122 | sci_out(port, SCFCR, sci_port->saved_fcr); | ||
2123 | sci_out(port, SCSCR, sci_port->cfg->scscr); | ||
2124 | } | ||
2125 | return 0; | ||
2126 | } | ||
2127 | |||
2083 | #define SCI_CONSOLE (&serial_console) | 2128 | #define SCI_CONSOLE (&serial_console) |
2084 | 2129 | ||
2085 | #else | 2130 | #else |
@@ -2089,6 +2134,8 @@ static inline int __devinit sci_probe_earlyprintk(struct platform_device *pdev) | |||
2089 | } | 2134 | } |
2090 | 2135 | ||
2091 | #define SCI_CONSOLE NULL | 2136 | #define SCI_CONSOLE NULL |
2137 | #define sci_runtime_suspend NULL | ||
2138 | #define sci_runtime_resume NULL | ||
2092 | 2139 | ||
2093 | #endif /* CONFIG_SERIAL_SH_SCI_CONSOLE */ | 2140 | #endif /* CONFIG_SERIAL_SH_SCI_CONSOLE */ |
2094 | 2141 | ||
@@ -2204,6 +2251,8 @@ static int sci_resume(struct device *dev) | |||
2204 | } | 2251 | } |
2205 | 2252 | ||
2206 | static const struct dev_pm_ops sci_dev_pm_ops = { | 2253 | static const struct dev_pm_ops sci_dev_pm_ops = { |
2254 | .runtime_suspend = sci_runtime_suspend, | ||
2255 | .runtime_resume = sci_runtime_resume, | ||
2207 | .suspend = sci_suspend, | 2256 | .suspend = sci_suspend, |
2208 | .resume = sci_resume, | 2257 | .resume = sci_resume, |
2209 | }; | 2258 | }; |
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 | */ |
1298 | static void tty_driver_remove_tty(struct tty_driver *driver, | 1298 | void 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); |