All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/27] cpufreq: Stop validating cpufreq table in drivers
@ 2018-02-26  5:08 ` Viresh Kumar
  0 siblings, 0 replies; 26+ messages in thread
From: Viresh Kumar @ 2018-02-26  5:08 UTC (permalink / raw)
  To: Rafael Wysocki, bcm-kernel-feedback-list-dY08KVG/lbpWk0Htik3J/w,
	Benjamin Herrenschmidt, Brian Norris, Florian Fainelli,
	Gregory Fong, Jonathan Hunter, Krzysztof Kozlowski, Kukjin Kim,
	Markus Mayer, Matthias Brugger, Michael Ellerman, Paul Mackerras,
	Sudeep Holla, Thierry Reding
  Cc: linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA, Vincent Guittot,
	linux-pm-u79uwXL29TY76Z2rM5mHXA, Viresh Kumar,
	linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

Hi,

A patchset [1] sent last week already updated the cpufreq core to start
validating cpufreq table if the policy contains a valid
"policy->freq_table" pointer.

This series updates all such drivers to stop validating the cpufreq
table directly and let only the core handle it.

It depends on the previous series [1] and two cleanup patches [2][3] and
is rebased over 4.16-rc3.

It is already tested by the 0-day testing infrastructure and no issues
were reported.

--
viresh

[1] https://lkml.kernel.org/r/bd8c6133ad0bdd56c936802bcf26878d7cbdb679.1519279148.git.viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org
[2] https://lkml.kernel.org/r/77d470741dab32c2076a35253b9c0c2f0136583b.1519293292.git.viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org
[3] https://lkml.kernel.org/r/6b737a9c285840b4b2036fa51b692ee835664ec8.1519358505.git.viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org

Viresh Kumar (27):
  cpufreq: imx6q: Find max freq from frequency table itself
  cpufreq: Don't validate cpufreq table from cpufreq_generic_init()
  cpufreq: acpi: Don't validate the frequency table twice
  cpufreq: arm_big_little: Don't validate the frequency table twice
  cpufreq: blackfin: Don't validate the frequency table twice
  cpufreq: brcmstb: Don't validate the frequency table twice
  cpufreq: cpufreq-dt: Don't validate the frequency table twice
  cpufreq: e_powersaver: Don't validate the frequency table twice
  cpufreq: elanfreq: Don't validate the frequency table twice
  cpufreq: ia64-acpi: Don't validate the frequency table twice
  cpufreq: longhaul: Don't validate the frequency table twice
  cpufreq: mediatek: Don't validate the frequency table twice
  cpufreq: p4-clockmod: Don't validate the frequency table twice
  cpufreq: powernow: Don't validate the frequency table twice
  cpufreq: powerenv: Don't validate the frequency table twice
  cpufreq: ppc_cbe: Don't validate the frequency table twice
  cpufreq: pxa: Don't validate the frequency table twice
  cpufreq: qoirq: Don't validate the frequency table twice
  cpufreq: s3c24xx: Don't validate the frequency table twice
  cpufreq: sc520: Don't validate the frequency table twice
  cpufreq: scpi: Don't validate the frequency table twice
  cpufreq: sfi: Don't validate the frequency table twice
  cpufreq: sh: Don't validate the frequency table twice
  cpufreq: sparc: Don't validate the frequency table twice
  cpufreq: speedstep: Don't validate the frequency table twice
  cpufreq: tegra186: Don't validate the frequency table twice
  cpufreq: Drop cpufreq_table_validate_and_show()

 Documentation/cpu-freq/core.txt        | 12 +++++-------
 Documentation/cpu-freq/cpu-drivers.txt |  6 ++----
 drivers/cpufreq/acpi-cpufreq.c         | 20 +++++++++++---------
 drivers/cpufreq/arm_big_little.c       |  9 +--------
 drivers/cpufreq/blackfin-cpufreq.c     |  3 ++-
 drivers/cpufreq/brcmstb-avs-cpufreq.c  |  6 +-----
 drivers/cpufreq/cpufreq-dt.c           |  8 +-------
 drivers/cpufreq/cpufreq.c              |  9 +--------
 drivers/cpufreq/e_powersaver.c         |  8 +-------
 drivers/cpufreq/elanfreq.c             |  3 ++-
 drivers/cpufreq/freq_table.c           | 14 --------------
 drivers/cpufreq/ia64-acpi-cpufreq.c    |  7 +------
 drivers/cpufreq/imx6q-cpufreq.c        |  7 ++++---
 drivers/cpufreq/longhaul.c             |  3 ++-
 drivers/cpufreq/mediatek-cpufreq.c     | 11 +----------
 drivers/cpufreq/p4-clockmod.c          |  3 ++-
 drivers/cpufreq/powernow-k6.c          |  3 ++-
 drivers/cpufreq/powernow-k7.c          |  3 ++-
 drivers/cpufreq/powernow-k8.c          | 10 +---------
 drivers/cpufreq/powernv-cpufreq.c      | 11 +++--------
 drivers/cpufreq/ppc_cbe_cpufreq.c      |  5 ++---
 drivers/cpufreq/pxa2xx-cpufreq.c       |  4 ++--
 drivers/cpufreq/pxa3xx-cpufreq.c       |  4 +++-
 drivers/cpufreq/qoriq-cpufreq.c        | 13 ++-----------
 drivers/cpufreq/s3c24xx-cpufreq.c      |  5 +----
 drivers/cpufreq/sc520_freq.c           |  3 ++-
 drivers/cpufreq/scpi-cpufreq.c         | 10 +---------
 drivers/cpufreq/sfi-cpufreq.c          |  3 ++-
 drivers/cpufreq/sh-cpufreq.c           | 22 ++++++++++++----------
 drivers/cpufreq/sparc-us2e-cpufreq.c   |  3 ++-
 drivers/cpufreq/sparc-us3-cpufreq.c    |  3 ++-
 drivers/cpufreq/speedstep-centrino.c   |  4 ++--
 drivers/cpufreq/speedstep-ich.c        |  4 +++-
 drivers/cpufreq/speedstep-smi.c        |  4 +++-
 drivers/cpufreq/tegra186-cpufreq.c     |  2 +-
 include/linux/cpufreq.h                |  2 --
 36 files changed, 85 insertions(+), 162 deletions(-)

-- 
2.15.0.194.g9af6a3dea062

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

* [PATCH 00/27] cpufreq: Stop validating cpufreq table in drivers
@ 2018-02-26  5:08 ` Viresh Kumar
  0 siblings, 0 replies; 26+ messages in thread
From: Viresh Kumar @ 2018-02-26  5:08 UTC (permalink / raw)
  To: Rafael Wysocki, bcm-kernel-feedback-list, Benjamin Herrenschmidt,
	Brian Norris, Florian Fainelli, Gregory Fong, Jonathan Hunter,
	Krzysztof Kozlowski, Kukjin Kim, Markus Mayer, Matthias Brugger,
	Michael Ellerman, Paul Mackerras, Sudeep Holla, Thierry Reding
  Cc: Viresh Kumar, linux-pm, Vincent Guittot, linux-arm-kernel,
	linux-mediatek, linuxppc-dev, linux-samsung-soc, linux-tegra

Hi,

A patchset [1] sent last week already updated the cpufreq core to start
validating cpufreq table if the policy contains a valid
"policy->freq_table" pointer.

This series updates all such drivers to stop validating the cpufreq
table directly and let only the core handle it.

