Skip to content

Commit

Permalink
Add console lock check for 5.15.154+
Browse files Browse the repository at this point in the history
  • Loading branch information
SamulKyull authored Jun 17, 2024
1 parent e05b1e3 commit cf5ce8e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bsp/drivers/uart/sunxi-uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -1207,8 +1207,10 @@ static void sw_uart_set_termios(struct uart_port *port, struct ktermios *termios
dlh = quot >> 8;
SERIAL_DBG(port->dev, "set baudrate %d, quot %d\n", baud, quot);

#if (LINUX_VERSION_CODE <= KERNEL_VERSION(5, 15, 153))
if (uart_console(port))
console_lock();
#endif

spin_lock_irqsave(&port->lock, flags);
uart_update_timeout(port, termios->c_cflag, baud);
Expand Down Expand Up @@ -1304,8 +1306,10 @@ static void sw_uart_set_termios(struct uart_port *port, struct ktermios *termios

spin_unlock_irqrestore(&port->lock, flags);

#if (LINUX_VERSION_CODE <= KERNEL_VERSION(5, 15, 153))
if (uart_console(port))
console_unlock();
#endif

/* Don't rewrite B0 */
if (tty_termios_baud_rate(termios))
Expand Down

0 comments on commit cf5ce8e

Please sign in to comment.