[PATCH] hvc_console: start kernel thread before registering tty

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@samba.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by Anton Blanchard and committed by Linus Torvalds ef4cbee0 8b7fc421

+3 -3
+3 -3
drivers/char/hvc_console.c
··· 839 839 hvc_driver->flags = TTY_DRIVER_REAL_RAW; 840 840 tty_set_operations(hvc_driver, &hvc_ops); 841 841 842 - if (tty_register_driver(hvc_driver)) 843 - panic("Couldn't register hvc console driver\n"); 844 - 845 842 /* Always start the kthread because there can be hotplug vty adapters 846 843 * added later. */ 847 844 hvc_task = kthread_run(khvcd, NULL, "khvcd"); ··· 847 850 put_tty_driver(hvc_driver); 848 851 return -EIO; 849 852 } 853 + 854 + if (tty_register_driver(hvc_driver)) 855 + panic("Couldn't register hvc console driver\n"); 850 856 851 857 return 0; 852 858 }