It depends on the previous series [1] and two cleanup patches [2][3] and
is rebased over 4.16-rc3.

It is already tested by the 0-day testing infrastructure and no issues
were reported.

--
viresh

[1] https://lkml.kernel.org/r/bd8c6133ad0bdd56c936802bcf26878d7cbdb679.1519279148.git.viresh.kumar@linaro.org
[2] https://lkml.kernel.org/r/77d470741dab32c2076a35253b9c0c2f0136583b.1519293292.git.viresh.kumar@linaro.org
[3] https://lkml.kernel.org/r/6b737a9c285840b4b2036fa51b692ee835664ec8.1519358505.git.viresh.kumar@linaro.org

Viresh Kumar (27):
  cpufreq: imx6q: Find max freq from frequency table itself
  cpufreq: Don't validate cpufreq table from cpufreq_generic_init()
  cpufreq: acpi: Don't validate the frequency table twice
  cpufreq: arm_big_little: Don't validate the frequency table twice
  cpufreq: blackfin: Don't validate the frequency table twice
  cpufreq: brcmstb: Don't validate the frequency table twice
  cpufreq: cpufreq-dt: Don't validate the frequency table twice
  cpufreq: e_powersaver: Don't validate the frequency table twice
  cpufreq: elanfreq: Don't validate the frequency table twice
  cpufreq: ia64-acpi: Don't validate the frequency table twice
  cpufreq: longhaul: Don't validate the frequency table twice
  cpufreq: mediatek: Don't validate the frequency table twice
  cpufreq: p4-clockmod: Don't validate the frequency table twice
  cpufreq: powernow: Don't validate the frequency table twice
  cpufreq: powerenv: Don't validate the frequency table twice
  cpufreq: ppc_cbe: Don't validate the frequency table twice
  cpufreq: pxa: Don't validate the frequency table twice
  cpufreq: qoirq: Don't validate the frequency table twice
  cpufreq: s3c24xx: Don't validate the frequency table twice
  cpufreq: sc520: Don't validate the frequency table twice
  cpufreq: scpi: Don't validate the frequency table twice
  cpufreq: sfi: Don't validate the frequency table twice
  cpufreq: sh: Don't validate the frequency table twice
  cpufreq: sparc: Don't validate the frequency table twice
  cpufreq: speedstep: Don't validate the frequency table twice
  cpufreq: tegra186: Don't validate the frequency table twice
  cpufreq: Drop cpufreq_table_validate_and_show()

 Documentation/cpu-freq/core.txt        | 12 +++++-------
 Documentation/cpu-freq/cpu-drivers.txt |  6 ++----
 drivers/cpufreq/acpi-cpufreq.c         | 20 +++++++++++---------
 drivers/cpufreq/arm_big_little.c       |  9 +--------
 drivers/cpufreq/blackfin-cpufreq.c     |  3 ++-
 drivers/cpufreq/brcmstb-avs-cpufreq.c  |  6 +-----
 drivers/cpufreq/cpufreq-dt.c           |  8 +-------
 drivers/cpufreq/cpufreq.c              |  9 +--------
 drivers/cpufreq/e_powersaver.c         |  8 +-------
 drivers/cpufreq/elanfreq.c             |  3 ++-
 drivers/cpufreq/freq_table.c           | 14 --------------
 drivers/cpufreq/ia64-acpi-cpufreq.c    |  7 +------
 drivers/cpufreq/imx6q-cpufreq.c        |  7 ++++---
 drivers/cpufreq/longhaul.c             |  3 ++-
 drivers/cpufreq/mediatek-cpufreq.c     | 11 +----------
 drivers/cpufreq/p4-clockmod.c          |  3 ++-
 drivers/cpufreq/powernow-k6.c          |  3 ++-
 drivers/cpufreq/powernow-k7.c          |  3 ++-
 drivers/cpufreq/powernow-k8.c          | 10 +---------
 drivers/cpufreq/powernv-cpufreq.c      | 11 +++--------
 drivers/cpufreq/ppc_cbe_cpufreq.c      |  5 ++---
 drivers/cpufreq/pxa2xx-cpufreq.c       |  4 ++--
 drivers/cpufreq/pxa3xx-cpufreq.c       |  4 +++-
 drivers/cpufreq/qoriq-cpufreq.c        | 13 ++-----------
 drivers/cpufreq/s3c24xx-cpufreq.c      |  5 +----
 drivers/cpufreq/sc520_freq.c           |  3 ++-
 drivers/cpufreq/scpi-cpufreq.c         | 10 +---------
 drivers/cpufreq/sfi-cpufreq.c          |  3 ++-
 drivers/cpufreq/sh-cpufreq.c           | 22 ++++++++++++----------
 drivers/cpufreq/sparc-us2e-cpufreq.c   |  3 ++-
 drivers/cpufreq/sparc-us3-cpufreq.c    |  3 ++-
 drivers/cpufreq/speedstep-centrino.c   |  4 ++--
 drivers/cpufreq/speedstep-ich.c        |  4 +++-
 drivers/cpufreq/speedstep-smi.c        |  4 +++-
 drivers/cpufreq/tegra186-cpufreq.c     |  2 +-
 include/linux/cpufreq.h                |  2 --
 36 files changed, 85 insertions(+), 162 deletions(-)

-- 
2.15.0.194.g9af6a3dea062

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

