aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/8250/8250.c12
-rw-r--r--drivers/tty/serial/8250/8250_pci.c16
-rw-r--r--drivers/tty/serial/Kconfig2
-rw-r--r--drivers/tty/serial/altera_uart.c4
-rw-r--r--drivers/tty/serial/amba-pl011.c8
-rw-r--r--drivers/tty/serial/atmel_serial.c4
-rw-r--r--drivers/tty/serial/omap-serial.c43
-rw-r--r--drivers/tty/serial/pch_uart.c8
-rw-r--r--drivers/tty/serial/samsung.c1
-rw-r--r--drivers/tty/vt/vt.c3
10 files changed, 48 insertions, 53 deletions
diff --git a/drivers/tty/serial/8250/8250.c b/drivers/tty/serial/8250/8250.c
index dffd623b7974..cbd94c3b5702 100644
--- a/drivers/tty/serial/8250/8250.c
+++ b/drivers/tty/serial/8250/8250.c
@@ -1541,13 +1541,11 @@ static irqreturn_t serial8250_interrupt(int irq, void *dev_id)
1541 do { 1541 do {
1542 struct uart_8250_port *up; 1542 struct uart_8250_port *up;
1543 struct uart_port *port; 1543 struct uart_port *port;
1544 bool skip;
1545 1544
1546 up = list_entry(l, struct uart_8250_port, list); 1545 up = list_entry(l, struct uart_8250_port, list);
1547 port = &up->port; 1546 port = &up->port;
1548 skip = pass_counter && up->port.flags & UPF_IIR_ONCE;
1549 1547
1550 if (!skip && port->handle_irq(port)) { 1548 if (port->handle_irq(port)) {
1551 handled = 1; 1549 handled = 1;
1552 end = NULL; 1550 end = NULL;
1553 } else if (end == NULL) 1551 } else if (end == NULL)
@@ -2006,10 +2004,12 @@ static int serial8250_startup(struct uart_port *port)
2006 spin_unlock_irqrestore(&port->lock, flags); 2004 spin_unlock_irqrestore(&port->lock, flags);
2007 2005
2008 /* 2006 /*
2009 * If the interrupt is not reasserted, setup a timer to 2007 * If the interrupt is not reasserted, or we otherwise
2010 * kick the UART on a regular basis. 2008 * don't trust the iir, setup a timer to kick the UART
2009 * on a regular basis.
2011 */ 2010 */
2012 if (!(iir1 & UART_IIR_NO_INT) && (iir & UART_IIR_NO_INT)) { 2011 if ((!(iir1 & UART_IIR_NO_INT) && (iir & UART_IIR_NO_INT)) ||
2012 up->port.flags & UPF_BUG_THRE) {
2013 up->bugs |= UART_BUG_THRE; 2013 up->bugs |= UART_BUG_THRE;
2014 pr_debug("ttyS%d - using backup timer\n", 2014 pr_debug("ttyS%d - using backup timer\n",
2015 serial_index(port)); 2015 serial_index(port));
diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c
index da2b0b0a183f..858dca865d6a 100644
--- a/drivers/tty/serial/8250/8250_pci.c
+++ b/drivers/tty/serial/8250/8250_pci.c
@@ -1096,7 +1096,7 @@ static int kt_serial_setup(struct serial_private *priv,
1096 const struct pciserial_board *board, 1096 const struct pciserial_board *board,
1097 struct uart_port *port, int idx) 1097 struct uart_port *port, int idx)
1098{ 1098{
1099 port->flags |= UPF_IIR_ONCE; 1099 port->flags |= UPF_BUG_THRE;
1100 return skip_tx_en_setup(priv, board, port, idx); 1100 return skip_tx_en_setup(priv, board, port, idx);
1101} 1101}
1102 1102
@@ -1118,18 +1118,6 @@ pci_xr17c154_setup(struct serial_private *priv,
1118 return pci_default_setup(priv, board, port, idx); 1118 return pci_default_setup(priv, board, port, idx);
1119} 1119}
1120 1120
1121static int try_enable_msi(struct pci_dev *dev)
1122{
1123 /* use msi if available, but fallback to legacy otherwise */
1124 pci_enable_msi(dev);
1125 return 0;
1126}
1127
1128static void disable_msi(struct pci_dev *dev)
1129{
1130 pci_disable_msi(dev);
1131}
1132
1133#define PCI_VENDOR_ID_SBSMODULARIO 0x124B 1121#define PCI_VENDOR_ID_SBSMODULARIO 0x124B
1134#define PCI_SUBVENDOR_ID_SBSMODULARIO 0x124B 1122#define PCI_SUBVENDOR_ID_SBSMODULARIO 0x124B
1135#define PCI_DEVICE_ID_OCTPRO 0x0001 1123#define PCI_DEVICE_ID_OCTPRO 0x0001
@@ -1249,9 +1237,7 @@ static struct pci_serial_quirk pci_serial_quirks[] __refdata = {
1249 .device = PCI_DEVICE_ID_INTEL_PATSBURG_KT, 1237 .device = PCI_DEVICE_ID_INTEL_PATSBURG_KT,
1250 .subvendor = PCI_ANY_ID, 1238 .subvendor = PCI_ANY_ID,
1251 .subdevice = PCI_ANY_ID, 1239 .subdevice = PCI_ANY_ID,
1252 .init = try_enable_msi,
1253 .setup = kt_serial_setup, 1240 .setup = kt_serial_setup,
1254 .exit = disable_msi,
1255 }, 1241 },
1256 /* 1242 /*
1257 * ITE 1243 * ITE
diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 665beb68f670..070b442c1f81 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -1041,7 +1041,7 @@ config SERIAL_OMAP
1041 1041
1042config SERIAL_OMAP_CONSOLE 1042config SERIAL_OMAP_CONSOLE
1043 bool "Console on OMAP serial port" 1043 bool "Console on OMAP serial port"
1044 depends on SERIAL_OMAP 1044 depends on SERIAL_OMAP=y
1045 select SERIAL_CORE_CONSOLE 1045 select SERIAL_CORE_CONSOLE
1046 help 1046 help
1047 Select this option if you would like to use omap serial port as 1047 Select this option if you would like to use omap serial port as
diff --git a/drivers/tty/serial/altera_uart.c b/drivers/tty/serial/altera_uart.c
index e7903751e058..1f0330915d5a 100644
--- a/drivers/tty/serial/altera_uart.c
+++ b/drivers/tty/serial/altera_uart.c
@@ -556,7 +556,7 @@ static int __devinit altera_uart_probe(struct platform_device *pdev)
556 res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 556 res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
557 if (res_mem) 557 if (res_mem)
558 port->mapbase = res_mem->start; 558 port->mapbase = res_mem->start;
559 else if (platp->mapbase) 559 else if (platp)
560 port->mapbase = platp->mapbase; 560 port->mapbase = platp->mapbase;
561 else 561 else
562 return -EINVAL; 562 return -EINVAL;
@@ -564,7 +564,7 @@ static int __devinit altera_uart_probe(struct platform_device *pdev)
564 res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 564 res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
565 if (res_irq) 565 if (res_irq)
566 port->irq = res_irq->start; 566 port->irq = res_irq->start;
567 else if (platp->irq) 567 else if (platp)
568 port->irq = platp->irq; 568 port->irq = platp->irq;
569 569
570 /* Check platform data first so we can override device node data */ 570 /* Check platform data first so we can override device node data */
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index aee85238ccfc..2d139141de8c 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -1873,10 +1873,6 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id)
1873 goto unmap; 1873 goto unmap;
1874 } 1874 }
1875 1875
1876 /* Ensure interrupts from this UART are masked and cleared */
1877 writew(0, uap->port.membase + UART011_IMSC);
1878 writew(0xffff, uap->port.membase + UART011_ICR);
1879
1880 uap->vendor = vendor; 1876 uap->vendor = vendor;
1881 uap->lcrh_rx = vendor->lcrh_rx; 1877 uap->lcrh_rx = vendor->lcrh_rx;
1882 uap->lcrh_tx = vendor->lcrh_tx; 1878 uap->lcrh_tx = vendor->lcrh_tx;
@@ -1894,6 +1890,10 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id)
1894 uap->port.line = i; 1890 uap->port.line = i;
1895 pl011_dma_probe(uap); 1891 pl011_dma_probe(uap);
1896 1892
1893 /* Ensure interrupts from this UART are masked and cleared */
1894 writew(0, uap->port.membase + UART011_IMSC);
1895 writew(0xffff, uap->port.membase + UART011_ICR);
1896
1897 snprintf(uap->type, sizeof(uap->type), "PL011 rev%u", amba_rev(dev)); 1897 snprintf(uap->type, sizeof(uap->type), "PL011 rev%u", amba_rev(dev));
1898 1898
1899 amba_ports[i] = uap; 1899 amba_ports[i] = uap;
diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index f9a6be7a9bed..3d7e1ee2fa57 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -389,6 +389,8 @@ static void atmel_start_rx(struct uart_port *port)
389{ 389{
390 UART_PUT_CR(port, ATMEL_US_RSTSTA); /* reset status and receiver */ 390 UART_PUT_CR(port, ATMEL_US_RSTSTA); /* reset status and receiver */
391 391
392 UART_PUT_CR(port, ATMEL_US_RXEN);
393
392 if (atmel_use_dma_rx(port)) { 394 if (atmel_use_dma_rx(port)) {
393 /* enable PDC controller */ 395 /* enable PDC controller */
394 UART_PUT_IER(port, ATMEL_US_ENDRX | ATMEL_US_TIMEOUT | 396 UART_PUT_IER(port, ATMEL_US_ENDRX | ATMEL_US_TIMEOUT |
@@ -404,6 +406,8 @@ static void atmel_start_rx(struct uart_port *port)
404 */ 406 */
405static void atmel_stop_rx(struct uart_port *port) 407static void atmel_stop_rx(struct uart_port *port)
406{ 408{
409 UART_PUT_CR(port, ATMEL_US_RXDIS);
410
407 if (atmel_use_dma_rx(port)) { 411 if (atmel_use_dma_rx(port)) {
408 /* disable PDC receive */ 412 /* disable PDC receive */
409 UART_PUT_PTCR(port, ATMEL_PDC_RXTDIS); 413 UART_PUT_PTCR(port, ATMEL_PDC_RXTDIS);
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index 0555c964e713..d3cda0cb2df0 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -1452,29 +1452,24 @@ static int serial_omap_probe(struct platform_device *pdev)
1452 return -ENODEV; 1452 return -ENODEV;
1453 } 1453 }
1454 1454
1455 if (!request_mem_region(mem->start, resource_size(mem), 1455 if (!devm_request_mem_region(&pdev->dev, mem->start, resource_size(mem),
1456 pdev->dev.driver->name)) { 1456 pdev->dev.driver->name)) {
1457 dev_err(&pdev->dev, "memory region already claimed\n"); 1457 dev_err(&pdev->dev, "memory region already claimed\n");
1458 return -EBUSY; 1458 return -EBUSY;
1459 } 1459 }
1460 1460
1461 dma_rx = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx"); 1461 dma_rx = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx");
1462 if (!dma_rx) { 1462 if (!dma_rx)
1463 ret = -EINVAL; 1463 return -ENXIO;
1464 goto err;
1465 }
1466 1464
1467 dma_tx = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx"); 1465 dma_tx = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx");
1468 if (!dma_tx) { 1466 if (!dma_tx)
1469 ret = -EINVAL; 1467 return -ENXIO;
1470 goto err; 1468
1471 } 1469 up = devm_kzalloc(&pdev->dev, sizeof(*up), GFP_KERNEL);
1470 if (!up)
1471 return -ENOMEM;
1472 1472
1473 up = kzalloc(sizeof(*up), GFP_KERNEL);
1474 if (up == NULL) {
1475 ret = -ENOMEM;
1476 goto do_release_region;
1477 }
1478 up->pdev = pdev; 1473 up->pdev = pdev;
1479 up->port.dev = &pdev->dev; 1474 up->port.dev = &pdev->dev;
1480 up->port.type = PORT_OMAP; 1475 up->port.type = PORT_OMAP;
@@ -1494,16 +1489,17 @@ static int serial_omap_probe(struct platform_device *pdev)
1494 dev_err(&pdev->dev, "failed to get alias/pdev id, errno %d\n", 1489 dev_err(&pdev->dev, "failed to get alias/pdev id, errno %d\n",
1495 up->port.line); 1490 up->port.line);
1496 ret = -ENODEV; 1491 ret = -ENODEV;
1497 goto err; 1492 goto err_port_line;
1498 } 1493 }
1499 1494
1500 sprintf(up->name, "OMAP UART%d", up->port.line); 1495 sprintf(up->name, "OMAP UART%d", up->port.line);
1501 up->port.mapbase = mem->start; 1496 up->port.mapbase = mem->start;
1502 up->port.membase = ioremap(mem->start, resource_size(mem)); 1497 up->port.membase = devm_ioremap(&pdev->dev, mem->start,
1498 resource_size(mem));
1503 if (!up->port.membase) { 1499 if (!up->port.membase) {
1504 dev_err(&pdev->dev, "can't ioremap UART\n"); 1500 dev_err(&pdev->dev, "can't ioremap UART\n");
1505 ret = -ENOMEM; 1501 ret = -ENOMEM;
1506 goto err; 1502 goto err_ioremap;
1507 } 1503 }
1508 1504
1509 up->port.flags = omap_up_info->flags; 1505 up->port.flags = omap_up_info->flags;
@@ -1550,16 +1546,19 @@ static int serial_omap_probe(struct platform_device *pdev)
1550 1546
1551 ret = uart_add_one_port(&serial_omap_reg, &up->port); 1547 ret = uart_add_one_port(&serial_omap_reg, &up->port);
1552 if (ret != 0) 1548 if (ret != 0)
1553 goto do_release_region; 1549 goto err_add_port;
1554 1550
1555 pm_runtime_put(&pdev->dev); 1551 pm_runtime_put(&pdev->dev);
1556 platform_set_drvdata(pdev, up); 1552 platform_set_drvdata(pdev, up);
1557 return 0; 1553 return 0;
1558err: 1554
1555err_add_port:
1556 pm_runtime_put(&pdev->dev);
1557 pm_runtime_disable(&pdev->dev);
1558err_ioremap:
1559err_port_line:
1559 dev_err(&pdev->dev, "[UART%d]: failure [%s]: %d\n", 1560 dev_err(&pdev->dev, "[UART%d]: failure [%s]: %d\n",
1560 pdev->id, __func__, ret); 1561 pdev->id, __func__, ret);
1561do_release_region:
1562 release_mem_region(mem->start, resource_size(mem));
1563 return ret; 1562 return ret;
1564} 1563}
1565 1564
@@ -1571,8 +1570,6 @@ static int serial_omap_remove(struct platform_device *dev)
1571 pm_runtime_disable(&up->pdev->dev); 1570 pm_runtime_disable(&up->pdev->dev);
1572 uart_remove_one_port(&serial_omap_reg, &up->port); 1571 uart_remove_one_port(&serial_omap_reg, &up->port);
1573 pm_qos_remove_request(&up->pm_qos_request); 1572 pm_qos_remove_request(&up->pm_qos_request);
1574
1575 kfree(up);
1576 } 1573 }
1577 1574
1578 platform_set_drvdata(dev, NULL); 1575 platform_set_drvdata(dev, NULL);
diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c
index 6e96304b7c8f..a5e63438584f 100644
--- a/drivers/tty/serial/pch_uart.c
+++ b/drivers/tty/serial/pch_uart.c
@@ -213,6 +213,7 @@ enum {
213#define CMITC_UARTCLK 192000000 /* 192.0000 MHz */ 213#define CMITC_UARTCLK 192000000 /* 192.0000 MHz */
214#define FRI2_64_UARTCLK 64000000 /* 64.0000 MHz */ 214#define FRI2_64_UARTCLK 64000000 /* 64.0000 MHz */
215#define FRI2_48_UARTCLK 48000000 /* 48.0000 MHz */ 215#define FRI2_48_UARTCLK 48000000 /* 48.0000 MHz */
216#define NTC1_UARTCLK 64000000 /* 64.0000 MHz */
216 217
217struct pch_uart_buffer { 218struct pch_uart_buffer {
218 unsigned char *buf; 219 unsigned char *buf;
@@ -385,6 +386,12 @@ static int pch_uart_get_uartclk(void)
385 if (cmp && strstr(cmp, "Fish River Island II")) 386 if (cmp && strstr(cmp, "Fish River Island II"))
386 return FRI2_48_UARTCLK; 387 return FRI2_48_UARTCLK;
387 388
389 /* Kontron COMe-mTT10 (nanoETXexpress-TT) */
390 cmp = dmi_get_system_info(DMI_BOARD_NAME);
391 if (cmp && (strstr(cmp, "COMe-mTT") ||
392 strstr(cmp, "nanoETXexpress-TT")))
393 return NTC1_UARTCLK;
394
388 return DEFAULT_UARTCLK; 395 return DEFAULT_UARTCLK;
389} 396}
390 397
@@ -1658,6 +1665,7 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev,
1658 } 1665 }
1659 1666
1660 pci_enable_msi(pdev); 1667 pci_enable_msi(pdev);
1668 pci_set_master(pdev);
1661 1669
1662 iobase = pci_resource_start(pdev, 0); 1670 iobase = pci_resource_start(pdev, 0);
1663 mapbase = pci_resource_start(pdev, 1); 1671 mapbase = pci_resource_start(pdev, 1);
diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
index de249d265bec..d8b0aee35632 100644
--- a/drivers/tty/serial/samsung.c
+++ b/drivers/tty/serial/samsung.c
@@ -982,6 +982,7 @@ static void s3c24xx_serial_resetport(struct uart_port *port,
982 982
983 ucon &= ucon_mask; 983 ucon &= ucon_mask;
984 wr_regl(port, S3C2410_UCON, ucon | cfg->ucon); 984 wr_regl(port, S3C2410_UCON, ucon | cfg->ucon);
985 wr_regl(port, S3C2410_ULCON, cfg->ulcon);
985 986
986 /* reset both fifos */ 987 /* reset both fifos */
987 wr_regl(port, S3C2410_UFCON, cfg->ufcon | S3C2410_UFCON_RESETBOTH); 988 wr_regl(port, S3C2410_UFCON, cfg->ufcon | S3C2410_UFCON_RESETBOTH);
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
index 5836289bd861..84cbf298c094 100644
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -2932,11 +2932,10 @@ static int __init con_init(void)
2932 gotoxy(vc, vc->vc_x, vc->vc_y); 2932 gotoxy(vc, vc->vc_x, vc->vc_y);
2933 csi_J(vc, 0); 2933 csi_J(vc, 0);
2934 update_screen(vc); 2934 update_screen(vc);
2935 pr_info("Console: %s %s %dx%d", 2935 pr_info("Console: %s %s %dx%d\n",
2936 vc->vc_can_do_color ? "colour" : "mono", 2936 vc->vc_can_do_color ? "colour" : "mono",
2937 display_desc, vc->vc_cols, vc->vc_rows); 2937 display_desc, vc->vc_cols, vc->vc_rows);
2938 printable = 1; 2938 printable = 1;
2939 printk("\n");
2940 2939
2941 console_unlock(); 2940 console_unlock();
2942 2941