linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Huang Rui <ray.huang@amd.com>
To: "Limonciello, Mario" <Mario.Limonciello@amd.com>
Cc: "Rafael J . Wysocki" <rafael@kernel.org>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	"open list:AMD PSTATE DRIVER" <linux-pm@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/3] cpufreq: Allow passing NULL as the argument for unregistering a driver
Date: Sun, 27 Mar 2022 21:23:05 +0800	[thread overview]
Message-ID: <YkBlOcdjOECMkHmP@amd.com> (raw)
In-Reply-To: <20220325054228.5247-2-mario.limonciello@amd.com>

On Fri, Mar 25, 2022 at 01:42:26PM +0800, Limonciello, Mario wrote:
> Currently the arguments passed to `cpufreq_unregister_driver` are matched
> against the currently registered driver.
> 
> This means that the only way for a driver to be unregistered is if it's
> module is unloaded.  Loosen that restriction to allow other kernel modules
> to unregister a registered driver.
> 
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> ---
>  drivers/cpufreq/cpufreq.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index 80f535cc8a75..4711c17a89bb 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -2885,10 +2885,10 @@ int cpufreq_unregister_driver(struct cpufreq_driver *driver)
>  {
>  	unsigned long flags;
>  
> -	if (!cpufreq_driver || (driver != cpufreq_driver))
> +	if (!cpufreq_driver)
>  		return -EINVAL;
>  
> -	pr_debug("unregistering driver %s\n", driver->name);
> +	pr_debug("unregistering driver %s\n", cpufreq_driver->name);
>  

This is amd-pstate only use case, I suggest we only modify the amd-pstate
driver, and don't impact generic cpufreq. Actually, only acpi-cpufreq could
be registered earlier than amd-pstate. So how about exposing the
acpi_cpufreq_exit(), and call this to free the acpi_cpufreq_driver in
amd-pstate directly?

Thanks,
Ray

  reply	other threads:[~2022-03-27 13:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-25  5:42 [PATCH 0/3] Improve usability for amd-pstate Mario Limonciello
2022-03-25  5:42 ` [PATCH 1/3] cpufreq: Allow passing NULL as the argument for unregistering a driver Mario Limonciello
2022-03-27 13:23   ` Huang Rui [this message]
2022-03-25  5:42 ` [PATCH 2/3] cpufreq: amd-pstate: Allow replacing existing cpufreq drivers when loaded Mario Limonciello
2022-03-25  5:42 ` [PATCH 3/3] cpufreq: amd-pstate: Add a module device table Mario Limonciello
2022-03-27 13:27   ` Huang Rui
2022-03-27 11:56 ` [PATCH 0/3] Improve usability for amd-pstate Huang Rui
2022-03-28 22:14   ` Limonciello, Mario

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=YkBlOcdjOECMkHmP@amd.com \
    --to=ray.huang@amd.com \
    --cc=Mario.Limonciello@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).