Commit b3ff4fac authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'tty-4.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty

Pull tty/serial fixes from Greg KH:
 "Here are some small fixes for some serial drivers and Kconfig help
  text for 4.11-rc5. Nothing major here at all, a few things resolving
  reported bugs in some random serial drivers.

  I don't think these made the last linux-next due to me getting to them
  yesterday, but I am not sure, they might have snuck in. The patches
  only affect drivers that the maintainers of sent me these patches for,
  so we should be safe here :)"

* tag 'tty-4.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
  tty: pl011: fix earlycon work-around for QDF2400 erratum 44
  serial: 8250_EXAR: fix duplicate Kconfig text and add missing help text
  tty/serial: atmel: fix TX path in atmel_console_write()
  tty/serial: atmel: fix race condition (TX+DMA)
  serial: mxs-auart: Fix baudrate calculation
parents 7ece03b0 e53e597f
...@@ -128,9 +128,13 @@ config SERIAL_8250_PCI ...@@ -128,9 +128,13 @@ config SERIAL_8250_PCI
by the parport_serial driver, enabled with CONFIG_PARPORT_SERIAL. by the parport_serial driver, enabled with CONFIG_PARPORT_SERIAL.
config SERIAL_8250_EXAR config SERIAL_8250_EXAR
tristate "8250/16550 PCI device support" tristate "8250/16550 Exar/Commtech PCI/PCIe device support"
depends on SERIAL_8250_PCI depends on SERIAL_8250_PCI
default SERIAL_8250 default SERIAL_8250
help
This builds support for XR17C1xx, XR17V3xx and some Commtech
422x PCIe serial cards that are not covered by the more generic
SERIAL_8250_PCI option.
config SERIAL_8250_HP300 config SERIAL_8250_HP300
tristate tristate
......
...@@ -2452,18 +2452,37 @@ static void pl011_early_write(struct console *con, const char *s, unsigned n) ...@@ -2452,18 +2452,37 @@ static void pl011_early_write(struct console *con, const char *s, unsigned n)
uart_console_write(&dev->port, s, n, pl011_putc); uart_console_write(&dev->port, s, n, pl011_putc);
} }
/*
* On non-ACPI systems, earlycon is enabled by specifying
* "earlycon=pl011,<address>" on the kernel command line.
*
* On ACPI ARM64 systems, an "early" console is enabled via the SPCR table,
* by specifying only "earlycon" on the command line. Because it requires
* SPCR, the console starts after ACPI is parsed, which is later than a
* traditional early console.
*
* To get the traditional early console that starts before ACPI is parsed,
* specify the full "earlycon=pl011,<address>" option.
*/
static int __init pl011_early_console_setup(struct earlycon_device *device, static int __init pl011_early_console_setup(struct earlycon_device *device,
const char *opt) const char *opt)
{ {
if (!device->port.membase) if (!device->port.membase)
return -ENODEV; return -ENODEV;
device->con->write = qdf2400_e44_present ? /* On QDF2400 SOCs affected by Erratum 44, the "qdf2400_e44" must
qdf2400_e44_early_write : pl011_early_write; * also be specified, e.g. "earlycon=pl011,<address>,qdf2400_e44".
*/
if (!strcmp(device->options, "qdf2400_e44"))
device->con->write = qdf2400_e44_early_write;
else
device->con->write = pl011_early_write;
return 0; return 0;
} }
OF_EARLYCON_DECLARE(pl011, "arm,pl011", pl011_early_console_setup); OF_EARLYCON_DECLARE(pl011, "arm,pl011", pl011_early_console_setup);
OF_EARLYCON_DECLARE(pl011, "arm,sbsa-uart", pl011_early_console_setup); OF_EARLYCON_DECLARE(pl011, "arm,sbsa-uart", pl011_early_console_setup);
EARLYCON_DECLARE(qdf2400_e44, pl011_early_console_setup);
#else #else
#define AMBA_CONSOLE NULL #define AMBA_CONSOLE NULL
......
...@@ -1951,6 +1951,11 @@ static void atmel_flush_buffer(struct uart_port *port) ...@@ -1951,6 +1951,11 @@ static void atmel_flush_buffer(struct uart_port *port)
atmel_uart_writel(port, ATMEL_PDC_TCR, 0); atmel_uart_writel(port, ATMEL_PDC_TCR, 0);
atmel_port->pdc_tx.ofs = 0; atmel_port->pdc_tx.ofs = 0;
} }
/*
* in uart_flush_buffer(), the xmit circular buffer has just
* been cleared, so we have to reset tx_len accordingly.
*/
atmel_port->tx_len = 0;
} }
/* /*
...@@ -2483,6 +2488,9 @@ static void atmel_console_write(struct console *co, const char *s, u_int count) ...@@ -2483,6 +2488,9 @@ static void atmel_console_write(struct console *co, const char *s, u_int count)
pdc_tx = atmel_uart_readl(port, ATMEL_PDC_PTSR) & ATMEL_PDC_TXTEN; pdc_tx = atmel_uart_readl(port, ATMEL_PDC_PTSR) & ATMEL_PDC_TXTEN;
atmel_uart_writel(port, ATMEL_PDC_PTCR, ATMEL_PDC_TXTDIS); atmel_uart_writel(port, ATMEL_PDC_PTCR, ATMEL_PDC_TXTDIS);
/* Make sure that tx path is actually able to send characters */
atmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXEN);
uart_console_write(port, s, count, atmel_console_putchar); uart_console_write(port, s, count, atmel_console_putchar);
/* /*
......
...@@ -1088,7 +1088,7 @@ static void mxs_auart_settermios(struct uart_port *u, ...@@ -1088,7 +1088,7 @@ static void mxs_auart_settermios(struct uart_port *u,
AUART_LINECTRL_BAUD_DIV_MAX); AUART_LINECTRL_BAUD_DIV_MAX);
baud_max = u->uartclk * 32 / AUART_LINECTRL_BAUD_DIV_MIN; baud_max = u->uartclk * 32 / AUART_LINECTRL_BAUD_DIV_MIN;
baud = uart_get_baud_rate(u, termios, old, baud_min, baud_max); baud = uart_get_baud_rate(u, termios, old, baud_min, baud_max);
div = u->uartclk * 32 / baud; div = DIV_ROUND_CLOSEST(u->uartclk * 32, baud);
} }
ctrl |= AUART_LINECTRL_BAUD_DIVFRAC(div & 0x3F); ctrl |= AUART_LINECTRL_BAUD_DIVFRAC(div & 0x3F);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment