From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 60C10DE6C8 for ; Fri, 18 Apr 2008 18:21:11 +1000 (EST) Subject: Re: [PATCH 02/11] Add udbg_console_anytime() which sets udbg console to CON_ANYTIME From: Benjamin Herrenschmidt To: Michael Ellerman In-Reply-To: References: Content-Type: text/plain Date: Fri, 18 Apr 2008 18:20:58 +1000 Message-Id: <1208506858.6958.404.camel@pasglop> Mime-Version: 1.0 Cc: linuxppc-dev@ozlabs.org Reply-To: benh@kernel.crashing.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Fri, 2008-04-18 at 17:54 +1000, Michael Ellerman wrote: > In theory the udbg console should be safe to call basically at any time > after boot. It does not need any per-cpu resources or for the cpu to be > online, as long as there is a udbg_putc routine hooked up it should > work. So it should be able to be marked as CON_ANYTIME. > > Verifying this will take a bit of time and testing though, so instead of > marking udbg console as CON_ANYTIME for all platforms, add a routine so > that a platform can opt-in to having udbg console called early. > > Signed-off-by: Michael Ellerman Nah, just stick it always. Cheers, Ben. > --- > arch/powerpc/kernel/udbg.c | 5 +++++ > include/asm-powerpc/udbg.h | 1 + > 2 files changed, 6 insertions(+), 0 deletions(-) > > diff --git a/arch/powerpc/kernel/udbg.c b/arch/powerpc/kernel/udbg.c > index 9ac5f3a..7b1fd86 100644 > --- a/arch/powerpc/kernel/udbg.c > +++ b/arch/powerpc/kernel/udbg.c > @@ -158,6 +158,11 @@ static struct console udbg_console = { > .index = 0, > }; > > +void udbg_console_anytime(void) > +{ > + udbg_console.flags |= CON_ANYTIME; > +} > + > static int early_console_initialized; > > /* > diff --git a/include/asm-powerpc/udbg.h b/include/asm-powerpc/udbg.h > index 6418cee..102fa91 100644 > --- a/include/asm-powerpc/udbg.h > +++ b/include/asm-powerpc/udbg.h > @@ -23,6 +23,7 @@ extern int udbg_write(const char *s, int n); > extern int udbg_read(char *buf, int buflen); > > extern void register_early_udbg_console(void); > +extern void udbg_console_anytime(void); > extern void udbg_printf(const char *fmt, ...) > __attribute__ ((format (printf, 1, 2))); > extern void udbg_progress(char *s, unsigned short hex);