Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 152057 - sys-power/cpufreqd - misleading error message in /etc/init.d/cpufreqd
Summary: sys-power/cpufreqd - misleading error message in /etc/init.d/cpufreqd
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal trivial (vote)
Assignee: Christian Heim (RETIRED)
URL:
Whiteboard:
Keywords:
: 213342 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-10-20 01:46 UTC by Daniel Franke
Modified: 2008-03-14 17:41 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
cpufreqd-2.2.0-init.d.diff (cpufreqd-2.2.0-init.d.diff,871 bytes, patch)
2006-10-20 12:53 UTC, Christian Heim (RETIRED)
Details | Diff
cpufreqd-2.2.0-init.d.patch (cpufreqd-2.2.0-init.d.patch,881 bytes, patch)
2006-10-23 04:28 UTC, Piotr Jaroszyński (RETIRED)
Details | Diff
cpufreqd-2.2.0-init.d.patch (cpufreqd-2.2.0-init.d.patch,1.73 KB, patch)
2006-10-23 05:47 UTC, Piotr Jaroszyński (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Franke 2006-10-20 01:46:17 UTC
The file
#$Header: /var/cvsroot/gentoo-x86/sys-power/cpufreqd/files/cpufreqd-2.0.0-init.
d,v 1.3 2006/05/11 20:48:39 brix Exp $

looks for "/sys/devices/system/cpu/cpu0/cpufreq" to determine whether cpu frequency scaling is available in the kernel. If that specific file is not found, the error states: "cpufreqd requires the kernel to be configured with CONFIG_CPU_FREQ".

This is only half the truth. When I encountered this, I had

$> zcat /proc/config.gz | grep CONFIG_CPU_FREQ
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_TABLE=m
# CONFIG_CPU_FREQ_DEBUG is not set
CONFIG_CPU_FREQ_STAT=m
# CONFIG_CPU_FREQ_STAT_DETAILS is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
# CONFIG_CPU_FREQ_GOV_PERFORMANCE is not set
CONFIG_CPU_FREQ_GOV_POWERSAVE=m
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=m
# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set

on my P4 system, but

$> zcat /proc/config.gz | grep P4
# CONFIG_X86_P4_CLOCKMOD is not set

(CONFIG_X86_P4_CLOCKMOD adds the CPUFreq driver for Intel Pentium 4 / XEON processors.)

Without CONFIG_X86_P4_CLOCKMOD the directory "/sys/devices/system/cpu/cpu0/cpufreq/" was not available. When I set "CONFIG_X86_P4_CLOCKMOD=m" and loaded the module, the cpufreq files appeared.

Therefore, I would suggest something like this:
"cpufreqd requires the kernel to be configured with frequency scaling enabled (CONFIG_CPU_FREQ). Make sure that the appropiate drivers for your CPU are available."

In addition: the test should be made for all available CPUs, not only CPU0,
Comment 1 Christian Heim (RETIRED) gentoo-dev 2006-10-20 12:51:51 UTC
(In reply to comment #0)
> The file
> #$Header: /var/cvsroot/gentoo-x86/sys-power/cpufreqd/files/cpufreqd-2.0.0-init.
> d,v 1.3 2006/05/11 20:48:39 brix Exp $
> 
> looks for "/sys/devices/system/cpu/cpu0/cpufreq" to determine whether cpu
> frequency scaling is available in the kernel. If that specific file is not
> found, the error states: "cpufreqd requires the kernel to be configured with
> CONFIG_CPU_FREQ".
> 
> This is only half the truth. When I encountered this, I had
> 
> $> zcat /proc/config.gz | grep CONFIG_CPU_FREQ
> CONFIG_CPU_FREQ=y
> CONFIG_CPU_FREQ_TABLE=m
> # CONFIG_CPU_FREQ_DEBUG is not set
> CONFIG_CPU_FREQ_STAT=m
> # CONFIG_CPU_FREQ_STAT_DETAILS is not set
> # CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
> CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
> # CONFIG_CPU_FREQ_GOV_PERFORMANCE is not set
> CONFIG_CPU_FREQ_GOV_POWERSAVE=m
> CONFIG_CPU_FREQ_GOV_USERSPACE=y
> CONFIG_CPU_FREQ_GOV_ONDEMAND=m
> # CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
> 
> on my P4 system, but
> 
> $> zcat /proc/config.gz | grep P4
> # CONFIG_X86_P4_CLOCKMOD is not set
> 
> (CONFIG_X86_P4_CLOCKMOD adds the CPUFreq driver for Intel Pentium 4 / XEON
> processors.)
> 
> Without CONFIG_X86_P4_CLOCKMOD the directory
> "/sys/devices/system/cpu/cpu0/cpufreq/" was not available. When I set
> "CONFIG_X86_P4_CLOCKMOD=m" and loaded the module, the cpufreq files appeared.
> 
> Therefore, I would suggest something like this:
> "cpufreqd requires the kernel to be configured with frequency scaling enabled
> (CONFIG_CPU_FREQ). Make sure that the appropiate drivers for your CPU are
> available."

OK, corrected the warning.
Comment 2 Christian Heim (RETIRED) gentoo-dev 2006-10-20 12:53:26 UTC
Created attachment 100103 [details, diff]
cpufreqd-2.2.0-init.d.diff

(In reply to comment #0)
> In addition: the test should be made for all available CPUs, not only CPU0,

Could you please try out the attached diff against the init-script, if that works for multiple CPU's ?
Comment 3 Piotr Jaroszyński (RETIRED) gentoo-dev 2006-10-23 04:28:02 UTC
Created attachment 100262 [details, diff]
cpufreqd-2.2.0-init.d.patch

I think that cpufreqd should be started if at least one of the cpus has freq scaling support. See the patch.

btw sorry for fixing the typo w/o noticing.
Comment 4 Daniel Franke 2006-10-23 04:52:36 UTC
A related question: the patch in comment #3 will only work if /sys/.../cpufreq is available, i.e. if and only if the appropriate modules are loaded. Specific to my configuration, these are p4-clockmod and cpufreq_ondemand. How or where is one supposed to add those module names to get cpufreqd working at all?
Comment 5 Piotr Jaroszyński (RETIRED) gentoo-dev 2006-10-23 05:47:55 UTC
Created attachment 100269 [details, diff]
cpufreqd-2.2.0-init.d.patch

More concise version.
Comment 6 Piotr Jaroszyński (RETIRED) gentoo-dev 2006-10-24 05:43:06 UTC
Added new init script to the tree.

(In reply to comment #4)
> A related question: the patch in comment #3 will only work if /sys/.../cpufreq
> is available, i.e. if and only if the appropriate modules are loaded. Specific
> to my configuration, these are p4-clockmod and cpufreq_ondemand. How or where
> is one supposed to add those module names to get cpufreqd working at all?
Add them to /etc/modules.autoload.d/kernel-2.6

Comment 7 Ákos Maróy 2008-03-14 14:06:09 UTC
for me on a Core Duo 2 system, I needed to enable CONFIG_X86_ACPI_CPUFREQ to make this work..
Comment 8 Daniel Drake (RETIRED) gentoo-dev 2008-03-14 17:41:19 UTC
*** Bug 213342 has been marked as a duplicate of this bug. ***