Skip to contentSkip to conversation

Philips PNX8550 ip3106 driver deadlock fix

PATCH In review Vladimir A. Barinov 2 participants 3 messages Dec 6, 2005 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Philips PNX8550 ip3106 driver deadlock fix

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

drivers/serial/ip3106_uart.c +0 -5
@@ -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);
 }
 
 /*
#1 lore raw
Quoted 9 lines · Vladimir A. Barinov

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

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

Ralf

#2 lore raw
Quoted 14 lines · Ralf Baechle
Quoted 9 lines · Vladimir A. Barinov

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

Quoted 4 lines

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

Ok, thank you.

Quoted 5 lines

Ralf