diff options
Diffstat (limited to 'drivers/tty')
| -rw-r--r-- | drivers/tty/n_tty.c | 6 | ||||
| -rw-r--r-- | drivers/tty/serial/8250/8250_pci.c | 21 | ||||
| -rw-r--r-- | drivers/tty/serial/atmel_serial.c | 1 | ||||
| -rw-r--r-- | drivers/tty/serial/earlycon.c | 3 | ||||
| -rw-r--r-- | drivers/tty/serial/imx.c | 2 | ||||
| -rw-r--r-- | drivers/tty/serial/serial_core.c | 2 | ||||
| -rw-r--r-- | drivers/tty/serial/sh-sci.c | 2 | ||||
| -rw-r--r-- | drivers/tty/tty_io.c | 9 |
8 files changed, 41 insertions, 5 deletions
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c index 5c0e59e8fe46..cbe98bc2b998 100644 --- a/drivers/tty/n_tty.c +++ b/drivers/tty/n_tty.c | |||
| @@ -2180,6 +2180,12 @@ static ssize_t n_tty_read(struct tty_struct *tty, struct file *file, | |||
| 2180 | } | 2180 | } |
| 2181 | if (tty_hung_up_p(file)) | 2181 | if (tty_hung_up_p(file)) |
| 2182 | break; | 2182 | break; |
| 2183 | /* | ||
| 2184 | * Abort readers for ttys which never actually | ||
| 2185 | * get hung up. See __tty_hangup(). | ||
| 2186 | */ | ||
| 2187 | if (test_bit(TTY_HUPPING, &tty->flags)) | ||
| 2188 | break; | ||
| 2183 | if (!timeout) | 2189 | if (!timeout) |
| 2184 | break; | 2190 | break; |
| 2185 | if (file->f_flags & O_NONBLOCK) { | 2191 | if (file->f_flags & O_NONBLOCK) { |
diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c index 54adf8d56350..a93f77ab3da0 100644 --- a/drivers/tty/serial/8250/8250_pci.c +++ b/drivers/tty/serial/8250/8250_pci.c | |||
| @@ -3387,11 +3387,9 @@ static int serial_pci_is_class_communication(struct pci_dev *dev) | |||
| 3387 | /* | 3387 | /* |
| 3388 | * If it is not a communications device or the programming | 3388 | * If it is not a communications device or the programming |
| 3389 | * interface is greater than 6, give up. | 3389 | * interface is greater than 6, give up. |
| 3390 | * | ||
| 3391 | * (Should we try to make guesses for multiport serial devices | ||
| 3392 | * later?) | ||
| 3393 | */ | 3390 | */ |
| 3394 | if ((((dev->class >> 8) != PCI_CLASS_COMMUNICATION_SERIAL) && | 3391 | if ((((dev->class >> 8) != PCI_CLASS_COMMUNICATION_SERIAL) && |
| 3392 | ((dev->class >> 8) != PCI_CLASS_COMMUNICATION_MULTISERIAL) && | ||
| 3395 | ((dev->class >> 8) != PCI_CLASS_COMMUNICATION_MODEM)) || | 3393 | ((dev->class >> 8) != PCI_CLASS_COMMUNICATION_MODEM)) || |
| 3396 | (dev->class & 0xff) > 6) | 3394 | (dev->class & 0xff) > 6) |
| 3397 | return -ENODEV; | 3395 | return -ENODEV; |
| @@ -3428,6 +3426,12 @@ serial_pci_guess_board(struct pci_dev *dev, struct pciserial_board *board) | |||
| 3428 | { | 3426 | { |
| 3429 | int num_iomem, num_port, first_port = -1, i; | 3427 | int num_iomem, num_port, first_port = -1, i; |
| 3430 | 3428 | ||
| 3429 | /* | ||
| 3430 | * Should we try to make guesses for multiport serial devices later? | ||
| 3431 | */ | ||
| 3432 | if ((dev->class >> 8) == PCI_CLASS_COMMUNICATION_MULTISERIAL) | ||
| 3433 | return -ENODEV; | ||
| 3434 | |||
| 3431 | num_iomem = num_port = 0; | 3435 | num_iomem = num_port = 0; |
| 3432 | for (i = 0; i < PCI_NUM_BAR_RESOURCES; i++) { | 3436 | for (i = 0; i < PCI_NUM_BAR_RESOURCES; i++) { |
| 3433 | if (pci_resource_flags(dev, i) & IORESOURCE_IO) { | 3437 | if (pci_resource_flags(dev, i) & IORESOURCE_IO) { |
| @@ -4699,6 +4703,17 @@ static const struct pci_device_id serial_pci_tbl[] = { | |||
| 4699 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, /* 135a.0dc0 */ | 4703 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, /* 135a.0dc0 */ |
| 4700 | pbn_b2_4_115200 }, | 4704 | pbn_b2_4_115200 }, |
| 4701 | /* | 4705 | /* |
| 4706 | * BrainBoxes UC-260 | ||
| 4707 | */ | ||
| 4708 | { PCI_VENDOR_ID_INTASHIELD, 0x0D21, | ||
| 4709 | PCI_ANY_ID, PCI_ANY_ID, | ||
| 4710 | PCI_CLASS_COMMUNICATION_MULTISERIAL << 8, 0xffff00, | ||
| 4711 | pbn_b2_4_115200 }, | ||
| 4712 | { PCI_VENDOR_ID_INTASHIELD, 0x0E34, | ||
| 4713 | PCI_ANY_ID, PCI_ANY_ID, | ||
| 4714 | PCI_CLASS_COMMUNICATION_MULTISERIAL << 8, 0xffff00, | ||
| 4715 | pbn_b2_4_115200 }, | ||
| 4716 | /* | ||
| 4702 | * Perle PCI-RAS cards | 4717 | * Perle PCI-RAS cards |
| 4703 | */ | 4718 | */ |
| 4704 | { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9030, | 4719 | { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9030, |
diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c index df46a9e88c34..e287fe8f10fc 100644 --- a/drivers/tty/serial/atmel_serial.c +++ b/drivers/tty/serial/atmel_serial.c | |||
| @@ -1734,6 +1734,7 @@ static void atmel_get_ip_name(struct uart_port *port) | |||
| 1734 | switch (version) { | 1734 | switch (version) { |
| 1735 | case 0x302: | 1735 | case 0x302: |
| 1736 | case 0x10213: | 1736 | case 0x10213: |
| 1737 | case 0x10302: | ||
| 1737 | dev_dbg(port->dev, "This version is usart\n"); | 1738 | dev_dbg(port->dev, "This version is usart\n"); |
| 1738 | atmel_port->has_frac_baudrate = true; | 1739 | atmel_port->has_frac_baudrate = true; |
| 1739 | atmel_port->has_hw_timer = true; | 1740 | atmel_port->has_hw_timer = true; |
diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c index 870e84fb6e39..a24278380fec 100644 --- a/drivers/tty/serial/earlycon.c +++ b/drivers/tty/serial/earlycon.c | |||
| @@ -245,11 +245,12 @@ int __init of_setup_earlycon(const struct earlycon_id *match, | |||
| 245 | } | 245 | } |
| 246 | port->mapbase = addr; | 246 | port->mapbase = addr; |
| 247 | port->uartclk = BASE_BAUD * 16; | 247 | port->uartclk = BASE_BAUD * 16; |
| 248 | port->membase = earlycon_map(port->mapbase, SZ_4K); | ||
| 249 | 248 | ||
| 250 | val = of_get_flat_dt_prop(node, "reg-offset", NULL); | 249 | val = of_get_flat_dt_prop(node, "reg-offset", NULL); |
| 251 | if (val) | 250 | if (val) |
| 252 | port->mapbase += be32_to_cpu(*val); | 251 | port->mapbase += be32_to_cpu(*val); |
| 252 | port->membase = earlycon_map(port->mapbase, SZ_4K); | ||
| 253 | |||
| 253 | val = of_get_flat_dt_prop(node, "reg-shift", NULL); | 254 | val = of_get_flat_dt_prop(node, "reg-shift", NULL); |
| 254 | if (val) | 255 | if (val) |
| 255 | port->regshift = be32_to_cpu(*val); | 256 | port->regshift = be32_to_cpu(*val); |
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 1d7ca382bc12..a33c685af990 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c | |||
| @@ -2093,7 +2093,7 @@ static int serial_imx_probe(struct platform_device *pdev) | |||
| 2093 | uart_get_rs485_mode(&pdev->dev, &sport->port.rs485); | 2093 | uart_get_rs485_mode(&pdev->dev, &sport->port.rs485); |
| 2094 | 2094 | ||
| 2095 | if (sport->port.rs485.flags & SER_RS485_ENABLED && | 2095 | if (sport->port.rs485.flags & SER_RS485_ENABLED && |
| 2096 | (!sport->have_rtscts || !sport->have_rtsgpio)) | 2096 | (!sport->have_rtscts && !sport->have_rtsgpio)) |
| 2097 | dev_err(&pdev->dev, "no RTS control, disabling rs485\n"); | 2097 | dev_err(&pdev->dev, "no RTS control, disabling rs485\n"); |
| 2098 | 2098 | ||
| 2099 | imx_rs485_config(&sport->port, &sport->port.rs485); | 2099 | imx_rs485_config(&sport->port, &sport->port.rs485); |
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index c8dde56b532b..35b9201db3b4 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c | |||
| @@ -1144,6 +1144,8 @@ static int uart_do_autoconfig(struct tty_struct *tty,struct uart_state *state) | |||
| 1144 | uport->ops->config_port(uport, flags); | 1144 | uport->ops->config_port(uport, flags); |
| 1145 | 1145 | ||
| 1146 | ret = uart_startup(tty, state, 1); | 1146 | ret = uart_startup(tty, state, 1); |
| 1147 | if (ret == 0) | ||
| 1148 | tty_port_set_initialized(port, true); | ||
| 1147 | if (ret > 0) | 1149 | if (ret > 0) |
| 1148 | ret = 0; | 1150 | ret = 0; |
| 1149 | } | 1151 | } |
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index 7257c078e155..44adf9db38f8 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c | |||
| @@ -885,6 +885,8 @@ static void sci_receive_chars(struct uart_port *port) | |||
| 885 | /* Tell the rest of the system the news. New characters! */ | 885 | /* Tell the rest of the system the news. New characters! */ |
| 886 | tty_flip_buffer_push(tport); | 886 | tty_flip_buffer_push(tport); |
| 887 | } else { | 887 | } else { |
| 888 | /* TTY buffers full; read from RX reg to prevent lockup */ | ||
| 889 | serial_port_in(port, SCxRDR); | ||
| 888 | serial_port_in(port, SCxSR); /* dummy read */ | 890 | serial_port_in(port, SCxSR); /* dummy read */ |
| 889 | sci_clear_SCxSR(port, SCxSR_RDxF_CLEAR(port)); | 891 | sci_clear_SCxSR(port, SCxSR_RDxF_CLEAR(port)); |
| 890 | } | 892 | } |
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index eb9133b472f4..63114ea35ec1 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c | |||
| @@ -586,6 +586,14 @@ static void __tty_hangup(struct tty_struct *tty, int exit_session) | |||
| 586 | return; | 586 | return; |
| 587 | } | 587 | } |
| 588 | 588 | ||
| 589 | /* | ||
| 590 | * Some console devices aren't actually hung up for technical and | ||
| 591 | * historical reasons, which can lead to indefinite interruptible | ||
| 592 | * sleep in n_tty_read(). The following explicitly tells | ||
| 593 | * n_tty_read() to abort readers. | ||
| 594 | */ | ||
| 595 | set_bit(TTY_HUPPING, &tty->flags); | ||
| 596 | |||
| 589 | /* inuse_filps is protected by the single tty lock, | 597 | /* inuse_filps is protected by the single tty lock, |
| 590 | this really needs to change if we want to flush the | 598 | this really needs to change if we want to flush the |
| 591 | workqueue with the lock held */ | 599 | workqueue with the lock held */ |
| @@ -640,6 +648,7 @@ static void __tty_hangup(struct tty_struct *tty, int exit_session) | |||
| 640 | * from the ldisc side, which is now guaranteed. | 648 | * from the ldisc side, which is now guaranteed. |
| 641 | */ | 649 | */ |
| 642 | set_bit(TTY_HUPPED, &tty->flags); | 650 | set_bit(TTY_HUPPED, &tty->flags); |
| 651 | clear_bit(TTY_HUPPING, &tty->flags); | ||
| 643 | tty_unlock(tty); | 652 | tty_unlock(tty); |
| 644 | 653 | ||
| 645 | if (f) | 654 | if (f) |
