linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] opp: Allow dev_pm_opp_put_*() APIs to accept NULL opp_table
@ 2020-11-06  7:03 Viresh Kumar
  2020-11-06  7:03 ` [PATCH 3/7] cpufreq: qcom-cpufreq-nvmem: dev_pm_opp_put_*() accepts NULL argument Viresh Kumar
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Viresh Kumar @ 2020-11-06  7:03 UTC (permalink / raw)
  To: Alyssa Rosenzweig, Andy Gross, Bjorn Andersson, Chanwoo Choi,
	Daniel Vetter, David Airlie, Ilia Lin, Krzysztof Kozlowski,
	Kukjin Kim, Kyungmin Park, MyungJoo Ham, Nishanth Menon,
	Qiang Yu, Rafael J. Wysocki, Rob Herring, Stanimir Varbanov,
	Stephen Boyd, Steven Price, Tomeu Vizoso, Viresh Kumar,
	Viresh Kumar
  Cc: linux-pm, Vincent Guittot, digetx, dri-devel, lima,
	linux-arm-kernel, linux-arm-msm, linux-kernel, linux-media,
	linux-samsung-soc

Hello,

This patchset updates the dev_pm_opp_put_*() helpers to accept a NULL
pointer for the OPP table, in order to allow the callers to drop the
unnecessary checks they had to carry.

All these must get merged upstream through the OPP tree as there is a
hard dependency on the first patch here. Thanks.

Viresh Kumar (7):
  opp: Allow dev_pm_opp_put_*() APIs to accept NULL opp_table
  cpufreq: dt: dev_pm_opp_put_regulators() accepts NULL argument
  cpufreq: qcom-cpufreq-nvmem: dev_pm_opp_put_*() accepts NULL argument
  devfreq: exynos: dev_pm_opp_put_*() accepts NULL argument
  drm/lima: dev_pm_opp_put_*() accepts NULL argument
  drm/panfrost: dev_pm_opp_put_*() accepts NULL argument
  media: venus: dev_pm_opp_put_*() accepts NULL argument

 drivers/cpufreq/cpufreq-dt.c                   |  6 ++----
 drivers/cpufreq/qcom-cpufreq-nvmem.c           | 15 ++++++---------
 drivers/devfreq/exynos-bus.c                   | 12 ++++--------
 drivers/gpu/drm/lima/lima_devfreq.c            | 13 ++++---------
 drivers/gpu/drm/panfrost/panfrost_devfreq.c    |  6 ++----
 drivers/media/platform/qcom/venus/pm_helpers.c |  3 +--
 drivers/opp/core.c                             | 18 ++++++++++++++++++
 7 files changed, 37 insertions(+), 36 deletions(-)

-- 
2.25.0.rc1.19.g042ed3e048af


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

* [PATCH 3/7] cpufreq: qcom-cpufreq-nvmem: dev_pm_opp_put_*() accepts NULL argument
  2020-11-06  7:03 [PATCH 0/7] opp: Allow dev_pm_opp_put_*() APIs to accept NULL opp_table Viresh Kumar
@ 2020-11-06  7:03 ` Viresh Kumar
  2020-11-08  9:27   ` Ilia Lin
  2020-11-06  7:03 ` [PATCH 7/7] media: venus: " Viresh Kumar
  2020-11-08  9:25 ` [PATCH 0/7] opp: Allow dev_pm_opp_put_*() APIs to accept NULL opp_table Ilia Lin
  2 siblings, 1 reply; 5+ messages in thread
From: Viresh Kumar @ 2020-11-06  7:03 UTC (permalink / raw)
  To: Ilia Lin, Andy Gross, Bjorn Andersson, Rafael J. Wysocki, Viresh Kumar
  Cc: linux-pm, Vincent Guittot, Stephen Boyd, Nishanth Menon, digetx,
	linux-arm-msm, linux-kernel

The dev_pm_opp_put_*() APIs now accepts a NULL opp_table pointer and so
there is no need for us to carry the extra checks. Drop them.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/qcom-cpufreq-nvmem.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/drivers/cpufreq/qcom-cpufreq-nvmem.c b/drivers/cpufreq/qcom-cpufreq-nvmem.c
index d06b37822c3d..747d602f221e 100644
--- a/drivers/cpufreq/qcom-cpufreq-nvmem.c
+++ b/drivers/cpufreq/qcom-cpufreq-nvmem.c
@@ -397,19 +397,19 @@ static int qcom_cpufreq_probe(struct platform_device *pdev)
 
 free_genpd_opp:
 	for_each_possible_cpu(cpu) {
-		if (IS_ERR_OR_NULL(drv->genpd_opp_tables[cpu]))
+		if (IS_ERR(drv->genpd_opp_tables[cpu]))
 			break;
 		dev_pm_opp_detach_genpd(drv->genpd_opp_tables[cpu]);
 	}
 	kfree(drv->genpd_opp_tables);
 free_opp:
 	for_each_possible_cpu(cpu) {
-		if (IS_ERR_OR_NULL(drv->names_opp_tables[cpu]))
+		if (IS_ERR(drv->names_opp_tables[cpu]))
 			break;
 		dev_pm_opp_put_prop_name(drv->names_opp_tables[cpu]);
 	}
 	for_each_possible_cpu(cpu) {
-		if (IS_ERR_OR_NULL(drv->hw_opp_tables[cpu]))
+		if (IS_ERR(drv->hw_opp_tables[cpu]))
 			break;
 		dev_pm_opp_put_supported_hw(drv->hw_opp_tables[cpu]);
 	}
@@ -430,12 +430,9 @@ static int qcom_cpufreq_remove(struct platform_device *pdev)
 	platform_device_unregister(cpufreq_dt_pdev);
 
 	for_each_possible_cpu(cpu) {
-		if (drv->names_opp_tables[cpu])
-			dev_pm_opp_put_supported_hw(drv->names_opp_tables[cpu]);
-		if (drv->hw_opp_tables[cpu])
-			dev_pm_opp_put_supported_hw(drv->hw_opp_tables[cpu]);
-		if (drv->genpd_opp_tables[cpu])
-			dev_pm_opp_detach_genpd(drv->genpd_opp_tables[cpu]);
+		dev_pm_opp_put_supported_hw(drv->names_opp_tables[cpu]);
+		dev_pm_opp_put_supported_hw(drv->hw_opp_tables[cpu]);
+		dev_pm_opp_detach_genpd(drv->genpd_opp_tables[cpu]);
 	}
 
 	kfree(drv->names_opp_tables);
-- 
2.25.0.rc1.19.g042ed3e048af


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

* [PATCH 7/7] media: venus: dev_pm_opp_put_*() accepts NULL argument
  2020-11-06  7:03 [PATCH 0/7] opp: Allow dev_pm_opp_put_*() APIs to accept NULL opp_table Viresh Kumar
  2020-11-06  7:03 ` [PATCH 3/7] cpufreq: qcom-cpufreq-nvmem: dev_pm_opp_put_*() accepts NULL argument Viresh Kumar
