Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Oct 2014 20:04:03 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 1201502 for review
Message-ID:  <201410112004.s9BK43U0040128@skunkworks.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@1201502?ac=10

Change 1201502 by jhb@jhb_ralph on 2014/10/11 20:03:15

	Add a PREBUS pass for drivers that need to attach before busses
	are probed.  In particular, the ACPI embedded controller needs to
	be attached very early (e.g. on my Thinkpad).  This means that
	nexus and acpi/legacy on x86 are now attached at the PREBUS pass.
	The system resource drivers are attached next followed by the EC.

Affected files ...

.. //depot/projects/multipass/sys/amd64/acpica/acpi_machdep.c#9 edit
.. //depot/projects/multipass/sys/dev/acpica/acpi.c#15 edit
.. //depot/projects/multipass/sys/dev/acpica/acpi_ec.c#9 edit
.. //depot/projects/multipass/sys/dev/acpica/acpi_resource.c#7 edit
.. //depot/projects/multipass/sys/i386/acpica/acpi_machdep.c#9 edit
.. //depot/projects/multipass/sys/sys/bus.h#13 edit
.. //depot/projects/multipass/sys/x86/x86/legacy.c#3 edit
.. //depot/projects/multipass/sys/x86/x86/nexus.c#6 edit

Differences ...

==== //depot/projects/multipass/sys/amd64/acpica/acpi_machdep.c#9 (text+ko) ====

@@ -382,4 +382,4 @@
 static devclass_t nexus_devclass;
 
 EARLY_DRIVER_MODULE(nexus_acpi, root, nexus_acpi_driver, nexus_devclass, 0, 0,
-    BUS_PASS_BUS);
+    BUS_PASS_PREBUS);

==== //depot/projects/multipass/sys/dev/acpica/acpi.c#15 (text+ko) ====

@@ -230,7 +230,7 @@
 
 static devclass_t acpi_devclass;
 EARLY_DRIVER_MODULE(acpi, nexus, acpi_driver, acpi_devclass, acpi_modevent, 0,
-    BUS_PASS_BUS);
+    BUS_PASS_PREBUS);
 MODULE_VERSION(acpi, 1);
 
 ACPI_SERIAL_DECL(acpi, "ACPI root bus");

==== //depot/projects/multipass/sys/dev/acpica/acpi_ec.c#9 (text+ko) ====

@@ -261,7 +261,7 @@
 
 static devclass_t acpi_ec_devclass;
 EARLY_DRIVER_MODULE(acpi_ec, acpi, acpi_ec_driver, acpi_ec_devclass, 0, 0,
-    BUS_PASS_SCHEDULER);
+    BUS_PASS_PREBUS + BUS_PASS_ORDER_MIDDLE);
 MODULE_DEPEND(acpi_ec, acpi, 1, 1, 1);
 
 /*
@@ -292,7 +292,7 @@
     }
 
     /* Create the child device with the given unit number. */
-    child = BUS_ADD_CHILD(parent, 3, "acpi_ec", ecdt->Uid);
+    child = BUS_ADD_CHILD(parent, 0, "acpi_ec", ecdt->Uid);
     if (child == NULL) {
 	printf("%s: can't add child\n", __func__);
 	return;
@@ -326,10 +326,6 @@
     params->uid = ecdt->Uid;
     acpi_GetInteger(h, "_GLK", &params->glk);
     acpi_set_private(child, params);
-
-    /* Finish the attach process. */
-    if (device_probe_and_attach(child) != 0)
-	device_delete_child(parent, child);
 }
 
 static int

==== //depot/projects/multipass/sys/dev/acpica/acpi_resource.c#7 (text+ko) ====

@@ -647,7 +647,7 @@
 
 static devclass_t acpi_sysres_devclass;
 EARLY_DRIVER_MODULE(acpi_sysresource, acpi, acpi_sysres_driver,
-    acpi_sysres_devclass, 0, 0, BUS_PASS_RESOURCE - 1);
+    acpi_sysres_devclass, 0, 0, BUS_PASS_PREBUS);
 MODULE_DEPEND(acpi_sysresource, acpi, 1, 1, 1);
 
 static int

==== //depot/projects/multipass/sys/i386/acpica/acpi_machdep.c#9 (text+ko) ====

@@ -392,4 +392,4 @@
 static devclass_t nexus_devclass;
 
 EARLY_DRIVER_MODULE(nexus_acpi, root, nexus_acpi_driver, nexus_devclass, 0, 0,
-    BUS_PASS_BUS);
+    BUS_PASS_PREBUS);

==== //depot/projects/multipass/sys/sys/bus.h#13 (text+ko) ====

@@ -564,12 +564,13 @@
  * probed in earlier passes.
  */
 #define	BUS_PASS_ROOT		0	/* Used to attach root0. */
-#define	BUS_PASS_BUS		10	/* Busses and bridges. */
-#define	BUS_PASS_CPU		20	/* CPU devices. */
-#define	BUS_PASS_RESOURCE	30	/* Resource discovery. */
-#define	BUS_PASS_INTERRUPT	40	/* Interrupt controllers. */
-#define	BUS_PASS_TIMER		50	/* Timers and clocks. */
-#define	BUS_PASS_SCHEDULER	60	/* Start scheduler. */
+#define	BUS_PASS_PREBUS		10	/* Prequisites for busses. */
+#define	BUS_PASS_BUS		20	/* Busses and bridges. */
+#define	BUS_PASS_CPU		30	/* CPU devices. */
+#define	BUS_PASS_RESOURCE	40	/* Resource discovery. */
+#define	BUS_PASS_INTERRUPT	50	/* Interrupt controllers. */
+#define	BUS_PASS_TIMER		60	/* Timers and clocks. */
+#define	BUS_PASS_SCHEDULER	70	/* Start scheduler. */
 #define	BUS_PASS_DEFAULT	__INT_MAX /* Everything else. */
 
 #define	BUS_PASS_ORDER_FIRST	0

==== //depot/projects/multipass/sys/x86/x86/legacy.c#3 (text+ko) ====

@@ -109,7 +109,7 @@
 static devclass_t legacy_devclass;
 
 EARLY_DRIVER_MODULE(legacy, nexus, legacy_driver, legacy_devclass, 0, 0,
-    BUS_PASS_BUS);
+    BUS_PASS_PREBUS);
 
 static int
 legacy_probe(device_t dev)

==== //depot/projects/multipass/sys/x86/x86/nexus.c#6 (text+ko) ====

@@ -178,7 +178,7 @@
 static devclass_t nexus_devclass;
 
 EARLY_DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0,
-    BUS_PASS_BUS);
+    BUS_PASS_PREBUS);
 
 static int
 nexus_probe(device_t dev)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201410112004.s9BK43U0040128>