[PATCH] hvc_console: start kernel thread before registering tty

Anton Blanchard anton at samba.org
Wed Sep 14 20:31:21 EST 2005


Hi,

Its possible that we can write to the hvc_console tty as soon it is
registered. Recently this started happening due to (what looks like) a
change to the hotplug code.

Unfortunately at this stage we have not started the khvcd kernel thread
and oops. The solution is to start the kernel thread before registering
the tty.

Signed-off-by: Anton Blanchard <anton at samba.org>
---

Index: build/drivers/char/hvc_console.c
===================================================================
--- build.orig/drivers/char/hvc_console.c	2005-09-14 13:22:31.000000000 +1000
+++ build/drivers/char/hvc_console.c	2005-09-14 18:57:16.000000000 +1000
@@ -839,9 +839,6 @@
 	hvc_driver->flags = TTY_DRIVER_REAL_RAW;
 	tty_set_operations(hvc_driver, &hvc_ops);
 
-	if (tty_register_driver(hvc_driver))
-		panic("Couldn't register hvc console driver\n");
-
 	/* Always start the kthread because there can be hotplug vty adapters
 	 * added later. */
 	hvc_task = kthread_run(khvcd, NULL, "khvcd");
@@ -851,6 +848,9 @@
 		return -EIO;
 	}
 
+	if (tty_register_driver(hvc_driver))
+		panic("Couldn't register hvc console driver\n");
+
 	return 0;
 }
 module_init(hvc_init);



More information about the Linuxppc64-dev mailing list