[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen master] cpufreq: allow ordinary boolean options to be passed on the command line
commit acd9bd133c04766b8457f55e072c39f38eec5a43 Author: Jan Beulich <jbeulich@xxxxxxxx> AuthorDate: Fri Nov 6 15:15:32 2015 +0100 Commit: Jan Beulich <jbeulich@xxxxxxxx> CommitDate: Fri Nov 6 15:15:32 2015 +0100 cpufreq: allow ordinary boolean options to be passed on the command line I was quite surprised to find "cpufreq=off" not doing what one would expect it to do. Fix this. Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx> Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> --- docs/misc/xen-command-line.markdown | 5 +++-- xen/drivers/cpufreq/cpufreq.c | 20 +++++++++++++------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown index 416e559..70daa84 100644 --- a/docs/misc/xen-command-line.markdown +++ b/docs/misc/xen-command-line.markdown @@ -391,11 +391,12 @@ If set, force use of the performance counters for oprofile, rather than detectin available support. ### cpufreq -> `= dom0-kernel | none | xen[,[powersave|performance|ondemand|userspace][,<maxfreq>][,[<minfreq>][,[verbose]]]]` +> `= none | {{ <boolean> | xen } [:[powersave|performance|ondemand|userspace][,<maxfreq>][,[<minfreq>][,[verbose]]]]} | dom0-kernel` > Default: `xen` -Indicate where the responsibility for driving power states lies. +Indicate where the responsibility for driving power states lies. Note that the +choice of `dom0-kernel` is deprecated and not supported by all Dom0 kernels. * Default governor policy is ondemand. * `<maxfreq>` and `<minfreq>` are integers which represent max and min processor frequencies diff --git a/xen/drivers/cpufreq/cpufreq.c b/xen/drivers/cpufreq/cpufreq.c index 6e666e4..f19b403 100644 --- a/xen/drivers/cpufreq/cpufreq.c +++ b/xen/drivers/cpufreq/cpufreq.c @@ -64,9 +64,14 @@ enum cpufreq_controller cpufreq_controller = FREQCTL_xen; static void __init setup_cpufreq_option(char *str) { - char *arg; + char *arg = strpbrk(str, ",:"); + int choice; - if ( !strcmp(str, "dom0-kernel") ) + if ( arg ) + *arg++ = '\0'; + choice = parse_bool(str); + + if ( choice < 0 && !strcmp(str, "dom0-kernel") ) { xen_processor_pmbits &= ~XEN_PROCESSOR_PM_PX; cpufreq_controller = FREQCTL_dom0_kernel; @@ -74,19 +79,20 @@ static void __init setup_cpufreq_option(char *str) return; } - if ( !strcmp(str, "none") ) + if ( choice == 0 || !strcmp(str, "none") ) { xen_processor_pmbits &= ~XEN_PROCESSOR_PM_PX; cpufreq_controller = FREQCTL_none; return; } - if ( (arg = strpbrk(str, ",:")) != NULL ) - *arg++ = '\0'; - - if ( !strcmp(str, "xen") ) + if ( choice > 0 || !strcmp(str, "xen") ) + { + xen_processor_pmbits |= XEN_PROCESSOR_PM_PX; + cpufreq_controller = FREQCTL_xen; if ( arg && *arg ) cpufreq_cmdline_parse(arg); + } } custom_param("cpufreq", setup_cpufreq_option); -- generated by git-patchbot for /home/xen/git/xen.git#master _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |