Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/x86/x86 - prevent matchbiosdisks from being called ...



details:   https://anonhg.NetBSD.org/src/rev/6fe98b37c817
branches:  trunk
changeset: 795172:6fe98b37c817
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Apr 03 15:21:52 2014 +0000

description:
- prevent matchbiosdisks from being called twice. This could happen
  via raid autoconf calling cpu_rootconf() once and then init main
  calling cpu_rootconf() a second time.
- separate booted_device setup into cpu_bootconf(), a new optional function.
  This function can be called before raid autoconfiguration to determine
  the booted device. This needs to be done before raid autoconfiguration,
  otherwise if we are using wedges, the raid will autoconfigure wedges,
  and we'll be unable to open the underlying devices later to determine
  the booted device.
- fix a debugging comment.

diffstat:

 sys/arch/x86/x86/x86_autoconf.c |  19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)

diffs (56 lines):

diff -r 9f9a40f33caf -r 6fe98b37c817 sys/arch/x86/x86/x86_autoconf.c
--- a/sys/arch/x86/x86/x86_autoconf.c   Thu Apr 03 15:16:42 2014 +0000
+++ b/sys/arch/x86/x86/x86_autoconf.c   Thu Apr 03 15:21:52 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: x86_autoconf.c,v 1.69 2014/04/02 02:14:08 christos Exp $       */
+/*     $NetBSD: x86_autoconf.c,v 1.70 2014/04/03 15:21:52 christos Exp $       */
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: x86_autoconf.c,v 1.69 2014/04/02 02:14:08 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: x86_autoconf.c,v 1.70 2014/04/03 15:21:52 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -101,6 +101,8 @@
        int dklist_size;
        int numbig;
 
+       if (x86_ndisks)
+               return;
        big = lookup_bootinfo(BTINFO_BIOSGEOM);
 
        numbig = big ? big->num : 0;
@@ -257,7 +259,7 @@
        int found = 0;
 
        if (device_is_a(dv, "dk")) {
-               DPRINTF(("%s: not dk %s\n", __func__, device_xname(dv)));
+               DPRINTF(("%s: dk %s\n", __func__, device_xname(dv)));
                return 0;
        }
 
@@ -509,11 +511,16 @@
 }
 
 void
+cpu_bootconf(void)
+{
+       findroot();
+       matchbiosdisks();
+}
+
+void
 cpu_rootconf(void)
 {
-
-       findroot();
-       matchbiosdisks();
+       cpu_bootconf();
 
        aprint_normal("boot device: %s\n",
            booted_device ? device_xname(booted_device) : "<unknown>");



Home | Main Index | Thread Index | Old Index