Subject: [PATCH] Philips PNX8550 ip3106 driver deadlock fix

From: "Vladimir A. Barinov" <[email-masked]>
Date: Tue, 06 Dec 2005 20:54:36 +0300

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);
 }
 
 /*

---

From: Ralf Baechle <[email-masked]>
Date: Tue, 6 Dec 2005 18:00:35 +0000

> these options are enabled:

Serial drivers are maintained by [email-masked], please send
to him.

  Ralf

---

From: "Vladimir A. Barinov" <[email-masked]>
Date: Tue, 06 Dec 2005 21:03:00 +0300

>Serial drivers are maintained by [email-masked], please send
Ok, thank you.