Skip to content

Commit

Permalink
[PATCH] hvc_console: start kernel thread before registering tty
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Anton Blanchard authored and Linus Torvalds committed Sep 14, 2005
1 parent 8b7fc42 commit ef4cbee
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/char/hvc_console.c
Original file line number Diff line number Diff line change
Expand Up @@ -839,9 +839,6 @@ int __init hvc_init(void)
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");
Expand All @@ -851,6 +848,9 @@ int __init hvc_init(void)
return -EIO;
}

if (tty_register_driver(hvc_driver))
panic("Couldn't register hvc console driver\n");

return 0;
}
module_init(hvc_init);
Expand Down

0 comments on commit ef4cbee

Please sign in to comment.