Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Feb 2012 20:54:45 +0000 (UTC)
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r231161 - head/sys/dev/acpica
Message-ID:  <201202072054.q17KsjCT007149@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jkim
Date: Tue Feb  7 20:54:44 2012
New Revision: 231161
URL: http://svn.freebsd.org/changeset/base/231161

Log:
  - Give all clocks and timers on acpi0 the equal probing order.
  - Increase probing order for ECDT table to match HID-based probing.
  - Decrease probing order for HPET table to match HID-based probing.
  - Decrease probing order for CPUs and system resources.
  - Fix ACPI_DEV_BASE_ORDER to reflect the reality.

Modified:
  head/sys/dev/acpica/acpi.c
  head/sys/dev/acpica/acpi_ec.c
  head/sys/dev/acpica/acpi_hpet.c
  head/sys/dev/acpica/acpi_timer.c
  head/sys/dev/acpica/acpivar.h

Modified: head/sys/dev/acpica/acpi.c
==============================================================================
--- head/sys/dev/acpica/acpi.c	Tue Feb  7 20:43:28 2012	(r231160)
+++ head/sys/dev/acpica/acpi.c	Tue Feb  7 20:54:44 2012	(r231161)
@@ -1812,23 +1812,29 @@ acpi_probe_children(device_t bus)
 static void
 acpi_probe_order(ACPI_HANDLE handle, int *order)
 {
-    ACPI_OBJECT_TYPE type;
+	ACPI_OBJECT_TYPE type;
 
-    /*
-     * 1. CPUs
-     * 2. I/O port and memory system resource holders
-     * 3. Embedded controllers (to handle early accesses)
-     * 4. PCI Link Devices
-     */
-    AcpiGetType(handle, &type);
-    if (type == ACPI_TYPE_PROCESSOR)
-	*order = 1;
-    else if (acpi_MatchHid(handle, "PNP0C01") || acpi_MatchHid(handle, "PNP0C02"))
-	*order = 2;
-    else if (acpi_MatchHid(handle, "PNP0C09"))
-	*order = 3;
-    else if (acpi_MatchHid(handle, "PNP0C0F"))
-	*order = 4;
+	/*
+	 * 0. CPUs
+	 * 1. I/O port and memory system resource holders
+	 * 2. Clocks and timers (to handle early accesses)
+	 * 3. Embedded controllers (to handle early accesses)
+	 * 4. PCI Link Devices
+	 */
+	AcpiGetType(handle, &type);
+	if (type == ACPI_TYPE_PROCESSOR)
+		*order = 0;
+	else if (acpi_MatchHid(handle, "PNP0C01") ||
+	    acpi_MatchHid(handle, "PNP0C02"))
+		*order = 1;
+	else if (acpi_MatchHid(handle, "PNP0100") ||
+	    acpi_MatchHid(handle, "PNP0103") ||
+	    acpi_MatchHid(handle, "PNP0B00"))
+		*order = 2;
+	else if (acpi_MatchHid(handle, "PNP0C09"))
+		*order = 3;
+	else if (acpi_MatchHid(handle, "PNP0C0F"))
+		*order = 4;
 }
 
 /*
@@ -1889,7 +1895,7 @@ acpi_probe_child(ACPI_HANDLE handle, UIN
 	     * resources).
 	     */
 	    ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "scanning '%s'\n", handle_str));
-	    order = level * 10 + 100;
+	    order = level * 10 + ACPI_DEV_BASE_ORDER;
 	    acpi_probe_order(handle, &order);
 	    child = BUS_ADD_CHILD(bus, order, NULL, -1);
 	    if (child == NULL)

Modified: head/sys/dev/acpica/acpi_ec.c
==============================================================================
--- head/sys/dev/acpica/acpi_ec.c	Tue Feb  7 20:43:28 2012	(r231160)
+++ head/sys/dev/acpica/acpi_ec.c	Tue Feb  7 20:54:44 2012	(r231161)
@@ -295,7 +295,7 @@ acpi_ec_ecdt_probe(device_t parent)
     }
 
     /* Create the child device with the given unit number. */
-    child = BUS_ADD_CHILD(parent, 0, "acpi_ec", ecdt->Uid);
+    child = BUS_ADD_CHILD(parent, 3, "acpi_ec", ecdt->Uid);
     if (child == NULL) {
 	printf("%s: can't add child\n", __func__);
 	return;

Modified: head/sys/dev/acpica/acpi_hpet.c
==============================================================================
--- head/sys/dev/acpica/acpi_hpet.c	Tue Feb  7 20:43:28 2012	(r231160)
+++ head/sys/dev/acpica/acpi_hpet.c	Tue Feb  7 20:54:44 2012	(r231161)
@@ -342,7 +342,7 @@ hpet_identify(driver_t *driver, device_t
 		if (found)
 			continue;
 		/* If not - create it from table info. */
-		child = BUS_ADD_CHILD(parent, ACPI_DEV_BASE_ORDER, "hpet", 0);
+		child = BUS_ADD_CHILD(parent, 2, "hpet", 0);
 		if (child == NULL) {
 			printf("%s: can't add child\n", __func__);
 			continue;

Modified: head/sys/dev/acpica/acpi_timer.c
==============================================================================
--- head/sys/dev/acpica/acpi_timer.c	Tue Feb  7 20:43:28 2012	(r231160)
+++ head/sys/dev/acpica/acpi_timer.c	Tue Feb  7 20:54:44 2012	(r231161)
@@ -124,7 +124,7 @@ acpi_timer_identify(driver_t *driver, de
 	acpi_timer_dev)
 	return_VOID;
 
-    if ((dev = BUS_ADD_CHILD(parent, 0, "acpi_timer", 0)) == NULL) {
+    if ((dev = BUS_ADD_CHILD(parent, 2, "acpi_timer", 0)) == NULL) {
 	device_printf(parent, "could not add acpi_timer0\n");
 	return_VOID;
     }

Modified: head/sys/dev/acpica/acpivar.h
==============================================================================
--- head/sys/dev/acpica/acpivar.h	Tue Feb  7 20:43:28 2012	(r231160)
+++ head/sys/dev/acpica/acpivar.h	Tue Feb  7 20:54:44 2012	(r231161)
@@ -473,7 +473,7 @@ ACPI_HANDLE	acpi_GetReference(ACPI_HANDL
  * probe order sorted so that things like sysresource are available before
  * their children need them.
  */
-#define	ACPI_DEV_BASE_ORDER	10
+#define	ACPI_DEV_BASE_ORDER	100
 
 /* Default maximum number of tasks to enqueue. */
 #ifndef ACPI_MAX_TASKS



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