* [PATCH 00/27] cpufreq: Stop validating cpufreq table in drivers
@ 2018-02-26  5:08 ` Viresh Kumar
  0 siblings, 0 replies; 26+ messages in thread
From: Viresh Kumar @ 2018-02-26  5:08 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

A patchset [1] sent last week already updated the cpufreq core to start
validating cpufreq table if the policy contains a valid
"policy->freq_table" pointer.

This series updates all such drivers to stop validating the cpufreq
table directly and let only the core handle it.

It depends on the previous series [1] and two cleanup patches [2][3] and
is rebased over 4.16-rc3.

It is already tested by the 0-day testing infrastructure and no issues
were reported.

--
viresh

[1] https://lkml.kernel.org/r/bd8c6133ad0bdd56c936802bcf26878d7cbdb679.1519279148.git.viresh.kumar at linaro.org
[2] https://lkml.kernel.org/r/77d470741dab32c2076a35253b9c0c2f0136583b.1519293292.git.viresh.kumar at linaro.org
[3] https://lkml.kernel.org/r/6b737a9c285840b4b2036fa51b692ee835664ec8.1519358505.git.viresh.kumar at linaro.org

Viresh Kumar (27):
  cpufreq: imx6q: Find max freq from frequency table itself
  cpufreq: Don't validate cpufreq table from cpufreq_generic_init()
  cpufreq: acpi: Don't validate the frequency table twice
  cpufreq: arm_big_little: Don't validate the frequency table twice
  cpufreq: blackfin: Don't validate the frequency table twice
  cpufreq: brcmstb: Don't validate the frequency table twice
  cpufreq: cpufreq-dt: Don't validate the frequency table twice
  cpufreq: e_powersaver: Don't validate the frequency table twice
  cpufreq: elanfreq: Don't validate the frequency table twice
  cpufreq: ia64-acpi: Don't validate the frequency table twice
  cpufreq: longhaul: Don't validate the frequency table twice
  cpufreq: mediatek: Don't validate the frequency table twice
  cpufreq: p4-clockmod: Don't validate the frequency table twice
  cpufreq: powernow: Don't validate the frequency table twice
  cpufreq: powerenv: Don't validate the frequency table twice
  cpufreq: ppc_cbe: Don't validate the frequency table twice
  cpufreq: pxa: Don't validate the frequency table twice
  cpufreq: qoirq: Don't validate the frequency table twice
  cpufreq: s3c24xx: Don't validate the frequency table twice
  cpufreq: sc520: Don't validate the frequency table twice
  cpufreq: scpi: Don't validate the frequency table twice
  cpufreq: sfi: Don't validate the frequency table twice
  cpufreq: sh: Don't validate the frequency table twice
  cpufreq: sparc: Don't validate the frequency table twice
  cpufreq: speedstep: Don't validate the frequency table twice
  cpufreq: tegra186: Don't validate the frequency table twice
  cpufreq: Drop cpufreq_table_validate_and_show()

 Documentation/cpu-freq/core.txt        | 12 +++++-------
 Documentation/cpu-freq/cpu-drivers.txt |  6 ++----
 drivers/cpufreq/acpi-cpufreq.c         | 20 +++++++++++---------
 drivers/cpufreq/arm_big_little.c       |  9 +--------
 drivers/cpufreq/blackfin-cpufreq.c     |  3 ++-
 drivers/cpufreq/brcmstb-avs-cpufreq.c  |  6 +-----
 drivers/cpufreq/cpufreq-dt.c           |  8 +-------
 drivers/cpufreq/cpufreq.c              |  9 +--------
 drivers/cpufreq/e_powersaver.c         |  8 +-------
 drivers/cpufreq/elanfreq.c             |  3 ++-
 drivers/cpufreq/freq_table.c           | 14 --------------
 drivers/cpufreq/ia64-acpi-cpufreq.c    |  7 +------
 drivers/cpufreq/imx6q-cpufreq.c        |  7 ++++---
 drivers/cpufreq/longhaul.c             |  3 ++-
 drivers/cpufreq/mediatek-cpufreq.c     | 11 +----------
 drivers/cpufreq/p4-clockmod.c          |  3 ++-
 drivers/cpufreq/powernow-k6.c          |  3 ++-
 drivers/cpufreq/powernow-k7.c          |  3 ++-
 drivers/cpufreq/powernow-k8.c          | 10 +---------
 drivers/cpufreq/powernv-cpufreq.c      | 11 +++--------
 drivers/cpufreq/ppc_cbe_cpufreq.c      |  5 ++---
 drivers/cpufreq/pxa2xx-cpufreq.c       |  4 ++--
 drivers/cpufreq/pxa3xx-cpufreq.c       |  4 +++-
 drivers/cpufreq/qoriq-cpufreq.c        | 13 ++-----------
 drivers/cpufreq/s3c24xx-cpufreq.c      |  5 +----
 drivers/cpufreq/sc520_freq.c           |  3 ++-
 drivers/cpufreq/scpi-cpufreq.c         | 10 +---------
 drivers/cpufreq/sfi-cpufreq.c          |  3 ++-
 drivers/cpufreq/sh-cpufreq.c           | 22 ++++++++++++----------
 drivers/cpufreq/sparc-us2e-cpufreq.c   |  3 ++-
 drivers/cpufreq/sparc-us3-cpufreq.c    |  3 ++-
 drivers/cpufreq/speedstep-centrino.c   |  4 ++--
 drivers/cpufreq/speedstep-ich.c        |  4 +++-
 drivers/cpufreq/speedstep-smi.c        |  4 +++-
 drivers/cpufreq/tegra186-cpufreq.c     |  2 +-
 include/linux/cpufreq.h                |  2 --
 36 files changed, 85 insertions(+), 162 deletions(-)

-- 
2.15.0.194.g9af6a3dea062

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

* [PATCH 06/27] cpufreq: brcmstb: Don't validate the frequency table twice
  2018-02-26  5:08 ` Viresh Kumar
@ 2018-02-26  5:08   ` Viresh Kumar
  -1 siblings, 0 replies; 26+ messages in thread
From: Viresh Kumar @ 2018-02-26  5:08 UTC (permalink / raw)
  To: Rafael Wysocki, Markus Mayer, bcm-kernel-feedback-list,
	Brian Norris, Gregory Fong, Florian Fainelli
  Cc: Viresh Kumar, Vincent Guittot, linux-arm-kernel, linux-pm

The cpufreq core is already validating the CPU frequency table after
calling the ->init() callback of the cpufreq drivers and the drivers
don't need to do the same anymore. Though they need to set the
policy->freq_table field directly from the ->init() callback now.

Stop validating the frequency table from brcmstb driver.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/brcmstb-avs-cpufreq.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/cpufreq/brcmstb-avs-cpufreq.c b/drivers/cpufreq/brcmstb-avs-cpufreq.c
index 7281a2c19c36..6cdac1aaf23c 100644
--- a/drivers/cpufreq/brcmstb-avs-cpufreq.c
+++ b/drivers/cpufreq/brcmstb-avs-cpufreq.c
@@ -902,11 +902,7 @@ static int brcm_avs_cpufreq_init(struct cpufreq_policy *policy)
 		return ret;
 	}
 
-	ret = cpufreq_table_validate_and_show(policy, freq_table);
-	if (ret) {
-		dev_err(dev, "invalid frequency table: %d\n", ret);
-		return ret;
-	}
+	policy->freq_table = freq_table;
 
 	/* All cores share the same clock and thus the same policy. */
 	cpumask_setall(policy->cpus);
-- 
2.15.0.194.g9af6a3dea062

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

* [PATCH 06/27] cpufreq: brcmstb: Don't validate the frequency table twice
@ 2018-02-26  5:08   ` Viresh Kumar
  0 siblings, 0 replies; 26+ messages in thread
From: Viresh Kumar @ 2018-02-26  5:08 UTC (permalink / raw)
  To: linux-arm-kernel

The cpufreq core is already validating the CPU frequency table after
calling the ->init() callback of the cpufreq drivers and the drivers
don't need to do the same anymore. Though they need to set the
policy->freq_table field directly from the ->init() callback now.

Stop validating the frequency table from brcmstb driver.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/brcmstb-avs-cpufreq.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/cpufreq/brcmstb-avs-cpufreq.c b/drivers/cpufreq/brcmstb-avs-cpufreq.c
index 7281a2c19c36..6cdac1aaf23c 100644
--- a/drivers/cpufreq/brcmstb-avs-cpufreq.c
+++ b/drivers/cpufreq/brcmstb-avs-cpufreq.c
@@ -902,11 +902,7 @@ static int brcm_avs_cpufreq_init(struct cpufreq_policy *policy)
 		return ret;
 	}
 
-	ret = cpufreq_table_validate_and_show(policy, freq_table);
-	if (ret) {
-		dev_err(dev, "invalid frequency table: %d\n", ret);
-		return ret;
-	}
+	policy->freq_table = freq_table;
 
 	/* All cores share the same clock and thus the same policy. */
 	cpumask_setall(policy->cpus);
-- 
2.15.0.194.g9af6a3dea062

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

* [PATCH 12/27] cpufreq: mediatek: Don't validate the frequency table twice
  2018-02-26  5:08 ` Viresh Kumar
@ 2018-02-26  5:08   ` Viresh Kumar
  -1 siblings, 0 replies; 26+ messages in thread
From: Viresh Kumar @ 2018-02-26  5:08 UTC (permalink / raw)
  To: Rafael Wysocki, Matthias Brugger
  Cc: Viresh Kumar, linux-mediatek, Vincent Guittot, linux-arm-kernel,
	linux-pm