@ 2020-11-06  7:03 ` Viresh Kumar
  2020-11-08  9:25 ` [PATCH 0/7] opp: Allow dev_pm_opp_put_*() APIs to accept NULL opp_table Ilia Lin
  2 siblings, 0 replies; 5+ messages in thread
From: Viresh Kumar @ 2020-11-06  7:03 UTC (permalink / raw)
  To: Stanimir Varbanov, Andy Gross, Bjorn Andersson
  Cc: Viresh Kumar, linux-pm, Vincent Guittot, Rafael Wysocki,
	Stephen Boyd, Nishanth Menon, digetx, linux-media, linux-arm-msm,
	linux-kernel

The dev_pm_opp_put_*() APIs now accepts a NULL opp_table pointer and so
there is no need for us to carry the extra check. Drop them.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/media/platform/qcom/venus/pm_helpers.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c
index 57877eacecf0..e1e9130288ad 100644
--- a/drivers/media/platform/qcom/venus/pm_helpers.c
+++ b/drivers/media/platform/qcom/venus/pm_helpers.c
@@ -898,8 +898,7 @@ static void core_put_v4(struct device *dev)
 
 	if (core->has_opp_table)
 		dev_pm_opp_of_remove_table(dev);
-	if (core->opp_table)
-		dev_pm_opp_put_clkname(core->opp_table);
+	dev_pm_opp_put_clkname(core->opp_table);
 
 }
 
