tty: serial: men_z135_uart.c: Updates for men_z135_uart
v2 cover tty: serial: men_z135_uart.c: Updates for men_z135_uart
Version two of the updates for the men_z135_uart, incorporating Peter's review comments.
1/2: Use spin_lock_irq() in settermios() and spin_lock() in ISR to avoid
deadlocks.
2/2: Removes the double initialization of the port.lock spinlock.
Johannes Thumshirn (2):
tty: serial: men_z135_uart.c: Fix race between IRQ and set_termios()
tty: serial: men_z135_uart.c: Don't initialize port->lock
drivers/tty/serial/men_z135_uart.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
Signature · 1 line
2.4.6
PATCH v2 2/2 tty: serial: men_z135_uart.c: Don't initialize port->lock
port->lock get's initialized in uart_add_one_port(), no need to do it in men_z135_probe().
--- drivers/tty/serial/men_z135_uart.c | 1 - 1 file changed, 1 deletion(-)
drivers/tty/serial/men_z135_uart.c +0 -1
@@ -839,7 +839,6 @@ static int men_z135_probe(struct mcb_device *mdev, uart->port.membase =NULL ; uart->mdev = mdev; -spin_lock_init (&uart->port.lock);spin_lock_init (&uart->lock); err =uart_add_one_port (&men_z135_driver, &uart->port);
Signature · 1 line
2.4.6
Re: [PATCH 2/2] tty: serial: men_z135_uart.c: Don't initialize port->lock
Quoted 2 lines · Johannes Thumshirn
port->lockget's initialized inuart_add_one_port(), no need to do it inmen_z135_probe().
A message that is not in the archive (sent off-list or not yet received): 535885237699310100f3e6804b3677495634042e.1438844880.git.jthumshirn@suse.de
Peter Hurley
Reviewed-byRe: [PATCHv2 1/2] tty: serial: men_z135_uart.c: Fix race between IRQ and set_termios()
Quoted 10 lines · Johannes Thumshirn
Fix panic caused by a race between
men_z135_intr()andmen_z135_set_termios().
men_z135_intr()andmen_z135_set_termios()both hold the structuart_port::lockspinlock, butmen_z135_intr()does aspin_lock_irqsave()andmen_z135_set_termios()does a normalspin_lock(), which can lead to a deadlock when an interrupt is called while the lock is being helt bymen_z135_set_termios().This was discovered using a insmod, hardware looppback send/receive, rmmod stress test.