linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] cpufreq: Remove ready() callback
@ 2021-09-01  9:11 Viresh Kumar
  2021-09-01  9:11 ` [PATCH 1/3] cpufreq: acpi: Remove acpi_cpufreq_cpu_ready() Viresh Kumar
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Viresh Kumar @ 2021-09-01  9:11 UTC (permalink / raw)
  To: Rafael Wysocki, Alex Shi, Jonathan Corbet, Viresh Kumar
  Cc: linux-pm, Vincent Guittot, linux-doc, linux-kernel

Remove the last few users of the ready() callback and get rid of it.

Viresh Kumar (3):
  cpufreq: acpi: Remove acpi_cpufreq_cpu_ready()
  cpufreq: sh: Remove sh_cpufreq_cpu_ready()
  cpufreq: Remove ready() callback

 Documentation/cpu-freq/cpu-drivers.rst             |  3 ---
 .../translations/zh_CN/cpu-freq/cpu-drivers.rst    |  2 --
 drivers/cpufreq/acpi-cpufreq.c                     | 14 +++-----------
 drivers/cpufreq/cpufreq.c                          |  4 ----
 drivers/cpufreq/sh-cpufreq.c                       | 11 -----------
 include/linux/cpufreq.h                            |  3 ---
 6 files changed, 3 insertions(+), 34 deletions(-)

-- 
2.31.1.272.g89b43f80a514


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/3] cpufreq: acpi: Remove acpi_cpufreq_cpu_ready()
  2021-09-01  9:11 [PATCH 0/3] cpufreq: Remove ready() callback Viresh Kumar
@ 2021-09-01  9:11 ` Viresh Kumar
  2021-09-01  9:11 ` [PATCH 2/3] cpufreq: sh: Remove sh_cpufreq_cpu_ready() Viresh Kumar
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Viresh Kumar @ 2021-09-01  9:11 UTC (permalink / raw)
  To: Rafael Wysocki, Viresh Kumar; +Cc: linux-pm, Vincent Guittot, linux-kernel

The ready() callback was implemented earlier for acpi-cpufreq driver as
we wanted to use policy->cpuinfo.max_freq for which the policy was
required to be verified.

That is no longer the case and we can do the pr_warn() right from
->init() callback now. Remove acpi_cpufreq_cpu_ready().

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/acpi-cpufreq.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c
index b49612895c78..28467d83c745 100644
--- a/drivers/cpufreq/acpi-cpufreq.c
+++ b/drivers/cpufreq/acpi-cpufreq.c
@@ -889,6 +889,9 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
 	policy->fast_switch_possible = !acpi_pstate_strict &&
 		!(policy_is_shared(policy) && policy->shared_type != CPUFREQ_SHARED_TYPE_ANY);
 
+	if (perf->states[0].core_frequency * 1000 != freq_table[0].frequency)
+		pr_warn(FW_WARN "P-state 0 is not max freq\n");
+
 	return result;
 
 err_unreg:
@@ -918,16 +921,6 @@ static int acpi_cpufreq_cpu_exit(struct cpufreq_policy *policy)
 	return 0;
 }
 
-static void acpi_cpufreq_cpu_ready(struct cpufreq_policy *policy)
-{
-	struct acpi_processor_performance *perf = per_cpu_ptr(acpi_perf_data,
-							      policy->cpu);
-	unsigned int freq = policy->freq_table[0].frequency;
-
-	if (perf->states[0].core_frequency * 1000 != freq)
-		pr_warn(FW_WARN "P-state 0 is not max freq\n");
-}
-
 static int acpi_cpufreq_resume(struct cpufreq_policy *policy)
 {
 	struct acpi_cpufreq_data *data = policy->driver_data;
@@ -955,7 +948,6 @@ static struct cpufreq_driver acpi_cpufreq_driver = {
 	.bios_limit	= acpi_processor_get_bios_limit,
 	.init		= acpi_cpufreq_cpu_init,
 	.exit		= acpi_cpufreq_cpu_exit,
-	.ready		= acpi_cpufreq_cpu_ready,
 	.resume		= acpi_cpufreq_resume,
 	.name		= "acpi-cpufreq",
 	.attr		= acpi_cpufreq_attr,
-- 
2.31.1.272.g89b43f80a514


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/3] cpufreq: sh: Remove sh_cpufreq_cpu_ready()
  2021-09-01  9:11 [PATCH 0/3] cpufreq: Remove ready() callback Viresh Kumar
  2021-09-01  9:11 ` [PATCH 1/3] cpufreq: acpi: Remove acpi_cpufreq_cpu_ready() Viresh Kumar
