All of lore.kernel.org
 help / color / mirror / Atom feed
From: Quentin Perret <qperret@google.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Rafael Wysocki <rjw@rjwysocki.net>,
	Jonathan Corbet <corbet@lwn.net>,
	linux-pm@vger.kernel.org,
	Vincent Guittot <vincent.guittot@linaro.org>,
	kernel-team@android.com, tkjos@google.com,
	adharmap@codeaurora.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH V4 3/3] cpufreq: Specify default governor on command line
Date: Mon, 29 Jun 2020 10:44:52 +0100	[thread overview]
Message-ID: <20200629094452.GB1228312@google.com> (raw)
In-Reply-To: <96b6e6ca02b664194ff3e57e1ec768fbc597bf38.1593418662.git.viresh.kumar@linaro.org>

On Monday 29 Jun 2020 at 13:55:00 (+0530), Viresh Kumar wrote:
>  static int __init cpufreq_core_init(void)
>  {
> +	struct cpufreq_governor *gov = cpufreq_default_governor();
> +
>  	if (cpufreq_disabled())
>  		return -ENODEV;
>  
>  	cpufreq_global_kobject = kobject_create_and_add("cpufreq", &cpu_subsys.dev_root->kobj);
>  	BUG_ON(!cpufreq_global_kobject);
>  
> +	if (!strlen(default_governor))

Should we test '!strlen(default_governor) && gov' here actually?
We check the return value of cpufreq_default_governor() in
cpufreq_init_policy(), so I'm guessing we should do the same here to be
on the safe side.

> +		strncpy(default_governor, gov->name, CPUFREQ_NAME_LEN);
> +
>  	return 0;
>  }
>  module_param(off, int, 0444);
> +module_param_string(default_governor, default_governor, CPUFREQ_NAME_LEN, 0444);
>  core_initcall(cpufreq_core_init);
> -- 
> 2.25.0.rc1.19.g042ed3e048af


Other than that, the whole series looks good to me.

Thanks,
Quentin

  reply	other threads:[~2020-06-29 20:46 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-29  8:24 [PATCH V4 0/3] cpufreq: Allow default governor on cmdline and fix locking issues Viresh Kumar
2020-06-29  8:24 ` Viresh Kumar
2020-06-29  8:24 ` [PATCH V4 1/3] cpufreq: Fix locking issues with governors Viresh Kumar
2020-06-29  9:37   ` Quentin Perret
2020-06-29  8:24 ` [PATCH V4 2/3] cpufreq: Register governors at core_initcall Viresh Kumar
2020-06-29  8:24   ` Viresh Kumar
2020-06-29  8:25 ` [PATCH V4 3/3] cpufreq: Specify default governor on command line Viresh Kumar
2020-06-29  9:44   ` Quentin Perret [this message]
2020-06-29  9:46     ` Viresh Kumar
2020-06-29  9:48       ` Quentin Perret
2020-06-29  9:49         ` Viresh Kumar
2020-06-29  9:50         ` Quentin Perret
2020-06-29  9:54           ` Viresh Kumar
2020-06-29  9:55             ` Quentin Perret
2020-06-30 18:38 ` [PATCH V4 0/3] cpufreq: Allow default governor on cmdline and fix locking issues Rafael J. Wysocki
2020-06-30 18:38   ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200629094452.GB1228312@google.com \
    --to=qperret@google.com \
    --cc=adharmap@codeaurora.org \
    --cc=corbet@lwn.net \
    --cc=kernel-team@android.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=tkjos@google.com \
    --cc=vincent.guittot@linaro.org \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.