-- 
2.25.0.rc1.19.g042ed3e048af


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

* Re: [PATCH 0/7] opp: Allow dev_pm_opp_put_*() APIs to accept NULL opp_table
  2020-11-06  7:03 [PATCH 0/7] opp: Allow dev_pm_opp_put_*() APIs to accept NULL opp_table Viresh Kumar
  2020-11-06  7:03 ` [PATCH 3/7] cpufreq: qcom-cpufreq-nvmem: dev_pm_opp_put_*() accepts NULL argument Viresh Kumar
  2020-11-06  7:03 ` [PATCH 7/7] media: venus: " Viresh Kumar
@ 2020-11-08  9:25 ` Ilia Lin
  2 siblings, 0 replies; 5+ messages in thread
From: Ilia Lin @ 2020-11-08  9:25 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: Alyssa Rosenzweig, Andy Gross, Bjorn Andersson, Chanwoo Choi,
	Daniel Vetter, David Airlie, Ilia Lin, Krzysztof Kozlowski,
	Kukjin Kim, Kyungmin Park, MyungJoo Ham, Nishanth Menon,
	Qiang Yu, Rafael J. Wysocki, Rob Herring, Stanimir Varbanov,
	Stephen Boyd, Steven Price, Tomeu Vizoso, Viresh Kumar,
	open list:QUALCOMM CPUFREQ DRIVER MSM8996/APQ8096,
	Vincent Guittot, digetx, dri-devel, lima, linux-arm-kernel,
	open list:ARM/QUALCOMM SUPPORT, open list, linux-media,
	linux-samsung-soc

Reviewed-by: Ilia Lin <ilia.lin@kernel.org>


On Fri, Nov 6, 2020 at 9:05 AM Viresh Kumar <viresh.kumar@linaro.org> wrote:
>
> Hello,
>
> This patchset updates the dev_pm_opp_put_*() helpers to accept a NULL
> pointer for the OPP table, in order to allow the callers to drop the
> unnecessary checks they had to carry.
>
> All these must get merged upstream through the OPP tree as there is a
> hard dependency on the first patch here. Thanks.
>
> Viresh Kumar (7):
>   opp: Allow dev_pm_opp_put_*() APIs to accept NULL opp_table
>   cpufreq: dt: dev_pm_opp_put_regulators() accepts NULL argument
>   cpufreq: qcom-cpufreq-nvmem: dev_pm_opp_put_*() accepts NULL argument
>   devfreq: exynos: dev_pm_opp_put_*() accepts NULL argument
>   drm/lima: dev_pm_opp_put_*() accepts NULL argument
>   drm/panfrost: dev_pm_opp_put_*() accepts NULL argument
>   media: venus: dev_pm_opp_put_*() accepts NULL argument
>
>  drivers/cpufreq/cpufreq-dt.c                   |  6 ++----
>  drivers/cpufreq/qcom-cpufreq-nvmem.c           | 15 ++++++---------
>  drivers/devfreq/exynos-bus.c                   | 12 ++++--------
>  drivers/gpu/drm/lima/lima_devfreq.c            | 13 ++++---------
>  drivers/gpu/drm/panfrost/panfrost_devfreq.c    |  6 ++----
>  drivers/media/platform/qcom/venus/pm_helpers.c |  3 +--
>  drivers/opp/core.c                             | 18 ++++++++++++++++++
>  7 files changed, 37 insertions(+), 36 deletions(-)
>
> --
> 2.25.0.rc1.19.g042ed3e048af
>

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

* Re: [PATCH 3/7] cpufreq: qcom-cpufreq-nvmem: dev_pm_opp_put_*() accepts NULL argument
  2020-11-06  7:03 ` [PATCH 3/7] cpufreq: qcom-cpufreq-nvmem: dev_pm_opp_put_*() accepts NULL argument Viresh Kumar
