Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 473721f9 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull tty/serial driver fixes from Greg KH:
 "Here are a number of small tty core and serial driver fixes for
  5.0-rc4 to resolve some reported issues.

  Nothing major, the small serial driver fixes, a tty core fixup for a
  crash that was reported, and some good vt fixes from Nicolas Pitre as
  he seems to be auditing that chunk of code a lot lately.

  All of these have been in linux-next for a while with no reported
  issues"

* tag 'tty-5.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
  serial: fsl_lpuart: fix maximum acceptable baud rate with over-sampling
  tty: serial: qcom_geni_serial: Allow mctrl when flow control is disabled
  tty: Handle problem if line discipline does not have receive_buf
  vgacon: unconfuse vc_origin when using soft scrollback
  vt: invoke notifier on screen size change
  vt: always call notifier with the console lock held
  vt: make vt_console_print() compatible with the unicode screen buffer
  tty/n_hdlc: fix __might_sleep warning
  serial: 8250: Fix serial8250 initialization crash
  uart: Fix crash in uart_write and uart_put_char
parents b48cef32 815d835b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -597,6 +597,7 @@ static ssize_t n_hdlc_tty_read(struct tty_struct *tty, struct file *file,
				/* too large for caller's buffer */
				ret = -EOVERFLOW;
			} else {
				__set_current_state(TASK_RUNNING);
				if (copy_to_user(buf, rbuf->buf, rbuf->count))
					ret = -EFAULT;
				else
+9 −8
Original line number Diff line number Diff line
@@ -1070,16 +1070,17 @@ int serial8250_register_8250_port(struct uart_8250_port *up)

			ret = 0;
		}
	}

		/* Initialise interrupt backoff work if required */
		if (up->overrun_backoff_time_ms > 0) {
		uart->overrun_backoff_time_ms = up->overrun_backoff_time_ms;
			uart->overrun_backoff_time_ms =
				up->overrun_backoff_time_ms;
			INIT_DELAYED_WORK(&uart->overrun_backoff,
					serial_8250_overrun_backoff_work);
		} else {
			uart->overrun_backoff_time_ms = 0;
		}
	}

	mutex_unlock(&serial_mutex);

+1 −1
Original line number Diff line number Diff line
@@ -1697,7 +1697,7 @@ lpuart32_set_termios(struct uart_port *port, struct ktermios *termios,
	}

	/* ask the core to calculate the divisor */
	baud = uart_get_baud_rate(port, termios, old, 50, port->uartclk / 16);
	baud = uart_get_baud_rate(port, termios, old, 50, port->uartclk / 4);

	spin_lock_irqsave(&sport->port.lock, flags);

+2 −2
Original line number Diff line number Diff line
@@ -225,7 +225,7 @@ static unsigned int qcom_geni_serial_get_mctrl(struct uart_port *uport)
	unsigned int mctrl = TIOCM_DSR | TIOCM_CAR;
	u32 geni_ios;

	if (uart_console(uport) || !uart_cts_enabled(uport)) {
	if (uart_console(uport)) {
		mctrl |= TIOCM_CTS;
	} else {
		geni_ios = readl_relaxed(uport->membase + SE_GENI_IOS);
@@ -241,7 +241,7 @@ static void qcom_geni_serial_set_mctrl(struct uart_port *uport,
{
	u32 uart_manual_rfr = 0;

	if (uart_console(uport) || !uart_cts_enabled(uport))
	if (uart_console(uport))
		return;

	if (!(mctrl & TIOCM_RTS))
+8 −4
Original line number Diff line number Diff line
@@ -550,10 +550,12 @@ static int uart_put_char(struct tty_struct *tty, unsigned char c)
	int ret = 0;

	circ = &state->xmit;
	if (!circ->buf)
	port = uart_port_lock(state, flags);
	if (!circ->buf) {
		uart_port_unlock(port, flags);
		return 0;
	}

	port = uart_port_lock(state, flags);
	if (port && uart_circ_chars_free(circ) != 0) {
		circ->buf[circ->head] = c;
		circ->head = (circ->head + 1) & (UART_XMIT_SIZE - 1);
@@ -586,11 +588,13 @@ static int uart_write(struct tty_struct *tty,
		return -EL3HLT;
	}

	port = uart_port_lock(state, flags);
	circ = &state->xmit;
	if (!circ->buf)
	if (!circ->buf) {
		uart_port_unlock(port, flags);
		return 0;
	}

	port = uart_port_lock(state, flags);
	while (port) {
		c = CIRC_SPACE_TO_END(circ->head, circ->tail, UART_XMIT_SIZE);
		if (count < c)
Loading