Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751798AbZAHMPp (ORCPT ); Thu, 8 Jan 2009 07:15:45 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753796AbZAHMOd (ORCPT ); Thu, 8 Jan 2009 07:14:33 -0500 Received: from mercury.realtime.net ([205.238.132.86]:37581 "EHLO mercury.realtime.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752669AbZAHMOc (ORCPT ); Thu, 8 Jan 2009 07:14:32 -0500 Subject: [PATCH 4/4] hvc_console: comment mb and make it an smp_ one To: Christian Borntraeger , Benjiman Herrenschmidt From: Milton Miller cc: linuxppc-dev list , lkml , Alan Cox Message-Id: In-Reply-To: : Date: Thu, 08 Jan 2009 06:14:18 -0600 X-Originating-IP: 205.232.218.56 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1081 Lines: 31 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 Index: work.git/drivers/char/hvc_console.c =================================================================== --- work.git.orig/drivers/char/hvc_console.c 2009-01-08 04:33:39.000000000 -0600 +++ work.git/drivers/char/hvc_console.c 2009-01-08 04:35:09.000000000 -0600 @@ -875,8 +875,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; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/