Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Feb 2012 22:26:15 +0000 (UTC)
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r232086 - stable/9/sys/dev/acpica
Message-ID:  <201202232226.q1NMQFAB028321@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jkim
Date: Thu Feb 23 22:26:14 2012
New Revision: 232086
URL: http://svn.freebsd.org/changeset/base/232086

Log:
  MFC:	r231161
  
  - 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:
  stable/9/sys/dev/acpica/acpi.c
  stable/9/sys/dev/acpica/acpi_ec.c
  stable/9/sys/dev/acpica/acpi_hpet.c
  stable/9/sys/dev/acpica/acpi_timer.c
  stable/9/sys/dev/acpica/acpivar.h
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/dev/acpica/acpi.c
==============================================================================
--- stable/9/sys/dev/acpica/acpi.c	Thu Feb 23 22:20:52 2012	(r232085)
+++ stable/9/sys/dev/acpica/acpi.c	Thu Feb 23 22:26:14 2012	(r232086)
@@ -1815,23 +1815,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;
 }
 
 /*
@@ -1892,7 +1898,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: stable/9/sys/dev/acpica/acpi_ec.c
==============================================================================
--- stable/9/sys/dev/acpica/acpi_ec.c	Thu Feb 23 22:20:52 2012	(r232085)
+++ stable/9/sys/dev/acpica/acpi_ec.c	Thu Feb 23 22:26:14 2012	(r232086)
@@ -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: stable/9/sys/dev/acpica/acpi_hpet.c
==============================================================================
--- stable/9/sys/dev/acpica/acpi_hpet.c	Thu Feb 23 22:20:52 2012	(r232085)
+++ stable/9/sys/dev/acpica/acpi_hpet.c	Thu Feb 23 22:26:14 2012	(r232086)
@@ -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: stable/9/sys/dev/acpica/acpi_timer.c
==============================================================================
--- stable/9/sys/dev/acpica/acpi_timer.c	Thu Feb 23 22:20:52 2012	(r232085)
+++ stable/9/sys/dev/acpica/acpi_timer.c	Thu Feb 23 22:26:14 2012	(r232086)
@@ -128,7 +128,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: stable/9/sys/dev/acpica/acpivar.h
==============================================================================
--- stable/9/sys/dev/acpica/acpivar.h	Thu Feb 23 22:20:52 2012	(r232085)
+++ stable/9/sys/dev/acpica/acpivar.h	Thu Feb 23 22:26:14 2012	(r232086)
@@ -472,7 +472,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?201202232226.q1NMQFAB028321>