From 6655857ec7b8ca3beb28de35e587e8f28cde6f2e Mon Sep 17 00:00:00 2001 From: Nate Lawson Date: Thu, 17 Feb 2005 01:01:40 +0000 Subject: [PATCH] Fix the check for acpi_perf(4) so that we verify if it is fully attached or just offering info. In the former case, we don't probe/attach to allow the ACPI driver precedence. A refinement of this would be to actually use the info provided by acpi_perf(4) to get the real CPU clock rates instead of estimating them but since all systems that support both acpi_perf(4) and ichss(4) export the control registers to acpi_perf(4), it can just handle the registers on its own. --- sys/dev/cpufreq/ichss.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/sys/dev/cpufreq/ichss.c b/sys/dev/cpufreq/ichss.c index 3c9ee53128b..9f19cd4a94a 100644 --- a/sys/dev/cpufreq/ichss.c +++ b/sys/dev/cpufreq/ichss.c @@ -209,12 +209,22 @@ ichss_pci_probe(device_t dev) static int ichss_probe(device_t dev) { + struct cf_setting set; device_t perf_dev; + int count, type; - /* If the ACPI perf driver has attached, let it manage things. */ - perf_dev = devclass_get_device(devclass_find("acpi_perf"), 0); - if (perf_dev && device_is_attached(perf_dev)) - return (ENXIO); + /* + * If the ACPI perf driver has attached and is not just offering + * info, let it manage things. + */ + perf_dev = device_find_child(device_get_parent(dev), "acpi_perf", -1); + if (perf_dev && device_is_attached(perf_dev)) { + type = 0; + count = 1; + CPUFREQ_DRV_SETTINGS(perf_dev, &set, &count, &type); + if ((type & CPUFREQ_FLAG_INFO_ONLY) == 0) + return (ENXIO); + } device_set_desc(dev, "SpeedStep ICH"); return (-1000);