From 6638c61aa6335cabefdac11cb0918c01d83e48c9 Mon Sep 17 00:00:00 2001 From: Nate Lawson Date: Sun, 20 Mar 2005 03:51:18 +0000 Subject: [PATCH] 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.) --- sys/dev/acpica/acpi_perf.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/dev/acpica/acpi_perf.c b/sys/dev/acpica/acpi_perf.c index 629f036434b0..0fc67ca71c3a 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"); }