Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933418AbbFJKga (ORCPT ); Wed, 10 Jun 2015 06:36:30 -0400 Received: from mail-la0-f43.google.com ([209.85.215.43]:35049 "EHLO mail-la0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752109AbbFJKgX (ORCPT ); Wed, 10 Jun 2015 06:36:23 -0400 MIME-Version: 1.0 In-Reply-To: <1433929488.26331.117.camel@linux.intel.com> References: <1433848247-3550-1-git-send-email-kuleshovmail@gmail.com> <1433848301-5296-1-git-send-email-kuleshovmail@gmail.com> <1433869251.26331.114.camel@linux.intel.com> <1433929488.26331.117.camel@linux.intel.com> Date: Wed, 10 Jun 2015 16:36:21 +0600 Message-ID: Subject: Re: [PATCH v11 4/5] x86/earlyprintk: setup earlyprintk as early as possible From: Alexander Kuleshov To: Andy Shevchenko Cc: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , LKML , Greg Kroah-Hartman , Borislav Petkov , Mark Rustad , Yinghai Lu Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1624 Lines: 53 2015-06-10 15:44 GMT+06:00 Andy Shevchenko : > You do parsing twice (still original code and your piece here), and > honestly I don't like your approach in this form. I just researched earlyprintk and we can use not only serial, but vga and pciserial. What if I'll rename setup_early_serial_console to the setup_earlyprintk_console, will add variable, something like this static unsigned int early = 1; to the arch/x86/kernel/earlyprintk.c and refactor the setup_early_serial_console as: int __init setup_earlyprintk_console(void) { char *arg; arg = strstr(boot_command_line, "earlyprintk="); if (!arg) return -1; early = 0; return setup_early_printk(arg); } After this we can check in the setup_earlyprintk is it early to set other consoles or not, while (*buf != '\0') { .... #ifdef CONFIG_EARLY_PRINTK_EFI if (!strncmp(buf, "efi", 3) && early) early_console_register(&early_efi_console, keep); #endif .... } early = 1; So, when we will call setup_earlyprintk_console from the arch/x86/kernel/head{32,64}.c, early variable will be 0 and it allows us to setup only 'real early' consoles and when setup_earlyprintk will be called by the do_early_param early variable will be one and we will be able to setup efi console and etc.... What do you think about it? -- 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/