@ 2021-09-01  9:11 ` Viresh Kumar
  2021-09-01  9:11 ` [PATCH 3/3] cpufreq: Remove ready() callback Viresh Kumar
  2021-09-02 16:06 ` [PATCH 0/3] " Rafael J. Wysocki
  3 siblings, 0 replies; 5+ messages in thread
From: Viresh Kumar @ 2021-09-01  9:11 UTC (permalink / raw)
  To: Rafael Wysocki, Viresh Kumar; +Cc: linux-pm, Vincent Guittot, linux-kernel

The ->ready() callback is going away and since we don't do any important
stuff in sh_cpufreq_cpu_ready(), remove it.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/sh-cpufreq.c | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/drivers/cpufreq/sh-cpufreq.c b/drivers/cpufreq/sh-cpufreq.c
index 1a251e635ebd..b8704232c27b 100644
--- a/drivers/cpufreq/sh-cpufreq.c
+++ b/drivers/cpufreq/sh-cpufreq.c
@@ -145,16 +145,6 @@ static int sh_cpufreq_cpu_exit(struct cpufreq_policy *policy)
 	return 0;
 }
 
-static void sh_cpufreq_cpu_ready(struct cpufreq_policy *policy)
-{
-	struct device *dev = get_cpu_device(policy->cpu);
-
-	dev_info(dev, "CPU Frequencies - Minimum %u.%03u MHz, "
-	       "Maximum %u.%03u MHz.\n",
-	       policy->min / 1000, policy->min % 1000,
-	       policy->max / 1000, policy->max % 1000);
-}
-
 static struct cpufreq_driver sh_cpufreq_driver = {
 	.name		= "sh",
 	.flags		= CPUFREQ_NO_AUTO_DYNAMIC_SWITCHING,
@@ -163,7 +153,6 @@ static struct cpufreq_driver sh_cpufreq_driver = {
 	.verify		= sh_cpufreq_verify,
 	.init		= sh_cpufreq_cpu_init,
 	.exit		= sh_cpufreq_cpu_exit,
-	.ready		= sh_cpufreq_cpu_ready,
 	.attr		= cpufreq_generic_attr,
 };
 
-- 
2.31.1.272.g89b43f80a514


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/3] cpufreq: Remove ready() callback
  2021-09-01  9:11 [PATCH 0/3] cpufreq: Remove ready() callback Viresh Kumar
  2021-09-01  9:11 ` [PATCH 1/3] cpufreq: acpi: Remove acpi_cpufreq_cpu_ready() Viresh Kumar
  2021-09-01  9:11 ` [PATCH 2/3] cpufreq: sh: Remove sh_cpufreq_cpu_ready() Viresh Kumar
@ 2021-09-01  9:11 ` Viresh Kumar
  2021-09-02 16:06 ` [PATCH 0/3] " Rafael J. Wysocki
  3 siblings, 0 replies; 5+ messages in thread
From: Viresh Kumar @ 2021-09-01  9:11 UTC (permalink / raw)
  To: Rafael Wysocki, Viresh Kumar, Jonathan Corbet, Alex Shi
  Cc: linux-pm, Vincent Guittot, linux-doc, linux-kernel

This isn't used anymore, get rid of it.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 Documentation/cpu-freq/cpu-drivers.rst                    | 3 ---
 Documentation/translations/zh_CN/cpu-freq/cpu-drivers.rst | 2 --
 drivers/cpufreq/cpufreq.c                                 | 4 ----
 include/linux/cpufreq.h                                   | 3 ---
 4 files changed, 12 deletions(-)

diff --git a/Documentation/cpu-freq/cpu-drivers.rst b/Documentation/cpu-freq/cpu-drivers.rst
index d84ededb66f9..3b32336a7803 100644
--- a/Documentation/cpu-freq/cpu-drivers.rst
+++ b/Documentation/cpu-freq/cpu-drivers.rst
@@ -75,9 +75,6 @@ And optionally
  .resume - A pointer to a per-policy resume function which is called
  with interrupts disabled and _before_ the governor is started again.
 
- .ready - A pointer to a per-policy ready function which is called after
- the policy is fully initialized.
-
  .attr - A pointer to a NULL-terminated list of "struct freq_attr" which
  allow to export values to sysfs.
 
diff --git a/Documentation/translations/zh_CN/cpu-freq/cpu-drivers.rst b/Documentation/translations/zh_CN/cpu-freq/cpu-drivers.rst
index 5ae9cfa2ec55..334f30ae198b 100644
--- a/Documentation/translations/zh_CN/cpu-freq/cpu-drivers.rst
+++ b/Documentation/translations/zh_CN/cpu-freq/cpu-drivers.rst
@@ -80,8 +80,6 @@ 并且可选择
  .resume - 一个指向per-policy恢复函数的指针,该函数在关中断且在调节器再一次开始前被
  调用。
 
- .ready - 一个指向per-policy准备函数的指针,该函数在策略完全初始化之后被调用。
-
  .attr - 一个指向NULL结尾的"struct freq_attr"列表的指针,该函数允许导出值到
  sysfs。
 
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 7d5f170ecad1..5782b15a8caa 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1517,10 +1517,6 @@ static int cpufreq_online(unsigned int cpu)
 
 	kobject_uevent(&policy->kobj, KOBJ_ADD);
 
-	/* Callback for handling stuff after policy is ready */
-	if (cpufreq_driver->ready)
-		cpufreq_driver->ready(policy);
-
 	if (cpufreq_thermal_control_enabled(cpufreq_driver))
 		policy->cdev = of_cpufreq_cooling_register(policy);
 
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index c65a1d7385f8..fe6acc04e5e5 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -367,9 +367,6 @@ struct cpufreq_driver {
 	int		(*suspend)(struct cpufreq_policy *policy);
 	int		(*resume)(struct cpufreq_policy *policy);
 
-	/* Will be called after the driver is fully initialized */
-	void		(*ready)(struct cpufreq_policy *policy);
-
 	struct freq_attr **attr;
 
 	/* platform specific boost support code */
-- 
2.31.1.272.g89b43f80a514


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/3] cpufreq: Remove ready() callback
  2021-09-01  9:11 [PATCH 0/3] cpufreq: Remove ready() callback Viresh Kumar
                   ` (2 preceding siblings ...)
  2021-09-01  9:11 ` [PATCH 3/3] cpufreq: Remove ready() callback Viresh Kumar
@ 2021-09-02 16:06 ` Rafael J. Wysocki
  3 siblings, 0 replies; 5+ messages in thread
