Skip to content

Commit

Permalink
Merge tag 'tty-6.13-rc7' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/gregkh/tty

Pull serial driver fixes from Greg KH:
 "Here are three small serial driver fixes tree. They resolve some
  reported issues:

   - stm32 break control fix

   - 8250 runtime pm usage counter fix

   - imx driver locking fix

  All have been in my tree and linux-next for three weeks now, with no
  reported issues"

* tag 'tty-6.13-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
  serial: stm32: use port lock wrappers for break control
  serial: imx: Use uart_port_lock_irq() instead of uart_port_lock()
  tty: serial: 8250: Fix another runtime PM usage counter underflow
  • Loading branch information
Linus Torvalds committed Jan 12, 2025
2 parents 196856d + 0cfc36e commit 4bd9e3b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions drivers/tty/serial/8250/8250_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,9 @@ int serial8250_register_8250_port(const struct uart_8250_port *up)
uart->dl_write = up->dl_write;

if (uart->port.type != PORT_8250_CIR) {
if (uart_console_registered(&uart->port))
pm_runtime_get_sync(uart->port.dev);

if (serial8250_isa_config != NULL)
serial8250_isa_config(0, &uart->port,
&uart->capabilities);
Expand Down
4 changes: 2 additions & 2 deletions drivers/tty/serial/imx.c
Original file line number Diff line number Diff line change
Expand Up @@ -2692,7 +2692,7 @@ static void imx_uart_enable_wakeup(struct imx_port *sport, bool on)
{
u32 ucr3;

uart_port_lock(&sport->port);
uart_port_lock_irq(&sport->port);

ucr3 = imx_uart_readl(sport, UCR3);
if (on) {
Expand All @@ -2714,7 +2714,7 @@ static void imx_uart_enable_wakeup(struct imx_port *sport, bool on)
imx_uart_writel(sport, ucr1, UCR1);
}

uart_port_unlock(&sport->port);
uart_port_unlock_irq(&sport->port);
}

static int imx_uart_suspend_noirq(struct device *dev)
Expand Down
4 changes: 2 additions & 2 deletions drivers/tty/serial/stm32-usart.c
Original file line number Diff line number Diff line change
Expand Up @@ -1051,14 +1051,14 @@ static void stm32_usart_break_ctl(struct uart_port *port, int break_state)
const struct stm32_usart_offsets *ofs = &stm32_port->info->ofs;
unsigned long flags;

spin_lock_irqsave(&port->lock, flags);
uart_port_lock_irqsave(port, &flags);

if (break_state)
stm32_usart_set_bits(port, ofs->rqr, USART_RQR_SBKRQ);
else
stm32_usart_clr_bits(port, ofs->rqr, USART_RQR_SBKRQ);

spin_unlock_irqrestore(&port->lock, flags);
uart_port_unlock_irqrestore(port, flags);
}

static int stm32_usart_startup(struct uart_port *port)
Expand Down

0 comments on commit 4bd9e3b

Please sign in to comment.