The cpufreq core is already validating the CPU frequency table after
calling the ->init() callback of the cpufreq drivers and the drivers
don't need to do the same anymore. Though they need to set the
policy->freq_table field directly from the ->init() callback now.

Stop validating the frequency table from mediatek driver.

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

diff --git a/drivers/cpufreq/mediatek-cpufreq.c b/drivers/cpufreq/mediatek-cpufreq.c
index 84d658d57029..eb8920d39818 100644
--- a/drivers/cpufreq/mediatek-cpufreq.c
+++ b/drivers/cpufreq/mediatek-cpufreq.c
@@ -460,21 +460,12 @@ static int mtk_cpufreq_init(struct cpufreq_policy *policy)
 		return ret;
 	}
 
-	ret = cpufreq_table_validate_and_show(policy, freq_table);
-	if (ret) {
-		pr_err("%s: invalid frequency table: %d\n", __func__, ret);
-		goto out_free_cpufreq_table;
-	}
-
 	cpumask_copy(policy->cpus, &info->cpus);
+	policy->freq_table = freq_table;
 	policy->driver_data = info;
 	policy->clk = info->cpu_clk;
 
 	return 0;
-
-out_free_cpufreq_table:
-	dev_pm_opp_free_cpufreq_table(info->cpu_dev, &freq_table);
-	return ret;
 }
 
 static int mtk_cpufreq_exit(struct cpufreq_policy *policy)
-- 
2.15.0.194.g9af6a3dea062

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

* [PATCH 12/27] cpufreq: mediatek: Don't validate the frequency table twice
@ 2018-02-26  5:08   ` Viresh Kumar
  0 siblings, 0 replies; 26+ messages in thread
From: Viresh Kumar @ 2018-02-26  5:08 UTC (permalink / raw)
  To: linux-arm-kernel

The cpufreq core is already validating the CPU frequency table after
calling the ->init() callback of the cpufreq drivers and the drivers
don't need to do the same anymore. Though they need to set the
policy->freq_table field directly from the ->init() callback now.

Stop validating the frequency table from mediatek driver.

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

diff --git a/drivers/cpufreq/mediatek-cpufreq.c b/drivers/cpufreq/mediatek-cpufreq.c
index 84d658d57029..eb8920d39818 100644
--- a/drivers/cpufreq/mediatek-cpufreq.c
+++ b/drivers/cpufreq/mediatek-cpufreq.c
@@ -460,21 +460,12 @@ static int mtk_cpufreq_init(struct cpufreq_policy *policy)
 		return ret;
 	}
 
-	ret = cpufreq_table_validate_and_show(policy, freq_table);
-	if (ret) {
-		pr_err("%s: invalid frequency table: %d\n", __func__, ret);
-		goto out_free_cpufreq_table;
-	}
-
 	cpumask_copy(policy->cpus, &info->cpus);
+	policy->freq_table = freq_table;
 	policy->driver_data = info;
 	policy->clk = info->cpu_clk;
 
 	return 0;
-
-out_free_cpufreq_table:
-	dev_pm_opp_free_cpufreq_table(info->cpu_dev, &freq_table);
-	return ret;
 }
 
 static int mtk_cpufreq_exit(struct cpufreq_policy *policy)
-- 
2.15.0.194.g9af6a3dea062

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

* [PATCH 15/27] cpufreq: powerenv: Don't validate the frequency table twice
  2018-02-26  5:08 ` Viresh Kumar
@ 2018-02-26  5:08   ` Viresh Kumar
  -1 siblings, 0 replies; 26+ messages in thread
From: Viresh Kumar @ 2018-02-26  5:08 UTC (permalink / raw)
  To: Rafael Wysocki, Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman
  Cc: Viresh Kumar, Vincent Guittot, linuxppc-dev, linux-pm

The cpufreq core is already validating the CPU frequency table after
calling the ->init() callback of the cpufreq drivers and the drivers
don't need to do the same anymore. Though they need to set the
policy->freq_table field directly from the ->init() callback now.

Stop validating the frequency table from powerenv driver.

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

diff --git a/drivers/cpufreq/powernv-cpufreq.c b/drivers/cpufreq/powernv-cpufreq.c
index 29cdec198657..0591874856d3 100644
--- a/drivers/cpufreq/powernv-cpufreq.c
+++ b/drivers/cpufreq/powernv-cpufreq.c
@@ -812,7 +812,7 @@ static int powernv_cpufreq_target_index(struct cpufreq_policy *policy,
 
 static int powernv_cpufreq_cpu_init(struct cpufreq_policy *policy)
 {
-	int base, i, ret;
+	int base, i;
 	struct kernfs_node *kn;
 	struct global_pstate_info *gpstates;
 
@@ -848,15 +848,10 @@ static int powernv_cpufreq_cpu_init(struct cpufreq_policy *policy)
 	gpstates->timer.expires = jiffies +
 				msecs_to_jiffies(GPSTATE_TIMER_INTERVAL);
 	spin_lock_init(&gpstates->gpstate_lock);
-	ret = cpufreq_table_validate_and_show(policy, powernv_freqs);
-
-	if (ret < 0) {
-		kfree(policy->driver_data);
-		return ret;
-	}
 
+	policy->freq_table = powernv_freqs;
 	policy->fast_switch_possible = true;
-	return ret;
+	return 0;
 }
 
 static int powernv_cpufreq_cpu_exit(struct cpufreq_policy *policy)
-- 
2.15.0.194.g9af6a3dea062

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

* [PATCH 15/27] cpufreq: powerenv: Don't validate the frequency table twice
@ 2018-02-26  5:08   ` Viresh Kumar
  0 siblings, 0 replies; 26+ messages in thread
From: Viresh Kumar @ 2018-02-26  5:08 UTC (permalink / raw)
  To: Rafael Wysocki, Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman
  Cc: Viresh Kumar, linux-pm, Vincent Guittot, linuxppc-dev

The cpufreq core is already validating the CPU frequency table after
calling the ->init() callback of the cpufreq drivers and the drivers
don't need to do the same anymore. Though they need to set the
policy->freq_table field directly from the ->init() callback now.

Stop validating the frequency table from powerenv driver.

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

diff --git a/drivers/cpufreq/powernv-cpufreq.c b/drivers/cpufreq/powernv-cpufreq.c
index 29cdec198657..0591874856d3 100644
--- a/drivers/cpufreq/powernv-cpufreq.c
+++ b/drivers/cpufreq/powernv-cpufreq.c
@@ -812,7 +812,7 @@ static int powernv_cpufreq_target_index(struct cpufreq_policy *policy,
 
 static int powernv_cpufreq_cpu_init(struct cpufreq_policy *policy)
 {
-	int base, i, ret;
+	int base, i;
 	struct kernfs_node *kn;
 	struct global_pstate_info *gpstates;
 
@@ -848,15 +848,10 @@ static int powernv_cpufreq_cpu_init(struct cpufreq_policy *policy)
 	gpstates->timer.expires = jiffies +
 				msecs_to_jiffies(GPSTATE_TIMER_INTERVAL);
 	spin_lock_init(&gpstates->gpstate_lock);
-	ret = cpufreq_table_validate_and_show(policy, powernv_freqs);
-
-	if (ret < 0) {
-		kfree(policy->driver_data);
-		return ret;
-	}
 
+	policy->freq_table = powernv_freqs;
 	policy->fast_switch_possible = true;
-	return ret;
+	return 0;
 }
 
 static int powernv_cpufreq_cpu_exit(struct cpufreq_policy *policy)
-- 
2.15.0.194.g9af6a3dea062

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

* [PATCH 19/27] cpufreq: s3c24xx: Don't validate the frequency table twice
  2018-02-26  5:08 ` Viresh Kumar
@ 2018-02-26  5:09   ` Viresh Kumar
  -1 siblings, 0 replies; 26+ messages in thread
From: Viresh Kumar @ 2018-02-26  5:09 UTC (permalink / raw)
  To: Rafael Wysocki, Kukjin Kim, Krzysztof Kozlowski
  Cc: Viresh Kumar, linux-samsung-soc, Vincent Guittot,
	linux-arm-kernel, linux-pm

The cpufreq core is already validating the CPU frequency table after
calling the ->init() callback of the cpufreq drivers and the drivers
don't need to do the same anymore. Though they need to set the
policy->freq_table field directly from the ->init() callback now.

Stop validating the frequency table from s3c24xx driver.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/s3c24xx-cpufreq.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/cpufreq/s3c24xx-cpufreq.c b/drivers/cpufreq/s3c24xx-cpufreq.c
index 6bebc1f9f55a..3f0947e119a9 100644
--- a/drivers/cpufreq/s3c24xx-cpufreq.c
+++ b/drivers/cpufreq/s3c24xx-cpufreq.c
@@ -351,11 +351,8 @@ struct clk *s3c_cpufreq_clk_get(struct device *dev, const char *name)
 static int s3c_cpufreq_init(struct cpufreq_policy *policy)
 {
 	policy->clk = clk_arm;
-
 	policy->cpuinfo.transition_latency = cpu_cur.info->latency;
-
-	if (ftab)
-		return cpufreq_table_validate_and_show(policy, ftab);
+	policy->freq_table = ftab;
 
 	return 0;
 }
-- 
2.15.0.194.g9af6a3dea062

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

* [PATCH 19/27] cpufreq: s3c24xx: Don't validate the frequency table twice
@ 2018-02-26  5:09   ` Viresh Kumar
  0 siblings, 0 replies; 26+ messages in thread
From: Viresh Kumar @ 2018-02-26  5:09 UTC (permalink / raw)
  To: linux-arm-kernel

The cpufreq core is already validating the CPU frequency table after
calling the ->init() callback of the cpufreq drivers and the drivers
don't need to do the same anymore. Though they need to set the
policy->freq_table field directly from the ->init() callback now.

Stop validating the frequency table from s3c24xx driver.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/s3c24xx-cpufreq.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/cpufreq/s3c24xx-cpufreq.c b/drivers/cpufreq/s3c24xx-cpufreq.c
index 6bebc1f9f55a..3f0947e119a9 100644
--- a/drivers/cpufreq/s3c24xx-cpufreq.c
+++ b/drivers/cpufreq/s3c24xx-cpufreq.c
@@ -351,11 +351,8 @@ struct clk *s3c_cpufreq_clk_get(struct device *dev, const char *name)
 static int s3c_cpufreq_init(struct cpufreq_policy *policy)
 {
 	policy->clk = clk_arm;
-
 	policy->cpuinfo.transition_latency = cpu_cur.info->latency;
-
-	if (ftab)
-		return cpufreq_table_validate_and_show(policy, ftab);
+	policy->freq_table = ftab;
 
 	return 0;
 }
-- 
2.15.0.194.g9af6a3dea062

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

* [PATCH 21/27] cpufreq: scpi: Don't validate the frequency table twice
  2018-02-26  5:08 ` Viresh Kumar
@ 2018-02-26  5:09   ` Viresh Kumar
  -1 siblings, 0 replies; 26+ messages in thread
From: Viresh Kumar @ 2018-02-26  5:09 UTC (permalink / raw)
  To: Rafael Wysocki, Sudeep Holla
  Cc: Viresh Kumar, Vincent Guittot, linux-arm-kernel, linux-pm

The cpufreq core is already validating the CPU frequency table after
calling the ->init() callback of the cpufreq drivers and the drivers
don't need to do the same anymore. Though they need to set the
policy->freq_table field directly from the ->init() callback now.

Stop validating the frequency table from scpi driver.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/scpi-cpufreq.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/cpufreq/scpi-cpufreq.c b/drivers/cpufreq/scpi-cpufreq.c
index c32a833e1b00..7b31efe53252 100644
--- a/drivers/cpufreq/scpi-cpufreq.c
+++ b/drivers/cpufreq/scpi-cpufreq.c
@@ -150,13 +150,7 @@ static int scpi_cpufreq_init(struct cpufreq_policy *policy)
 	}
 
 	policy->driver_data = priv;
-
-	ret = cpufreq_table_validate_and_show(policy, freq_table);
-	if (ret) {
-		dev_err(cpu_dev, "%s: invalid frequency table: %d\n", __func__,
-			ret);
-		goto out_put_clk;
-	}
+	policy->freq_table = freq_table;
 
 	/* scpi allows DVFS request for any domain from any CPU */
 	policy->dvfs_possible_from_any_cpu = true;
@@ -170,8 +164,6 @@ static int scpi_cpufreq_init(struct cpufreq_policy *policy)
 	policy->fast_switch_possible = false;
 	return 0;
 
-out_put_clk:
-	clk_put(priv->clk);
 out_free_cpufreq_table:
 	dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table);
 out_free_priv:
-- 
2.15.0.194.g9af6a3dea062

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

* [PATCH 21/27] cpufreq: scpi: Don't validate the frequency table twice
@ 2018-02-26  5:09   ` Viresh Kumar
  0 siblings, 0 replies; 26+ messages in thread
From: Viresh Kumar @ 2018-02-26  5:09 UTC (permalink / raw)
  To: linux-arm-kernel

The cpufreq core is already validating the CPU frequency table after
calling the ->init() callback of the cpufreq drivers and the drivers
don't need to do the same anymore. Though they need to set the
policy->freq_table field directly from the ->init() callback now.

Stop validating the frequency table from scpi driver.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/scpi-cpufreq.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/cpufreq/scpi-cpufreq.c b/drivers/cpufreq/scpi-cpufreq.c
index c32a833e1b00..7b31efe53252 100644
--- a/drivers/cpufreq/scpi-cpufreq.c
+++ b/drivers/cpufreq/scpi-cpufreq.c
@@ -150,13 +150,7 @@ static int scpi_cpufreq_init(struct cpufreq_policy *policy)
 	}
 
 	policy->driver_data = priv;
-
-	ret = cpufreq_table_validate_and_show(policy, freq_table);
-	if (ret) {
-		dev_err(cpu_dev, "%s: invalid frequency table: %d\n", __func__,
-			ret);
-		goto out_put_clk;
-	}
+	policy->freq_table = freq_table;
 
 	/* scpi allows DVFS request for any domain from any CPU */
 	policy->dvfs_possible_from_any_cpu = true;
@@ -170,8 +164,6 @@ static int scpi_cpufreq_init(struct cpufreq_policy *policy)
 	policy->fast_switch_possible = false;
 	return 0;
 
-out_put_clk:
-	clk_put(priv->clk);
 out_free_cpufreq_table:
 	dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table);
 out_free_priv:
-- 
2.15.0.194.g9af6a3dea062

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

