summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornjl <njl@FreeBSD.org>2005-04-10 20:04:30 +0000
committernjl <njl@FreeBSD.org>2005-04-10 20:04:30 +0000
commit77a934a1eeadf53a0db0c332a55726859dcb413e (patch)
treeb7967fae4d683b2dd193b3ed967e187a335e06fa
parent28eaeb94784ef949ae97fd3dbaccd92cf862ce68 (diff)
downloadFreeBSD-src-77a934a1eeadf53a0db0c332a55726859dcb413e.zip
FreeBSD-src-77a934a1eeadf53a0db0c332a55726859dcb413e.tar.gz
Set CPU speed to 100% in acpi_throttle attach. This is needed for some
systems that boot with this value at the lowest setting. Change the default boot config back to "leave frequency as BIOS set it". Also, fix buglet where acpi_throttle wouldn't be used if p4tcc was present but disabled by the user. MFC after: 1 week
-rw-r--r--etc/defaults/rc.conf4
-rw-r--r--sys/dev/acpica/acpi_throttle.c11
2 files changed, 12 insertions, 3 deletions
diff --git a/etc/defaults/rc.conf b/etc/defaults/rc.conf
index e2a9b9c..384be74 100644
--- a/etc/defaults/rc.conf
+++ b/etc/defaults/rc.conf
@@ -474,9 +474,9 @@ devfs_system_ruleset="" # The name of a ruleset to apply to /dev
devfs_set_rulesets="" # A list of /mount/dev=ruleset_name settings to
# apply (must be mounted already, i.e. fstab(5))
performance_cx_lowest="HIGH" # Online CPU idle state
-performance_cpu_freq="HIGH" # Online CPU frequency
+performance_cpu_freq="NONE" # Online CPU frequency
economy_cx_lowest="HIGH" # Offline CPU idle state
-economy_cpu_freq="HIGH" # Offline CPU frequency
+economy_cpu_freq="NONE" # Offline CPU frequency
virecover_enable="YES" # Perform housekeeping for the vi(1) editor
ugidfw_enable="NO" # Load mac_bsdextended(4) rules on boot
bsdextended_script="/etc/rc.bsdextended" # Default mac_bsdextended(4)
diff --git a/sys/dev/acpica/acpi_throttle.c b/sys/dev/acpica/acpi_throttle.c
index 073b060..105ac1d 100644
--- a/sys/dev/acpica/acpi_throttle.c
+++ b/sys/dev/acpica/acpi_throttle.c
@@ -175,7 +175,8 @@ acpi_throttle_probe(device_t dev)
* Since p4tcc uses the same mechanism (but internal to the CPU),
* we disable acpi_throttle when p4tcc is also present.
*/
- if (device_find_child(device_get_parent(dev), "p4tcc", -1))
+ if (device_find_child(device_get_parent(dev), "p4tcc", -1) &&
+ !resource_disabled("p4tcc", 0))
return (ENXIO);
device_set_desc(dev, "ACPI CPU Throttling");
@@ -186,6 +187,7 @@ static int
acpi_throttle_attach(device_t dev)
{
struct acpi_throttle_softc *sc;
+ struct cf_setting set;
ACPI_BUFFER buf;
ACPI_OBJECT *obj;
ACPI_STATUS status;
@@ -217,6 +219,13 @@ acpi_throttle_attach(device_t dev)
if (error)
return (error);
+ /*
+ * Set our initial frequency to the highest since some systems
+ * seem to boot with this at the lowest setting.
+ */
+ set.freq = 10000;
+ acpi_thr_set(dev, &set);
+
/* Everything went ok, register with cpufreq(4). */
cpufreq_register(dev);
return (0);
OpenPOWER on IntegriCloud