[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YkBlOcdjOECMkHmP@amd.com>
Date: Sun, 27 Mar 2022 21:23:05 +0800
From: Huang Rui <ray.huang@....com>
To: "Limonciello, Mario" <Mario.Limonciello@....com>
Cc: "Rafael J . Wysocki" <rafael@...nel.org>,
Viresh Kumar <viresh.kumar@...aro.org>,
"open list:AMD PSTATE DRIVER" <linux-pm@...r.kernel.org>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/3] cpufreq: Allow passing NULL as the argument for
unregistering a driver
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@....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
Powered by blists - more mailing lists