* Re: [PATCH 15/27] cpufreq: powerenv: Don't validate the frequency table twice
  2018-02-26  5:08   ` Viresh Kumar
@ 2018-02-26 11:53     ` Michael Ellerman
  -1 siblings, 0 replies; 26+ messages in thread
From: Michael Ellerman @ 2018-02-26 11:53 UTC (permalink / raw)
  To: Rafael Wysocki, Benjamin Herrenschmidt, Paul Mackerras
  Cc: Viresh Kumar, Vincent Guittot, linuxppc-dev, linux-pm

Viresh Kumar <viresh.kumar@linaro.org> writes:
> Subject: Re: [PATCH 15/27] cpufreq: powerenv: Don't validate the frequency table twice
                                           ^
                                      powernv

> The cpufreq core is already validating the CPU frequency table after
> calling the ->init() callback of the cpufreq drivers and the drivers
> don't need to do the same anymore. Though they need to set the
> policy->freq_table field directly from the ->init() callback now.
>
> Stop validating the frequency table from powerenv driver.
>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
>  drivers/cpufreq/powernv-cpufreq.c | 11 +++--------
>  1 file changed, 3 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/cpufreq/powernv-cpufreq.c b/drivers/cpufreq/powernv-cpufreq.c
> index 29cdec198657..0591874856d3 100644
> --- a/drivers/cpufreq/powernv-cpufreq.c
> +++ b/drivers/cpufreq/powernv-cpufreq.c
> @@ -812,7 +812,7 @@ static int powernv_cpufreq_target_index(struct cpufreq_policy *policy,
>  
>  static int powernv_cpufreq_cpu_init(struct cpufreq_policy *policy)
>  {
> -	int base, i, ret;
> +	int base, i;
>  	struct kernfs_node *kn;
>  	struct global_pstate_info *gpstates;

Confusingly this function has two variables called ret, but the other
one is declared inside an if block below in context not shown.

So this hunk is correct.

> @@ -848,15 +848,10 @@ static int powernv_cpufreq_cpu_init(struct cpufreq_policy *policy)
>  	gpstates->timer.expires = jiffies +
>  				msecs_to_jiffies(GPSTATE_TIMER_INTERVAL);
>  	spin_lock_init(&gpstates->gpstate_lock);
> -	ret = cpufreq_table_validate_and_show(policy, powernv_freqs);
> -
> -	if (ret < 0) {
> -		kfree(policy->driver_data);
> -		return ret;
> -	}
>  
> +	policy->freq_table = powernv_freqs;
>  	policy->fast_switch_possible = true;
> -	return ret;
> +	return 0;
>  }

LGTM.

cheers

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

* Re: [PATCH 15/27] cpufreq: powerenv: Don't validate the frequency table twice
@ 2018-02-26 11:53     ` Michael Ellerman
  0 siblings, 0 replies; 26+ messages in thread
From: Michael Ellerman @ 2018-02-26 11:53 UTC (permalink / raw)
  To: Viresh Kumar, Rafael Wysocki, Benjamin Herrenschmidt, Paul Mackerras
  Cc: Viresh Kumar, linux-pm, Vincent Guittot, linuxppc-dev

Viresh Kumar <viresh.kumar@linaro.org> writes:
> Subject: Re: [PATCH 15/27] cpufreq: powerenv: Don't validate the frequency table twice
                                           ^
                                      powernv

> The cpufreq core is already validating the CPU frequency table after
> calling the ->init() callback of the cpufreq drivers and the drivers
> don't need to do the same anymore. Though they need to set the
> policy->freq_table field directly from the ->init() callback now.
>
> Stop validating the frequency table from powerenv driver.
>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
>  drivers/cpufreq/powernv-cpufreq.c | 11 +++--------
>  1 file changed, 3 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/cpufreq/powernv-cpufreq.c b/drivers/cpufreq/powernv-cpufreq.c
> index 29cdec198657..0591874856d3 100644
> --- a/drivers/cpufreq/powernv-cpufreq.c
> +++ b/drivers/cpufreq/powernv-cpufreq.c
> @@ -812,7 +812,7 @@ static int powernv_cpufreq_target_index(struct cpufreq_policy *policy,
>  
>  static int powernv_cpufreq_cpu_init(struct cpufreq_policy *policy)
>  {
> -	int base, i, ret;
> +	int base, i;
>  	struct kernfs_node *kn;
>  	struct global_pstate_info *gpstates;

Confusingly this function has two variables called ret, but the other
one is declared inside an if block below in context not shown.

So this hunk is correct.

> @@ -848,15 +848,10 @@ static int powernv_cpufreq_cpu_init(struct cpufreq_policy *policy)
>  	gpstates->timer.expires = jiffies +
>  				msecs_to_jiffies(GPSTATE_TIMER_INTERVAL);
>  	spin_lock_init(&gpstates->gpstate_lock);
> -	ret = cpufreq_table_validate_and_show(policy, powernv_freqs);
> -
> -	if (ret < 0) {
> -		kfree(policy->driver_data);
> -		return ret;
> -	}
>  
> +	policy->freq_table = powernv_freqs;
>  	policy->fast_switch_possible = true;
> -	return ret;
> +	return 0;
>  }

LGTM.

cheers

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

* Re: [PATCH 15/27] cpufreq: powerenv: Don't validate the frequency table twice
  2018-02-26 11:53     ` Michael Ellerman
@ 2018-02-27  3:45       ` Viresh Kumar
  -1 siblings, 0 replies; 26+ messages in thread
From: Viresh Kumar @ 2018-02-27  3:45 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Vincent Guittot, linux-pm, Rafael Wysocki, Paul Mackerras, linuxppc-dev

On 26-02-18, 22:53, Michael Ellerman wrote:
> Viresh Kumar <viresh.kumar@linaro.org> writes:
> > Subject: Re: [PATCH 15/27] cpufreq: powerenv: Don't validate the frequency table twice
>                                            ^
>                                       powernv
> 
> > The cpufreq core is already validating the CPU frequency table after
> > calling the ->init() callback of the cpufreq drivers and the drivers
> > don't need to do the same anymore. Though they need to set the
> > policy->freq_table field directly from the ->init() callback now.
> >
> > Stop validating the frequency table from powerenv driver.

                                             powernv :)

Will fix both of them.

-- 
viresh

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

* Re: [PATCH 15/27] cpufreq: powerenv: Don't validate the frequency table twice
@ 2018-02-27  3:45       ` Viresh Kumar
  0 siblings, 0 replies; 26+ messages in thread
From: Viresh Kumar @ 2018-02-27  3:45 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Rafael Wysocki, Benjamin Herrenschmidt, Paul Mackerras, linux-pm,
	Vincent Guittot, linuxppc-dev

On 26-02-18, 22:53, Michael Ellerman wrote:
> Viresh Kumar <viresh.kumar@linaro.org> writes:
> > Subject: Re: [PATCH 15/27] cpufreq: powerenv: Don't validate the frequency table twice
>                                            ^
>                                       powernv
> 
> > The cpufreq core is already validating the CPU frequency table after
> > calling the ->init() callback of the cpufreq drivers and the drivers
> > don't need to do the same anymore. Though they need to set the
> > policy->freq_table field directly from the ->init() callback now.
> >
> > Stop validating the frequency table from powerenv driver.

                                             powernv :)

Will fix both of them.

-- 
viresh

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

* Re: [PATCH 15/27] cpufreq: powerenv: Don't validate the frequency table twice
  2018-02-27  3:45       ` Viresh Kumar
@ 2018-02-28 10:45         ` Michael Ellerman
  -1 siblings, 0 replies; 26+ messages in thread
