Skip to content

Commit

Permalink
hvc_console: Change an mb() to smp_mb() and add some comments
Browse files Browse the repository at this point in the history
I remember some history on this barrier.  There was a race between
open via /dev/console and the tty being fully setup.  Its also why
there is a temporary variable and the global is assigned at the end
of the function.

Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
  • Loading branch information
Milton Miller authored and Benjamin Herrenschmidt committed Jan 13, 2009
1 parent a1c5a89 commit 9fef3d2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/char/hvc_console.c
Original file line number Diff line number Diff line change
Expand Up @@ -876,8 +876,11 @@ static int hvc_init(void)
goto stop_thread;
}

/* FIXME: This mb() seems completely random. Remove it. */
mb();
/*
* Make sure tty is fully registered before allowing it to be
* found by hvc_console_device.
*/
smp_mb();
hvc_driver = drv;
return 0;

Expand Down

0 comments on commit 9fef3d2

Please sign in to comment.