[PATCH] Philips PNX8550 ip3106 driver deadlock fix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Ralf,

This is a patch that fixes spin_lock deadlock in serial ip3106 driver.
The spin_lock_irq(&port->lock,flags) is already called in generic driver serial_core.c before
port->ops->start_tx().
So the second call of spin_lock_irq(&port->lock, flags) leads to deadlock. This could be verified in PREEMPT_DESCTOP case when
these options are enabled:
CONFIG_DEBUG_PREEMPT=y
CONFIG_DEBUG_SPINLOCK=y

Vladimir

--- linux-2.6.15/drivers/serial/ip3106_uart.c	2005-12-02 16:37:59.000000000 +0300
+++ linux-2.6.15/drivers/serial/ip3106_uart.c	2005-12-06 20:40:15.000000000 +0300
@@ -149,19 +149,14 @@ static void ip3106_stop_tx(struct uart_p
 static void ip3106_start_tx(struct uart_port *port, unsigned int tty_start)
 {
 	struct ip3106_port *sport = (struct ip3106_port *)port;
-	unsigned long flags;
 	u32 ien;
 
-	spin_lock_irqsave(&sport->port.lock, flags);
-
 	/* Clear all pending TX intr */
 	serial_out(sport, IP3106_ICLR, IP3106_UART_INT_ALLTX);
 
 	/* Enable TX intr */
 	ien = serial_in(sport, IP3106_IEN);
 	serial_out(sport, IP3106_IEN, ien | IP3106_UART_INT_ALLTX);
-
-	spin_unlock_irqrestore(&sport->port.lock, flags);
 }
 
 /*

[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux