Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

tty: serial: samsung_tty: avoid dev_dbg deadlock

commit a05025d0ce72 ("tty: serial: samsung_tty: use standard
debugging macros") changed the debug prints to dev_dbg, which can
result in deadlocks:

s3c24xx_serial_set_termios can be called with the port lock, and then
calls dev_dbg, which needs the console mutex. At the same time,
s3c24xx_serial_console_write can be called with the console lock
(e.g., inside console_unlock), and needs the port lock.

To avoid this, move one dev_dbg call and just delete the other.

Signed-off-by: Alyssa Milburn <amilburn@zall.org>
Link: https://patch.msgid.link/aXny9km6N1v9eoXU@zall.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Alyssa Milburn and committed by
Greg Kroah-Hartman
43c2b86f 1f318b96

+2 -8
+2 -8
drivers/tty/serial/samsung_tty.c
··· 1562 1562 ulcon |= S3C2410_LCON_PNONE; 1563 1563 } 1564 1564 1565 - uart_port_lock_irqsave(port, &flags); 1566 - 1567 1565 dev_dbg(port->dev, 1568 1566 "setting ulcon to %08x, brddiv to %d, udivslot %08x\n", 1569 1567 ulcon, quot, udivslot); 1568 + 1569 + uart_port_lock_irqsave(port, &flags); 1570 1570 1571 1571 wr_regl(port, S3C2410_ULCON, ulcon); 1572 1572 wr_regl(port, S3C2410_UBRDIV, quot); ··· 1586 1586 1587 1587 if (ourport->info->has_divslot) 1588 1588 wr_regl(port, S3C2443_DIVSLOT, udivslot); 1589 - 1590 - dev_dbg(port->dev, 1591 - "uart: ulcon = 0x%08x, ucon = 0x%08x, ufcon = 0x%08x\n", 1592 - rd_regl(port, S3C2410_ULCON), 1593 - rd_regl(port, S3C2410_UCON), 1594 - rd_regl(port, S3C2410_UFCON)); 1595 1589 1596 1590 /* 1597 1591 * Update the per-port timeout.