Commit 3648af4b authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull tty/serial fixes from Greg KH:
 "Here are three small tty/serial driver fixes for 6.15-rc4 to resolve
  some reported issues. They are:

   - permissions change for TIOCL_SELMOUSEREPORT to resolve a relaxing
     of permissions that showed up 6.14 that wasn't _quite_ right.

   - sifive serial driver fix

   - msm serial driver fix

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

* tag 'tty-6.15-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
  serial: sifive: lock port in startup()/shutdown() callbacks
  tty: Require CAP_SYS_ADMIN for all usages of TIOCL_SELMOUSEREPORT
  serial: msm: Configure correct working mode before starting earlycon
parents 5281c656 e1ca3ff2
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1746,6 +1746,12 @@ msm_serial_early_console_setup_dm(struct earlycon_device *device,
	if (!device->port.membase)
		return -ENODEV;

	/* Disable DM / single-character modes */
	msm_write(&device->port, 0, UARTDM_DMEN);
	msm_write(&device->port, MSM_UART_CR_CMD_RESET_RX, MSM_UART_CR);
	msm_write(&device->port, MSM_UART_CR_CMD_RESET_TX, MSM_UART_CR);
	msm_write(&device->port, MSM_UART_CR_TX_ENABLE, MSM_UART_CR);

	device->con->write = msm_serial_early_write_dm;
	return 0;
}
+6 −0
Original line number Diff line number Diff line
@@ -563,8 +563,11 @@ static void sifive_serial_break_ctl(struct uart_port *port, int break_state)
static int sifive_serial_startup(struct uart_port *port)
{
	struct sifive_serial_port *ssp = port_to_sifive_serial_port(port);
	unsigned long flags;

	uart_port_lock_irqsave(&ssp->port, &flags);
	__ssp_enable_rxwm(ssp);
	uart_port_unlock_irqrestore(&ssp->port, flags);

	return 0;
}
@@ -572,9 +575,12 @@ static int sifive_serial_startup(struct uart_port *port)
static void sifive_serial_shutdown(struct uart_port *port)
{
	struct sifive_serial_port *ssp = port_to_sifive_serial_port(port);
	unsigned long flags;

	uart_port_lock_irqsave(&ssp->port, &flags);
	__ssp_disable_rxwm(ssp);
	__ssp_disable_txwm(ssp);
	uart_port_unlock_irqrestore(&ssp->port, flags);
}

/**
+2 −3
Original line number Diff line number Diff line
@@ -193,13 +193,12 @@ int set_selection_user(const struct tiocl_selection __user *sel,
		return -EFAULT;

	/*
	 * TIOCL_SELCLEAR, TIOCL_SELPOINTER and TIOCL_SELMOUSEREPORT are OK to
	 * use without CAP_SYS_ADMIN as they do not modify the selection.
	 * TIOCL_SELCLEAR and TIOCL_SELPOINTER are OK to use without
	 * CAP_SYS_ADMIN as they do not modify the selection.
	 */
	switch (v.sel_mode) {
	case TIOCL_SELCLEAR:
	case TIOCL_SELPOINTER:
	case TIOCL_SELMOUSEREPORT:
		break;
	default:
		if (!capable(CAP_SYS_ADMIN))