summaryrefslogtreecommitdiffstats
path: root/etc/rc.d/power_profile
diff options
context:
space:
mode:
authorsbruno <sbruno@FreeBSD.org>2012-07-02 16:57:13 +0000
committersbruno <sbruno@FreeBSD.org>2012-07-02 16:57:13 +0000
commitabb8277b313e28cfe13d13b4f0a05fa4d1bd035b (patch)
treee8d114020185fcffe36f284f0d6318e33f91c259 /etc/rc.d/power_profile
parent26a057bce7069299f5055f592e9331e48318f5df (diff)
downloadFreeBSD-src-abb8277b313e28cfe13d13b4f0a05fa4d1bd035b.zip
FreeBSD-src-abb8277b313e28cfe13d13b4f0a05fa4d1bd035b.tar.gz
Cosmetic display change of Cx states via cx_supported sysctl entries.
Adjust power_profile script to handle the new world order as well. Some vendors are opting out of a C2 state and only defining C1 & C3. This leads the acpi_cpu display to indicate that the machine supports C1 & C2 which is caused by the (mis)use of the index of the cx_state array as the ACPI_STATE_CX value. e.g. the code was pretending that cx_state[i] would always convert to i by subtracting 1. cx_state[2] == ACPI_STATE_C3 cx_state[1] == ACPI_STATE_C2 cx_state[0] == ACPI_STATE_C1 however, on certain machines this would lead to cx_state[1] == ACPI_STATE_C3 cx_state[0] == ACPI_STATE_C1 This didn't break anything but led to a display of: * dev.cpu.0.cx_supported: C1/1 C2/96 Instead of * dev.cpu.0.cx_supported: C1/1 C3/96 MFC after: 2 weeks
Diffstat (limited to 'etc/rc.d/power_profile')
-rwxr-xr-xetc/rc.d/power_profile2
1 files changed, 1 insertions, 1 deletions
diff --git a/etc/rc.d/power_profile b/etc/rc.d/power_profile
index 03d36be..b7540c7 100755
--- a/etc/rc.d/power_profile
+++ b/etc/rc.d/power_profile
@@ -90,7 +90,7 @@ node="dev.cpu.0.freq"
highest_value="`(sysctl -n dev.cpu.0.freq_levels | \
awk '{ split($0, a, "[/ ]"); print a[1] }' -) 2> /dev/null`"
lowest_value="`(sysctl -n dev.cpu.0.freq_levels | \
- awk '{ split($0, a, "[/ ]"); print a[length(a) - 1] }' -) 2> /dev/null`"
+ awk '{ split($0, a, "[ /]"); print a[length(a) - 1] }' -) 2> /dev/null`"
eval value=\$${profile}_cpu_freq
sysctl_set
OpenPOWER on IntegriCloud