@ 2020-11-08  9:27   ` Ilia Lin
  0 siblings, 0 replies; 5+ messages in thread
From: Ilia Lin @ 2020-11-08  9:27 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: Ilia Lin, Andy Gross, Bjorn Andersson, Rafael J. Wysocki,
	open list:QUALCOMM CPUFREQ DRIVER MSM8996/APQ8096,
	Vincent Guittot, Stephen Boyd, Nishanth Menon, digetx,
	open list:ARM/QUALCOMM SUPPORT, open list

Reviewed-by: Ilia Lin <ilia.lin@kernel.org>

On Fri, Nov 6, 2020 at 9:05 AM Viresh Kumar <viresh.kumar@linaro.org> wrote:
>
> The dev_pm_opp_put_*() APIs now accepts a NULL opp_table pointer and so
> there is no need for us to carry the extra checks. Drop them.
>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
>  drivers/cpufreq/qcom-cpufreq-nvmem.c | 15 ++++++---------
>  1 file changed, 6 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/cpufreq/qcom-cpufreq-nvmem.c b/drivers/cpufreq/qcom-cpufreq-nvmem.c
> index d06b37822c3d..747d602f221e 100644
> --- a/drivers/cpufreq/qcom-cpufreq-nvmem.c
> +++ b/drivers/cpufreq/qcom-cpufreq-nvmem.c
> @@ -397,19 +397,19 @@ static int qcom_cpufreq_probe(struct platform_device *pdev)
>
>  free_genpd_opp:
>         for_each_possible_cpu(cpu) {
> -               if (IS_ERR_OR_NULL(drv->genpd_opp_tables[cpu]))
> +               if (IS_ERR(drv->genpd_opp_tables[cpu]))
>                         break;
>                 dev_pm_opp_detach_genpd(drv->genpd_opp_tables[cpu]);
>         }
>         kfree(drv->genpd_opp_tables);
>  free_opp:
>         for_each_possible_cpu(cpu) {
> -               if (IS_ERR_OR_NULL(drv->names_opp_tables[cpu]))
> +               if (IS_ERR(drv->names_opp_tables[cpu]))
>                         break;
>                 dev_pm_opp_put_prop_name(drv->names_opp_tables[cpu]);
>         }
>         for_each_possible_cpu(cpu) {
> -               if (IS_ERR_OR_NULL(drv->hw_opp_tables[cpu]))
> +               if (IS_ERR(drv->hw_opp_tables[cpu]))
>                         break;
>                 dev_pm_opp_put_supported_hw(drv->hw_opp_tables[cpu]);
>         }
> @@ -430,12 +430,9 @@ static int qcom_cpufreq_remove(struct platform_device *pdev)
>         platform_device_unregister(cpufreq_dt_pdev);
>
>         for_each_possible_cpu(cpu) {
> -               if (drv->names_opp_tables[cpu])
> -                       dev_pm_opp_put_supported_hw(drv->names_opp_tables[cpu]);
> -               if (drv->hw_opp_tables[cpu])
> -                       dev_pm_opp_put_supported_hw(drv->hw_opp_tables[cpu]);
> -               if (drv->genpd_opp_tables[cpu])
> -                       dev_pm_opp_detach_genpd(drv->genpd_opp_tables[cpu]);
> +               dev_pm_opp_put_supported_hw(drv->names_opp_tables[cpu]);
> +               dev_pm_opp_put_supported_hw(drv->hw_opp_tables[cpu]);
> +               dev_pm_opp_detach_genpd(drv->genpd_opp_tables[cpu]);
>         }
>
>         kfree(drv->names_opp_tables);
> --
> 2.25.0.rc1.19.g042ed3e048af
>

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

end of thread, other threads:[~2020-11-08  9:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-06  7:03 [PATCH 0/7] opp: Allow dev_pm_opp_put_*() APIs to accept NULL opp_table Viresh Kumar
2020-11-06  7:03 ` [PATCH 3/7] cpufreq: qcom-cpufreq-nvmem: dev_pm_opp_put_*() accepts NULL argument Viresh Kumar
2020-11-08  9:27   ` Ilia Lin
2020-11-06  7:03 ` [PATCH 7/7] media: venus: " Viresh Kumar
2020-11-08  9:25 ` [PATCH 0/7] opp: Allow dev_pm_opp_put_*() APIs to accept NULL opp_table Ilia Lin

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