public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sa1100 serial: sa1100_start_tx spinlock recursion
@ 2005-11-11  3:09 Florin Malita
  2005-11-12 22:10 ` Russell King
  0 siblings, 1 reply; 2+ messages in thread
From: Florin Malita @ 2005-11-11  3:09 UTC (permalink / raw)
  To: akpm, rmk+lkml; +Cc: linux-kernel, linux-arm-kernel

The serial core aquires the port spinlock before calling
port->ops->start_tx(), so sa1100_start_tx() shouldn't try to lock it
again.

BUG: spinlock recursion on CPU#0, init/1
 lock: c0205f20, .magic: dead4ead, .owner: init/1, .owner_cpu: 0
[<c0022cdc>] (dump_stack+0x0/0x14) [<c00dc338>] (spin_bug+0x0/0xbc)   
[<c00dc6b0>] (_raw_spin_lock+0x0/0x170)  r8 = 00000007  r7 = C02FE0070                                                   
[<c018a2a8>] (_spin_lock_irqsave+0x0/0x24)  r4 = C0205F20 
[<c0112110>] (sa1100_start_tx+0x0/0x40)  r4 = C038C000    
[<c010ee38>] (__uart_start+0x0/0x5c) [<c010ee94>] (uart_start+0x0/0x3 
[<c010f1d0>] (uart_write+0x0/0xdc) [<c00fee34>] (write_chan+0x0/0x370 



Signed-off-by: Florin Malita <fmalita@gmail.com>
----
diff --git a/drivers/serial/sa1100.c b/drivers/serial/sa1100.c
--- a/drivers/serial/sa1100.c
+++ b/drivers/serial/sa1100.c
@@ -156,7 +156,7 @@ static void sa1100_stop_tx(struct uart_p
 }
 
 /*
- * interrupts may not be disabled on entry
+ * port locked and interrupts disabled
  */
 static void sa1100_start_tx(struct uart_port *port)
 {
@@ -164,11 +164,9 @@ static void sa1100_start_tx(struct uart_
 	unsigned long flags;
 	u32 utcr3;
 
-	spin_lock_irqsave(&sport->port.lock, flags);
 	utcr3 = UART_GET_UTCR3(sport);
 	sport->port.read_status_mask |= UTSR0_TO_SM(UTSR0_TFS);
 	UART_PUT_UTCR3(sport, utcr3 | UTCR3_TIE);
-	spin_unlock_irqrestore(&sport->port.lock, flags);
 }
 
 /*


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] sa1100 serial: sa1100_start_tx spinlock recursion
  2005-11-11  3:09 [PATCH] sa1100 serial: sa1100_start_tx spinlock recursion Florin Malita
@ 2005-11-12 22:10 ` Russell King
  0 siblings, 0 replies; 2+ messages in thread
From: Russell King @ 2005-11-12 22:10 UTC (permalink / raw)
  To: Florin Malita; +Cc: akpm, linux-kernel

On Thu, Nov 10, 2005 at 10:09:37PM -0500, Florin Malita wrote:
> The serial core aquires the port spinlock before calling
> port->ops->start_tx(), so sa1100_start_tx() shouldn't try to lock it
> again.

Applied, thanks.

PS, please do not copy linux-kernel and linux-arm-kernel.  The latter
is set for member only posting and it's considered rude to cross post.
Thanks.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-11-12 22:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-11  3:09 [PATCH] sa1100 serial: sa1100_start_tx spinlock recursion Florin Malita
2005-11-12 22:10 ` Russell King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox