summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornjl <njl@FreeBSD.org>2005-03-20 03:51:18 +0000
committernjl <njl@FreeBSD.org>2005-03-20 03:51:18 +0000
commitf2b3c68800dc1798695dbe34dab54848bd13067a (patch)
tree405283f985b89ac4bf100b5d71363611023530a5
parentd4af181c4d3f94318b4503f252016541d2abd4b8 (diff)
downloadFreeBSD-src-f2b3c68800dc1798695dbe34dab54848bd13067a.zip
FreeBSD-src-f2b3c68800dc1798695dbe34dab54848bd13067a.tar.gz
Attach acpi_perf early. Especially when it is being used to provide info
to other devices, it needs to be attached first. (Multi-pass newbus probes would be a better solution.)
-rw-r--r--sys/dev/acpica/acpi_perf.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/dev/acpica/acpi_perf.c b/sys/dev/acpica/acpi_perf.c
index 629f036..0fc67ca 100644
--- a/sys/dev/acpica/acpi_perf.c
+++ b/sys/dev/acpica/acpi_perf.c
@@ -141,6 +141,7 @@ static void
acpi_perf_identify(driver_t *driver, device_t parent)
{
ACPI_HANDLE handle;
+ device_t dev;
/* Make sure we're not being doubly invoked. */
if (device_find_child(parent, "acpi_perf", -1) != NULL)
@@ -156,8 +157,12 @@ acpi_perf_identify(driver_t *driver, device_t parent)
/*
* Add a child to every CPU that has the right methods. In future
* versions of the ACPI spec, CPUs can have different settings.
+ * We probe this child now so that other devices that depend
+ * on it (i.e., for info about supported states) will see it.
*/
- if (BUS_ADD_CHILD(parent, 0, "acpi_perf", -1) == NULL)
+ if ((dev = BUS_ADD_CHILD(parent, 0, "acpi_perf", -1)) != NULL)
+ device_probe_and_attach(dev);
+ else
device_printf(parent, "add acpi_perf child failed\n");
}
OpenPOWER on IntegriCloud