TTY/Serial fixes for 6.15-rc4

Here are 3 small tty/serial driver fixes for 6.15-rc4 to resolve some
 reported issues.  They include:
   - 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.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCaAt2+A8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+ykW9gCfZ4QI/I9PKnfz7d5hPpYlbBKQFyAAoLoIrpgG
 iG2P2UXrsXF02oOPSIb7
 =h1Nj
 -----END PGP SIGNATURE-----

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

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
This commit is contained in:
Linus Torvalds 2025-04-25 10:44:07 -07:00
commit 3648af4bbb
3 changed files with 14 additions and 3 deletions

View File

@ -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;
}

View File

@ -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);
}
/**

View File

@ -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))