From: Michael Ellerman @ 2018-02-28 10:45 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: Vincent Guittot, linux-pm, Rafael Wysocki, Paul Mackerras, linuxppc-dev

Viresh Kumar <viresh.kumar@linaro.org> writes:

> On 26-02-18, 22:53, Michael Ellerman wrote:
>> Viresh Kumar <viresh.kumar@linaro.org> writes:
>> > Subject: Re: [PATCH 15/27] cpufreq: powerenv: Don't validate the frequency table twice
>>                                            ^
>>                                       powernv
>> 
>> > The cpufreq core is already validating the CPU frequency table after
>> > calling the ->init() callback of the cpufreq drivers and the drivers
>> > don't need to do the same anymore. Though they need to set the
>> > policy->freq_table field directly from the ->init() callback now.
>> >
>> > Stop validating the frequency table from powerenv driver.
>
>                                              powernv :)
>
> Will fix both of them.

Thanks :)

cheers

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

* Re: [PATCH 15/27] cpufreq: powerenv: Don't validate the frequency table twice
@ 2018-02-28 10:45         ` Michael Ellerman
  0 siblings, 0 replies; 26+ messages in thread
From: Michael Ellerman @ 2018-02-28 10:45 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: Rafael Wysocki, Benjamin Herrenschmidt, Paul Mackerras, linux-pm,
	Vincent Guittot, linuxppc-dev

Viresh Kumar <viresh.kumar@linaro.org> writes:

> On 26-02-18, 22:53, Michael Ellerman wrote:
>> Viresh Kumar <viresh.kumar@linaro.org> writes:
>> > Subject: Re: [PATCH 15/27] cpufreq: powerenv: Don't validate the frequency table twice
>>                                            ^
>>                                       powernv
>> 
>> > The cpufreq core is already validating the CPU frequency table after
>> > calling the ->init() callback of the cpufreq drivers and the drivers
>> > don't need to do the same anymore. Though they need to set the
>> > policy->freq_table field directly from the ->init() callback now.
>> >
>> > Stop validating the frequency table from powerenv driver.
>
>                                              powernv :)
>
> Will fix both of them.

Thanks :)

cheers

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

* [PATCH V2 15/27] cpufreq: powernv: Don't validate the frequency table twice
  2018-02-26  5:08   ` Viresh Kumar
@ 2018-03-05  4:19     ` Viresh Kumar
  -1 siblings, 0 replies; 26+ messages in thread
From: Viresh Kumar @ 2018-03-05  4:19 UTC (permalink / raw)
  To: Rafael Wysocki, Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman
  Cc: Viresh Kumar, Vincent Guittot, linuxppc-dev, linux-pm

The cpufreq core is already validating the CPU frequency table after
calling the ->init() callback of the cpufreq drivers and the drivers
don't need to do the same anymore. Though they need to set the
policy->freq_table field directly from the ->init() callback now.

Stop validating the frequency table from powernv driver.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
V1->V2:
- s/powerenv/powernv/

 drivers/cpufreq/powernv-cpufreq.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/cpufreq/powernv-cpufreq.c b/drivers/cpufreq/powernv-cpufreq.c
index 29cdec198657..0591874856d3 100644
--- a/drivers/cpufreq/powernv-cpufreq.c
+++ b/drivers/cpufreq/powernv-cpufreq.c
@@ -812,7 +812,7 @@ static int powernv_cpufreq_target_index(struct cpufreq_policy *policy,
 
 static int powernv_cpufreq_cpu_init(struct cpufreq_policy *policy)
 {
-	int base, i, ret;
+	int base, i;
 	struct kernfs_node *kn;
 	struct global_pstate_info *gpstates;
 
@@ -848,15 +848,10 @@ static int powernv_cpufreq_cpu_init(struct cpufreq_policy *policy)
 	gpstates->timer.expires = jiffies +
 				msecs_to_jiffies(GPSTATE_TIMER_INTERVAL);
 	spin_lock_init(&gpstates->gpstate_lock);
-	ret = cpufreq_table_validate_and_show(policy, powernv_freqs);
-
-	if (ret < 0) {
-		kfree(policy->driver_data);
-		return ret;
-	}
 
+	policy->freq_table = powernv_freqs;
 	policy->fast_switch_possible = true;
-	return ret;
+	return 0;
 }
 
 static int powernv_cpufreq_cpu_exit(struct cpufreq_policy *policy)
-- 
2.15.0.194.g9af6a3dea062

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

* [PATCH V2 15/27] cpufreq: powernv: Don't validate the frequency table twice
@ 2018-03-05  4:19     ` Viresh Kumar
  0 siblings, 0 replies; 26+ messages in thread
From: Viresh Kumar @ 2018-03-05  4:19 UTC (permalink / raw)
  To: Rafael Wysocki, Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman
  Cc: Viresh Kumar, linux-pm, Vincent Guittot, linuxppc-dev

The cpufreq core is already validating the CPU frequency table after
calling the ->init() callback of the cpufreq drivers and the drivers
don't need to do the same anymore. Though they need to set the
policy->freq_table field directly from the ->init() callback now.

Stop validating the frequency table from powernv driver.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
V1->V2:
- s/powerenv/powernv/

 drivers/cpufreq/powernv-cpufreq.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/cpufreq/powernv-cpufreq.c b/drivers/cpufreq/powernv-cpufreq.c
