aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-01-18 18:02:50 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-01-18 18:02:50 -0500
commit61b6b7fbda1bcef6d3df6b789e6bb178ee83d3d8 (patch)
treeed23eb87f0b1152118985f93a5f19ef66629bb9e /drivers/tty
parent4c215fe8e288c87b34c3d5bc910c77af586859d2 (diff)
parentec6f34e5b552fb0a52e6aae1a5afbbb1605cc6cc (diff)
Merge 3.19-rc5 into tty-next
We want those tty fixes in that release in this branch as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/n_tty.c9
-rw-r--r--drivers/tty/serial/8250/8250_pci.c29
-rw-r--r--drivers/tty/serial/samsung.c56
-rw-r--r--drivers/tty/serial/serial_core.c4
-rw-r--r--drivers/tty/tty_io.c7
5 files changed, 70 insertions, 35 deletions
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
index d2b496750d59..4ddfa60c9222 100644
--- a/drivers/tty/n_tty.c
+++ b/drivers/tty/n_tty.c
@@ -2399,17 +2399,12 @@ static unsigned int n_tty_poll(struct tty_struct *tty, struct file *file,
2399 2399
2400 poll_wait(file, &tty->read_wait, wait); 2400 poll_wait(file, &tty->read_wait, wait);
2401 poll_wait(file, &tty->write_wait, wait); 2401 poll_wait(file, &tty->write_wait, wait);
2402 if (test_bit(TTY_OTHER_CLOSED, &tty->flags))
2403 mask |= POLLHUP;
2404 if (input_available_p(tty, 1)) 2402 if (input_available_p(tty, 1))
2405 mask |= POLLIN | POLLRDNORM; 2403 mask |= POLLIN | POLLRDNORM;
2406 else if (mask & POLLHUP) {
2407 tty_flush_to_ldisc(tty);
2408 if (input_available_p(tty, 1))
2409 mask |= POLLIN | POLLRDNORM;
2410 }
2411 if (tty->packet && tty->link->ctrl_status) 2404 if (tty->packet && tty->link->ctrl_status)
2412 mask |= POLLPRI | POLLIN | POLLRDNORM; 2405 mask |= POLLPRI | POLLIN | POLLRDNORM;
2406 if (test_bit(TTY_OTHER_CLOSED, &tty->flags))
2407 mask |= POLLHUP;
2413 if (tty_hung_up_p(file)) 2408 if (tty_hung_up_p(file))
2414 mask |= POLLHUP; 2409 mask |= POLLHUP;
2415 if (!(mask & (POLLHUP | POLLIN | POLLRDNORM))) { 2410 if (!(mask & (POLLHUP | POLLIN | POLLRDNORM))) {
diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c
index 31feeb2d0a66..d1f8dc6aabcb 100644
--- a/drivers/tty/serial/8250/8250_pci.c
+++ b/drivers/tty/serial/8250/8250_pci.c
@@ -1815,7 +1815,7 @@ pci_wch_ch353_setup(struct serial_private *priv,
1815} 1815}
1816 1816
1817static int 1817static int
1818pci_wch_ch382_setup(struct serial_private *priv, 1818pci_wch_ch38x_setup(struct serial_private *priv,
1819 const struct pciserial_board *board, 1819 const struct pciserial_board *board,
1820 struct uart_8250_port *port, int idx) 1820 struct uart_8250_port *port, int idx)
1821{ 1821{
@@ -1880,6 +1880,7 @@ pci_wch_ch382_setup(struct serial_private *priv,
1880 1880
1881#define PCIE_VENDOR_ID_WCH 0x1c00 1881#define PCIE_VENDOR_ID_WCH 0x1c00
1882#define PCIE_DEVICE_ID_WCH_CH382_2S1P 0x3250 1882#define PCIE_DEVICE_ID_WCH_CH382_2S1P 0x3250
1883#define PCIE_DEVICE_ID_WCH_CH384_4S 0x3470
1883 1884
1884/* Unknown vendors/cards - this should not be in linux/pci_ids.h */ 1885/* Unknown vendors/cards - this should not be in linux/pci_ids.h */
1885#define PCI_SUBDEVICE_ID_UNKNOWN_0x1584 0x1584 1886#define PCI_SUBDEVICE_ID_UNKNOWN_0x1584 0x1584
@@ -2571,13 +2572,21 @@ static struct pci_serial_quirk pci_serial_quirks[] __refdata = {
2571 .subdevice = PCI_ANY_ID, 2572 .subdevice = PCI_ANY_ID,
2572 .setup = pci_wch_ch353_setup, 2573 .setup = pci_wch_ch353_setup,
2573 }, 2574 },
2574 /* WCH CH382 2S1P card (16750 clone) */ 2575 /* WCH CH382 2S1P card (16850 clone) */
2575 { 2576 {
2576 .vendor = PCIE_VENDOR_ID_WCH, 2577 .vendor = PCIE_VENDOR_ID_WCH,
2577 .device = PCIE_DEVICE_ID_WCH_CH382_2S1P, 2578 .device = PCIE_DEVICE_ID_WCH_CH382_2S1P,
2578 .subvendor = PCI_ANY_ID, 2579 .subvendor = PCI_ANY_ID,
2579 .subdevice = PCI_ANY_ID, 2580 .subdevice = PCI_ANY_ID,
2580 .setup = pci_wch_ch382_setup, 2581 .setup = pci_wch_ch38x_setup,
2582 },
2583 /* WCH CH384 4S card (16850 clone) */
2584 {
2585 .vendor = PCIE_VENDOR_ID_WCH,
2586 .device = PCIE_DEVICE_ID_WCH_CH384_4S,
2587 .subvendor = PCI_ANY_ID,
2588 .subdevice = PCI_ANY_ID,
2589 .setup = pci_wch_ch38x_setup,
2581 }, 2590 },
2582 /* 2591 /*
2583 * ASIX devices with FIFO bug 2592 * ASIX devices with FIFO bug
@@ -2876,6 +2885,7 @@ enum pci_board_num_t {
2876 pbn_fintek_4, 2885 pbn_fintek_4,
2877 pbn_fintek_8, 2886 pbn_fintek_8,
2878 pbn_fintek_12, 2887 pbn_fintek_12,
2888 pbn_wch384_4,
2879}; 2889};
2880 2890
2881/* 2891/*
@@ -3675,6 +3685,14 @@ static struct pciserial_board pci_boards[] = {
3675 .base_baud = 115200, 3685 .base_baud = 115200,
3676 .first_offset = 0x40, 3686 .first_offset = 0x40,
3677 }, 3687 },
3688
3689 [pbn_wch384_4] = {
3690 .flags = FL_BASE0,
3691 .num_ports = 4,
3692 .base_baud = 115200,
3693 .uart_offset = 8,
3694 .first_offset = 0xC0,
3695 },
3678}; 3696};
3679 3697
3680static const struct pci_device_id blacklist[] = { 3698static const struct pci_device_id blacklist[] = {
@@ -3687,6 +3705,7 @@ static const struct pci_device_id blacklist[] = {
3687 { PCI_DEVICE(0x4348, 0x7053), }, /* WCH CH353 2S1P */ 3705 { PCI_DEVICE(0x4348, 0x7053), }, /* WCH CH353 2S1P */
3688 { PCI_DEVICE(0x4348, 0x5053), }, /* WCH CH353 1S1P */ 3706 { PCI_DEVICE(0x4348, 0x5053), }, /* WCH CH353 1S1P */
3689 { PCI_DEVICE(0x1c00, 0x3250), }, /* WCH CH382 2S1P */ 3707 { PCI_DEVICE(0x1c00, 0x3250), }, /* WCH CH382 2S1P */
3708 { PCI_DEVICE(0x1c00, 0x3470), }, /* WCH CH384 4S */
3690}; 3709};
3691 3710
3692/* 3711/*
@@ -5400,6 +5419,10 @@ static struct pci_device_id serial_pci_tbl[] = {
5400 PCI_ANY_ID, PCI_ANY_ID, 5419 PCI_ANY_ID, PCI_ANY_ID,
5401 0, 0, pbn_b0_bt_2_115200 }, 5420 0, 0, pbn_b0_bt_2_115200 },
5402 5421
5422 { PCIE_VENDOR_ID_WCH, PCIE_DEVICE_ID_WCH_CH384_4S,
5423 PCI_ANY_ID, PCI_ANY_ID,
5424 0, 0, pbn_wch384_4 },
5425
5403 /* 5426 /*
5404 * Commtech, Inc. Fastcom adapters 5427 * Commtech, Inc. Fastcom adapters
5405 */ 5428 */
diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
index dae3c16ece09..024e5ecee985 100644
--- a/drivers/tty/serial/samsung.c
+++ b/drivers/tty/serial/samsung.c
@@ -2303,32 +2303,43 @@ static struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = {
2303#endif 2303#endif
2304 2304
2305#if defined(CONFIG_ARCH_EXYNOS) 2305#if defined(CONFIG_ARCH_EXYNOS)
2306#define EXYNOS_COMMON_SERIAL_DRV_DATA \
2307 .info = &(struct s3c24xx_uart_info) { \
2308 .name = "Samsung Exynos UART", \
2309 .type = PORT_S3C6400, \
2310 .has_divslot = 1, \
2311 .rx_fifomask = S5PV210_UFSTAT_RXMASK, \
2312 .rx_fifoshift = S5PV210_UFSTAT_RXSHIFT, \
2313 .rx_fifofull = S5PV210_UFSTAT_RXFULL, \
2314 .tx_fifofull = S5PV210_UFSTAT_TXFULL, \
2315 .tx_fifomask = S5PV210_UFSTAT_TXMASK, \
2316 .tx_fifoshift = S5PV210_UFSTAT_TXSHIFT, \
2317 .def_clk_sel = S3C2410_UCON_CLKSEL0, \
2318 .num_clks = 1, \
2319 .clksel_mask = 0, \
2320 .clksel_shift = 0, \
2321 }, \
2322 .def_cfg = &(struct s3c2410_uartcfg) { \
2323 .ucon = S5PV210_UCON_DEFAULT, \
2324 .ufcon = S5PV210_UFCON_DEFAULT, \
2325 .has_fracval = 1, \
2326 } \
2327
2306static struct s3c24xx_serial_drv_data exynos4210_serial_drv_data = { 2328static struct s3c24xx_serial_drv_data exynos4210_serial_drv_data = {
2307 .info = &(struct s3c24xx_uart_info) { 2329 EXYNOS_COMMON_SERIAL_DRV_DATA,
2308 .name = "Samsung Exynos4 UART",
2309 .type = PORT_S3C6400,
2310 .has_divslot = 1,
2311 .rx_fifomask = S5PV210_UFSTAT_RXMASK,
2312 .rx_fifoshift = S5PV210_UFSTAT_RXSHIFT,
2313 .rx_fifofull = S5PV210_UFSTAT_RXFULL,
2314 .tx_fifofull = S5PV210_UFSTAT_TXFULL,
2315 .tx_fifomask = S5PV210_UFSTAT_TXMASK,
2316 .tx_fifoshift = S5PV210_UFSTAT_TXSHIFT,
2317 .def_clk_sel = S3C2410_UCON_CLKSEL0,
2318 .num_clks = 1,
2319 .clksel_mask = 0,
2320 .clksel_shift = 0,
2321 },
2322 .def_cfg = &(struct s3c2410_uartcfg) {
2323 .ucon = S5PV210_UCON_DEFAULT,
2324 .ufcon = S5PV210_UFCON_DEFAULT,
2325 .has_fracval = 1,
2326 },
2327 .fifosize = { 256, 64, 16, 16 }, 2330 .fifosize = { 256, 64, 16, 16 },
2328}; 2331};
2332
2333static struct s3c24xx_serial_drv_data exynos5433_serial_drv_data = {
2334 EXYNOS_COMMON_SERIAL_DRV_DATA,
2335 .fifosize = { 64, 256, 16, 256 },
2336};
2337
2329#define EXYNOS4210_SERIAL_DRV_DATA ((kernel_ulong_t)&exynos4210_serial_drv_data) 2338#define EXYNOS4210_SERIAL_DRV_DATA ((kernel_ulong_t)&exynos4210_serial_drv_data)
2339#define EXYNOS5433_SERIAL_DRV_DATA ((kernel_ulong_t)&exynos5433_serial_drv_data)
2330#else 2340#else
2331#define EXYNOS4210_SERIAL_DRV_DATA (kernel_ulong_t)NULL 2341#define EXYNOS4210_SERIAL_DRV_DATA (kernel_ulong_t)NULL
2342#define EXYNOS5433_SERIAL_DRV_DATA (kernel_ulong_t)NULL
2332#endif 2343#endif
2333 2344
2334static struct platform_device_id s3c24xx_serial_driver_ids[] = { 2345static struct platform_device_id s3c24xx_serial_driver_ids[] = {
@@ -2350,6 +2361,9 @@ static struct platform_device_id s3c24xx_serial_driver_ids[] = {
2350 }, { 2361 }, {
2351 .name = "exynos4210-uart", 2362 .name = "exynos4210-uart",
2352 .driver_data = EXYNOS4210_SERIAL_DRV_DATA, 2363 .driver_data = EXYNOS4210_SERIAL_DRV_DATA,
2364 }, {
2365 .name = "exynos5433-uart",
2366 .driver_data = EXYNOS5433_SERIAL_DRV_DATA,
2353 }, 2367 },
2354 { }, 2368 { },
2355}; 2369};
@@ -2369,6 +2383,8 @@ static const struct of_device_id s3c24xx_uart_dt_match[] = {
2369 .data = (void *)S5PV210_SERIAL_DRV_DATA }, 2383 .data = (void *)S5PV210_SERIAL_DRV_DATA },
2370 { .compatible = "samsung,exynos4210-uart", 2384 { .compatible = "samsung,exynos4210-uart",
2371 .data = (void *)EXYNOS4210_SERIAL_DRV_DATA }, 2385 .data = (void *)EXYNOS4210_SERIAL_DRV_DATA },
2386 { .compatible = "samsung,exynos5433-uart",
2387 .data = (void *)EXYNOS5433_SERIAL_DRV_DATA },
2372 {}, 2388 {},
2373}; 2389};
2374MODULE_DEVICE_TABLE(of, s3c24xx_uart_dt_match); 2390MODULE_DEVICE_TABLE(of, s3c24xx_uart_dt_match);
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index 57ca61b14670..984605bb5bf1 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -2164,7 +2164,9 @@ uart_report_port(struct uart_driver *drv, struct uart_port *port)
2164 break; 2164 break;
2165 } 2165 }
2166 2166
2167 dev_info(port->dev, "%s%d at %s (irq = %d, base_baud = %d) is a %s\n", 2167 printk(KERN_INFO "%s%s%s%d at %s (irq = %d, base_baud = %d) is a %s\n",
2168 port->dev ? dev_name(port->dev) : "",
2169 port->dev ? ": " : "",
2168 drv->dev_name, 2170 drv->dev_name,
2169 drv->tty_driver->name_base + port->line, 2171 drv->tty_driver->name_base + port->line,
2170 address, port->irq, port->uartclk / 16, uart_type(port)); 2172 address, port->irq, port->uartclk / 16, uart_type(port));
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 4f35b43e2475..51f066aa375e 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -1464,6 +1464,9 @@ static int tty_reopen(struct tty_struct *tty)
1464 driver->subtype == PTY_TYPE_MASTER) 1464 driver->subtype == PTY_TYPE_MASTER)
1465 return -EIO; 1465 return -EIO;
1466 1466
1467 if (test_bit(TTY_EXCLUSIVE, &tty->flags) && !capable(CAP_SYS_ADMIN))
1468 return -EBUSY;
1469
1467 tty->count++; 1470 tty->count++;
1468 1471
1469 WARN_ON(!tty->ldisc); 1472 WARN_ON(!tty->ldisc);
@@ -2106,10 +2109,6 @@ retry_open:
2106 retval = -ENODEV; 2109 retval = -ENODEV;
2107 filp->f_flags = saved_flags; 2110 filp->f_flags = saved_flags;
2108 2111
2109 if (!retval && test_bit(TTY_EXCLUSIVE, &tty->flags) &&
2110 !capable(CAP_SYS_ADMIN))
2111 retval = -EBUSY;
2112
2113 if (retval) { 2112 if (retval) {
2114#ifdef TTY_DEBUG_HANGUP 2113#ifdef TTY_DEBUG_HANGUP
2115 printk(KERN_DEBUG "%s: error %d in opening %s...\n", __func__, 2114 printk(KERN_DEBUG "%s: error %d in opening %s...\n", __func__,