From: Rafael J. Wysocki @ 2021-09-02 16:06 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: Rafael Wysocki, Alex Shi, Jonathan Corbet, Linux PM,
	Vincent Guittot, open list:DOCUMENTATION,
	Linux Kernel Mailing List

On Wed, Sep 1, 2021 at 11:12 AM Viresh Kumar <viresh.kumar@linaro.org> wrote:
>
> Remove the last few users of the ready() callback and get rid of it.
>
> Viresh Kumar (3):
>   cpufreq: acpi: Remove acpi_cpufreq_cpu_ready()
>   cpufreq: sh: Remove sh_cpufreq_cpu_ready()
>   cpufreq: Remove ready() callback

All patches in the series applied, thanks!

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-09-02 16:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-01  9:11 [PATCH 0/3] cpufreq: Remove ready() callback Viresh Kumar
2021-09-01  9:11 ` [PATCH 1/3] cpufreq: acpi: Remove acpi_cpufreq_cpu_ready() Viresh Kumar
2021-09-01  9:11 ` [PATCH 2/3] cpufreq: sh: Remove sh_cpufreq_cpu_ready() Viresh Kumar
2021-09-01  9:11 ` [PATCH 3/3] cpufreq: Remove ready() callback Viresh Kumar
2021-09-02 16:06 ` [PATCH 0/3] " Rafael J. Wysocki

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).