index 29cdec198657..0591874856d3 100644
--- a/drivers/cpufreq/powernv-cpufreq.c
+++ b/drivers/cpufreq/powernv-cpufreq.c
@@ -812,7 +812,7 @@ static int powernv_cpufreq_target_index(struct cpufreq_policy *policy,
 
 static int powernv_cpufreq_cpu_init(struct cpufreq_policy *policy)
 {
-	int base, i, ret;
+	int base, i;
 	struct kernfs_node *kn;
 	struct global_pstate_info *gpstates;
 
@@ -848,15 +848,10 @@ static int powernv_cpufreq_cpu_init(struct cpufreq_policy *policy)
 	gpstates->timer.expires = jiffies +
 				msecs_to_jiffies(GPSTATE_TIMER_INTERVAL);
 	spin_lock_init(&gpstates->gpstate_lock);
-	ret = cpufreq_table_validate_and_show(policy, powernv_freqs);
-
-	if (ret < 0) {
-		kfree(policy->driver_data);
-		return ret;
-	}
 
+	policy->freq_table = powernv_freqs;
 	policy->fast_switch_possible = true;
-	return ret;
+	return 0;
 }
 
 static int powernv_cpufreq_cpu_exit(struct cpufreq_policy *policy)
-- 
2.15.0.194.g9af6a3dea062

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

* Re: [PATCH 00/27] cpufreq: Stop validating cpufreq table in drivers
  2018-02-26  5:08 ` Viresh Kumar
  (?)
@ 2018-03-09 10:00     ` Viresh Kumar
  -1 siblings, 0 replies; 26+ messages in thread
From: Viresh Kumar @ 2018-03-09 10:00 UTC (permalink / raw)
  To: Rafael Wysocki, bcm-kernel-feedback-list-dY08KVG/lbpWk0Htik3J/w,
	Benjamin Herrenschmidt, Brian Norris, Florian Fainelli,
	Gregory Fong, Jonathan Hunter, Krzysztof Kozlowski, Kukjin Kim,
	Markus Mayer, Matthias Brugger, Michael Ellerman, Paul Mackerras,
	Sudeep Holla, Thierry Reding
  Cc: linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA, Vincent Guittot,
	linux-pm-u79uwXL29TY76Z2rM5mHXA,
	linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On 26-02-18, 10:38, Viresh Kumar wrote:
> Hi,
> 
> A patchset [1] sent last week already updated the cpufreq core to start
> validating cpufreq table if the policy contains a valid
> "policy->freq_table" pointer.
> 
> This series updates all such drivers to stop validating the cpufreq
> table directly and let only the core handle it.
> 
> It depends on the previous series [1] and two cleanup patches [2][3] and
> is rebased over 4.16-rc3.
> 
> It is already tested by the 0-day testing infrastructure and no issues
> were reported.

We will assume no objections or concerns if you (cc'd here and on the individual
commits) don't respond and the series will then get merged into linux-next next
week.

Thanks.

--
viresh

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

* Re: [PATCH 00/27] cpufreq: Stop validating cpufreq table in drivers
@ 2018-03-09 10:00     ` Viresh Kumar
  0 siblings, 0 replies; 26+ messages in thread
From: Viresh Kumar @ 2018-03-09 10:00 UTC (permalink / raw)
  To: Rafael Wysocki, bcm-kernel-feedback-list, Benjamin Herrenschmidt,
	Brian Norris, Florian Fainelli, Gregory Fong, Jonathan Hunter,
	Krzysztof Kozlowski, Kukjin Kim, Markus Mayer, Matthias Brugger,
	Michael Ellerman, Paul Mackerras, Sudeep Holla, Thierry Reding
  Cc: linux-pm, Vincent Guittot, linux-arm-kernel, linux-mediatek,
	linuxppc-dev, linux-samsung-soc, linux-tegra

On 26-02-18, 10:38, Viresh Kumar wrote:
> Hi,
> 
> A patchset [1] sent last week already updated the cpufreq core to start
> validating cpufreq table if the policy contains a valid
> "policy->freq_table" pointer.
> 
> This series updates all such drivers to stop validating the cpufreq
> table directly and let only the core handle it.
> 
> It depends on the previous series [1] and two cleanup patches [2][3] and
> is rebased over 4.16-rc3.
> 
> It is already tested by the 0-day testing infrastructure and no issues
> were reported.

We will assume no objections or concerns if you (cc'd here and on the individual
commits) don't respond and the series will then get merged into linux-next next
week.

Thanks.

--
viresh

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

* [PATCH 00/27] cpufreq: Stop validating cpufreq table in drivers
@ 2018-03-09 10:00     ` Viresh Kumar
  0 siblings, 0 replies; 26+ messages in thread
From: Viresh Kumar @ 2018-03-09 10:00 UTC (permalink / raw)
  To: linux-arm-kernel

On 26-02-18, 10:38, Viresh Kumar wrote:
> Hi,
> 
> A patchset [1] sent last week already updated the cpufreq core to start
> validating cpufreq table if the policy contains a valid
> "policy->freq_table" pointer.
> 
> This series updates all such drivers to stop validating the cpufreq
> table directly and let only the core handle it.
> 
> It depends on the previous series [1] and two cleanup patches [2][3] and
> is rebased over 4.16-rc3.
> 
> It is already tested by the 0-day testing infrastructure and no issues
> were reported.

We will assume no objections or concerns if you (cc'd here and on the individual
commits) don't respond and the series will then get merged into linux-next next
week.

Thanks.

--
viresh

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

* Re: [PATCH 21/27] cpufreq: scpi: Don't validate the frequency table twice
  2018-02-26  5:09   ` Viresh Kumar
@ 2018-03-12 12:43     ` Sudeep Holla
  -1 siblings, 0 replies; 26+ messages in thread
From: Sudeep Holla @ 2018-03-12 12:43 UTC (permalink / raw)
  To: Viresh Kumar, Rafael Wysocki
  Cc: linux-pm, Vincent Guittot, linux-arm-kernel, Sudeep Holla



On 26/02/18 05:09, Viresh Kumar wrote:
> The cpufreq core is already validating the CPU frequency table after
> calling the ->init() callback of the cpufreq drivers and the drivers
> don't need to do the same anymore. Though they need to set the
> policy->freq_table field directly from the ->init() callback now.
> 
> Stop validating the frequency table from scpi driver.
> 
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>

FWIW,

Acked-by: Sudeep Holla <sudeep.holla@arm.com>
Tested-by: Sudeep Holla <sudeep.holla@arm.com>

-- 
Regards,
Sudeep

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

* [PATCH 21/27] cpufreq: scpi: Don't validate the frequency table twice
@ 2018-03-12 12:43     ` Sudeep Holla
  0 siblings, 0 replies; 26+ messages in thread
From: Sudeep Holla @ 2018-03-12 12:43 UTC (permalink / raw)
  To: linux-arm-kernel



On 26/02/18 05:09, Viresh Kumar wrote:
> The cpufreq core is already validating the CPU frequency table after
> calling the ->init() callback of the cpufreq drivers and the drivers
> don't need to do the same anymore. Though they need to set the
> policy->freq_table field directly from the ->init() callback now.
> 
> Stop validating the frequency table from scpi driver.
> 
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>

FWIW,

Acked-by: Sudeep Holla <sudeep.holla@arm.com>
Tested-by: Sudeep Holla <sudeep.holla@arm.com>

-- 
Regards,
Sudeep

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

end of thread, other threads:[~2018-03-12 12:43 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-26  5:08 [PATCH 00/27] cpufreq: Stop validating cpufreq table in drivers Viresh Kumar
2018-02-26  5:08 ` Viresh Kumar
2018-02-26  5:08 ` Viresh Kumar
2018-02-26  5:08 ` [PATCH 06/27] cpufreq: brcmstb: Don't validate the frequency table twice Viresh Kumar
2018-02-26  5:08   ` Viresh Kumar
2018-02-26  5:08 ` [PATCH 12/27] cpufreq: mediatek: " Viresh Kumar
2018-02-26  5:08   ` Viresh Kumar
2018-02-26  5:08 ` [PATCH 15/27] cpufreq: powerenv: " Viresh Kumar
2018-02-26  5:08   ` Viresh Kumar
2018-02-26 11:53   ` Michael Ellerman
2018-02-26 11:53     ` Michael Ellerman
2018-02-27  3:45     ` Viresh Kumar
2018-02-27  3:45       ` Viresh Kumar
2018-02-28 10:45       ` Michael Ellerman
2018-02-28 10:45         ` Michael Ellerman
2018-03-05  4:19   ` [PATCH V2 15/27] cpufreq: powernv: " Viresh Kumar
2018-03-05  4:19     ` Viresh Kumar
2018-02-26  5:09 ` [PATCH 19/27] cpufreq: s3c24xx: " Viresh Kumar
2018-02-26  5:09   ` Viresh Kumar
2018-02-26  5:09 ` [PATCH 21/27] cpufreq: scpi: " Viresh Kumar
2018-02-26  5:09   ` Viresh Kumar
2018-03-12 12:43   ` Sudeep Holla
2018-03-12 12:43     ` Sudeep Holla
     [not found] ` <cover.1519620578.git.viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2018-03-09 10:00   ` [PATCH 00/27] cpufreq: Stop validating cpufreq table in drivers Viresh Kumar
2018-03-09 10:00     ` Viresh Kumar
2018-03-09 10:00     ` Viresh Kumar

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.