Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a07ee86205808d36973440e68c7277f9ed63b87f
Commit:     a07ee86205808d36973440e68c7277f9ed63b87f
Parent:     6ffbc82351c62eeeeaeb9e817ddf93049353493d
Author:     Horms <[EMAIL PROTECTED]>
AuthorDate: Wed Jul 25 16:06:25 2007 +0900
Committer:  Tony Luck <[EMAIL PROTECTED]>
CommitDate: Wed Jul 25 11:12:47 2007 -0700

    [IA64] Ensure that machvec is set up takes place before serial console
    
    Parse the machvec command line option outside of the early_param()
    so that ia64_mv is set before any console intialisation that
    may result from early_param parsing.
    
    Signed-off-by: Simon Horman <[EMAIL PROTECTED]>
    Signed-off-by: Tony Luck <[EMAIL PROTECTED]>
---
 arch/ia64/kernel/machvec.c |   27 ++++++++++++++++++---------
 arch/ia64/kernel/setup.c   |   11 ++++++++---
 include/asm-ia64/machvec.h |    1 +
 3 files changed, 27 insertions(+), 12 deletions(-)

diff --git a/arch/ia64/kernel/machvec.c b/arch/ia64/kernel/machvec.c
index 13df337..7ccb228 100644
--- a/arch/ia64/kernel/machvec.c
+++ b/arch/ia64/kernel/machvec.c
@@ -13,14 +13,6 @@
 struct ia64_machine_vector ia64_mv;
 EXPORT_SYMBOL(ia64_mv);
 
-static __initdata const char *mvec_name;
-static __init int setup_mvec(char *s)
-{
-       mvec_name = s;
-       return 0;
-}
-early_param("machvec", setup_mvec);
-
 static struct ia64_machine_vector * __init
 lookup_machvec (const char *name)
 {
@@ -41,7 +33,7 @@ machvec_init (const char *name)
        struct ia64_machine_vector *mv;
 
        if (!name)
-               name = mvec_name ? mvec_name : acpi_get_sysname();
+               name = acpi_get_sysname();
        mv = lookup_machvec(name);
        if (!mv)
                panic("generic kernel failed to find machine vector for"
@@ -51,6 +43,23 @@ machvec_init (const char *name)
        printk(KERN_INFO "booting generic kernel on platform %s\n", name);
 }
 
+void __init
+machvec_init_from_cmdline(const char *cmdline)
+{
+       char str[64];
+       const char *start;
+       char *end;
+
+       if (! (start = strstr(cmdline, "machvec=")) )
+               return machvec_init(NULL);
+
+       strlcpy(str, start + strlen("machvec="), sizeof(str));
+       if ( (end = strchr(str, ' ')) )
+               *end = '\0';
+
+       return machvec_init(str);
+}
+
 #endif /* CONFIG_IA64_GENERIC */
 
 void
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
index cf06fe7..7cecd29 100644
--- a/arch/ia64/kernel/setup.c
+++ b/arch/ia64/kernel/setup.c
@@ -491,12 +491,17 @@ setup_arch (char **cmdline_p)
        efi_init();
        io_port_init();
 
-       parse_early_param();
-
 #ifdef CONFIG_IA64_GENERIC
-       machvec_init(NULL);
+       /* machvec needs to be parsed from the command line
+        * before parse_early_param() is called to ensure
+        * that ia64_mv is initialised before any command line
+        * settings may cause console setup to occur
+        */
+       machvec_init_from_cmdline(*cmdline_p);
 #endif
 
+       parse_early_param();
+
        if (early_console_setup(*cmdline_p) == 0)
                mark_bsp_online();
 
diff --git a/include/asm-ia64/machvec.h b/include/asm-ia64/machvec.h
index ca33eb1..5cf8bf1 100644
--- a/include/asm-ia64/machvec.h
+++ b/include/asm-ia64/machvec.h
@@ -275,6 +275,7 @@ struct ia64_machine_vector {
 
 extern struct ia64_machine_vector ia64_mv;
 extern void machvec_init (const char *name);
+extern void machvec_init_from_cmdline(const char *cmdline);
 
 # else
 #  error Unknown configuration.  Update asm-ia64/machvec.h.
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to