Skip to content

Commit 3648af4

Browse files
committed
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
2 parents 5281c65 + e1ca3ff commit 3648af4

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

drivers/tty/serial/msm_serial.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1746,6 +1746,12 @@ msm_serial_early_console_setup_dm(struct earlycon_device *device,
17461746
if (!device->port.membase)
17471747
return -ENODEV;
17481748

1749+
/* Disable DM / single-character modes */
1750+
msm_write(&device->port, 0, UARTDM_DMEN);
1751+
msm_write(&device->port, MSM_UART_CR_CMD_RESET_RX, MSM_UART_CR);
1752+
msm_write(&device->port, MSM_UART_CR_CMD_RESET_TX, MSM_UART_CR);
1753+
msm_write(&device->port, MSM_UART_CR_TX_ENABLE, MSM_UART_CR);
1754+
17491755
device->con->write = msm_serial_early_write_dm;
17501756
return 0;
17511757
}

drivers/tty/serial/sifive.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,18 +563,24 @@ static void sifive_serial_break_ctl(struct uart_port *port, int break_state)
563563
static int sifive_serial_startup(struct uart_port *port)
564564
{
565565
struct sifive_serial_port *ssp = port_to_sifive_serial_port(port);
566+
unsigned long flags;
566567

568+
uart_port_lock_irqsave(&ssp->port, &flags);
567569
__ssp_enable_rxwm(ssp);
570+
uart_port_unlock_irqrestore(&ssp->port, flags);
568571

569572
return 0;
570573
}
571574

572575
static void sifive_serial_shutdown(struct uart_port *port)
573576
{
574577
struct sifive_serial_port *ssp = port_to_sifive_serial_port(port);
578+
unsigned long flags;
575579

580+
uart_port_lock_irqsave(&ssp->port, &flags);
576581
__ssp_disable_rxwm(ssp);
577582
__ssp_disable_txwm(ssp);
583+
uart_port_unlock_irqrestore(&ssp->port, flags);
578584
}
579585

580586
/**

drivers/tty/vt/selection.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,13 +193,12 @@ int set_selection_user(const struct tiocl_selection __user *sel,
193193
return -EFAULT;
194194

195195
/*
196-
* TIOCL_SELCLEAR, TIOCL_SELPOINTER and TIOCL_SELMOUSEREPORT are OK to
197-
* use without CAP_SYS_ADMIN as they do not modify the selection.
196+
* TIOCL_SELCLEAR and TIOCL_SELPOINTER are OK to use without
197+
* CAP_SYS_ADMIN as they do not modify the selection.
198198
*/
199199
switch (v.sel_mode) {
200200
case TIOCL_SELCLEAR:
201201
case TIOCL_SELPOINTER:
202-
case TIOCL_SELMOUSEREPORT:
203202
break;
204203
default:
205204
if (!capable(CAP_SYS_ADMIN))

0 commit comments

Comments
 (0)