Linux MIPS Architecture development
 help / color / mirror / Atom feed
* [PATCH] serial_txx9: forcibly init the spinlock for PCI UART used as a console
@ 2005-12-26 22:24 Sergei Shtylylov
  2005-12-27  5:45 ` Atsushi Nemoto
  0 siblings, 1 reply; 11+ messages in thread
From: Sergei Shtylylov @ 2005-12-26 22:24 UTC (permalink / raw)
  To: rmk+serial; +Cc: linux-mips, anemo

[-- Attachment #1: Type: text/plain, Size: 666 bytes --]

Hello.

        When a system console gets assigned to the UART located on the Toshiba
GOKU-S PCI card, the port spinlock is not initialized at all --
uart_add_one_port() thinks it's been initialized by the console setup code
which is called too early for being able to do that, before the PCI card is
even detected by the driver, and therefore fails. That unitialized spinlock
causes 3 BUG messages in the boot log with Ingo Molnar's RT preemption patch
as uart_add_one_port() called to register PCI UART with the serial core calls
uart_configure_port() which makes use of the port spinlock.

WBR, Sergei

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>



[-- Attachment #2: GOKU-console-spinlock-fix.patch --]
[-- Type: text/plain, Size: 685 bytes --]

diff --git a/drivers/serial/serial_txx9.c b/drivers/serial/serial_txx9.c
index f10c86d..3f8dc41 100644
--- a/drivers/serial/serial_txx9.c
+++ b/drivers/serial/serial_txx9.c
@@ -1065,6 +1065,14 @@ static int __devinit serial_txx9_registe
 		uart->port.mapbase  = port->mapbase;
 		if (port->dev)
 			uart->port.dev = port->dev;
+
+		/*
+		 * If this port is a console, its spinlock couldn't have been
+		 * initialized by serial_txx9_console_setup() and it won't be
+		 * initialized by uart_add_one_port(), so have to do it here...
+		 */
+		spin_lock_init(&uart->port.lock);
+
 		ret = uart_add_one_port(&serial_txx9_reg, &uart->port);
 		if (ret == 0)
 			ret = uart->port.line;





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

end of thread, other threads:[~2006-01-05 15:12 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-26 22:24 [PATCH] serial_txx9: forcibly init the spinlock for PCI UART used as a console Sergei Shtylylov
2005-12-27  5:45 ` Atsushi Nemoto
2005-12-27 13:38   ` Sergei Shtylylov
2005-12-27 15:34     ` Atsushi Nemoto
2005-12-27 16:29       ` Sergei Shtylylov
2005-12-27 18:41       ` Russell King
2005-12-27 18:54         ` Sergei Shtylylov
2005-12-27 19:31           ` Sergei Shtylyov
2005-12-28  4:25         ` Atsushi Nemoto
2005-12-29 16:32           ` Atsushi Nemoto
2006-01-05 15:14         ` Atsushi Nemoto

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