Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 485044 - app-laptop/laptop-mode-tools should warn users about CONFIG_CPU_FREQ_GOV_ONDEMAND
Summary: app-laptop/laptop-mode-tools should warn users about CONFIG_CPU_FREQ_GOV_ONDE...
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Alon Bar-Lev (RETIRED)
URL: http://forums.gentoo.org/viewtopic-p-...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-15 20:37 UTC by William John Holden
Modified: 2014-06-07 17:14 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description William John Holden 2013-09-15 20:37:49 UTC
Myself and a few other users have encountered some errors caused by missing CPUFreq Governors. See http://forums.gentoo.org/viewtopic-p-7396612.html#7396612

Linux recommends users disable 'ondemand', but this is the default configuration used in laptop-mode-tools and specified in /etc/laptop-mode/conf.d/cpufreq.conf.

I propose a relatively simple amendment to the ebuild to steer users in the right direction. Detecting whether 'ondemand' is enabled or not in the user's kernel will encourage users to either enable 'ondemand' in their kernels or configure /etc/laptop-mode/conf.d/cpufreq.conf according to the documentation.

Something like this in the pkg_postinst():

        if egrep --quiet '^CONFIG_CPU_FREQ_GOV_ONDEMAND=n$' /usr/src/linux/.config; then
                ewarn "Your kernel does not support CONFIG_CPU_FREQ_GOV_ONDEMAND."
                ewarn "You must configure /etc/laptop-mode/conf.d/cpufreq.conf"
                ewarn "See Configuring CPU frequency management at"
                ewarn "http://www.gentoo.org/doc/en/power-management-guide.xml#doc_chap4"
        fi

Just a thought.

Reproducible: Always

Steps to Reproduce:
1. Disable ondemand in Linux kernel, as recommended in the menuconfig.
2. Install app-laptop/laptop-mode-tools and don't configure it.
3. Starting the service gives very cryptic and preventable errors about "/usr/share/laptop-mode-tools/modules/cpufreq: line 11: echo: write error: Invalid argument".
Actual Results:  
Unless the user configures the laptop-mode-tools service correctly, as recommended in http://www.gentoo.org/doc/en/power-management-guide.xml#doc_chap4, 

Expected Results:  
The service should start running without an error message, or should give a slightly more useful output than what it presently reports.

The user really should read the manual and configure the service before trying to run it, but the way the manual is written the user is more likely to start the service first, see an error message, and start searching for an answer before he proceeds down the page to the solution.
Comment 1 Alon Bar-Lev (RETIRED) gentoo-dev 2013-09-17 18:03:46 UTC
(In reply to William John Holden from comment #0)
> Linux recommends users disable 'ondemand', but this is the default
> configuration used in laptop-mode-tools and specified in
> /etc/laptop-mode/conf.d/cpufreq.conf.

How an operating system can recommend user to do anything?

You mean: "If in doubt, say N."?

There are lots of settings in laptop-mode-tools that requires various of settings in kernel, we cannot check these all.

Maybe the proper way is to send upstream patch to improve error message:

/usr/share/laptop-mode-tools/modules/cpufreq: line 11: echo: write error: Invalid argument

->

/usr/share/laptop-mode-tools/modules/cpufreq: cannot set 'xxx' governor.
Comment 2 Ritesh Raj Sarraf 2013-09-18 06:08:34 UTC
Yes. I posted the same question on the LMT mailing list yesterday.

Do you have an AMD CPU machine? Would you know if its might be different?
Comment 3 Alon Bar-Lev (RETIRED) gentoo-dev 2014-06-07 17:14:57 UTC
this should be handled upstream.