mbox series

[0/4] PM / OPP: Minor cleanups

Message ID cover.1494995911.git.viresh.kumar@linaro.org
Headers show
Series PM / OPP: Minor cleanups | expand

Message

Viresh Kumar May 17, 2017, 4:40 a.m. UTC
Hi,

Here are few cleanup patches for the OPP core. The first two simplify
the code that was written specifically due to the limitations that we
had because of RCUs. We don't RCUs anymore and this can be simplified.

The last two take care of specific corner cases.

Rebased over pm/linux-next and tested on Exynos dual core board.

Viresh Kumar (4):
  PM / OPP: Reorganize _generic_set_opp_regulator()
  PM / OPP: Don't create copy of regulators unnecessarily
  PM / OPP: opp-microvolt is not optional if regulators are set
  PM / OPP: Don't create debugfs "supply-0" directory unnecessarily

 drivers/base/power/opp/core.c    | 87 +++++++++++++++++-----------------------
 drivers/base/power/opp/debugfs.c |  6 +--
 drivers/base/power/opp/of.c      | 11 ++++-
 3 files changed, 49 insertions(+), 55 deletions(-)

-- 
2.13.0.303.g4ebf3021692d

Comments

Stephen Boyd May 23, 2017, 1:09 a.m. UTC | #1
On 05/17, Viresh Kumar wrote:
> The code was overly complicated here because of the limitations that we

> had with RCUs (Couldn't use opp-table and OPPs outside RCU protected

> section and can't call sleep-able routines from within that). But that

> is long gone now.

> 

> Reorganize _generic_set_opp_regulator() in order to avoid using "struct

> dev_pm_set_opp_data" and copying data into it for the case where

> opp_table->set_opp is not set.

> 

> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>

> ---

>  drivers/base/power/opp/core.c | 73 ++++++++++++++++++++-----------------------

>  1 file changed, 34 insertions(+), 39 deletions(-)

> 

> diff --git a/drivers/base/power/opp/core.c b/drivers/base/power/opp/core.c

> index dae61720b314..402b9e86d77c 100644

> --- a/drivers/base/power/opp/core.c

> +++ b/drivers/base/power/opp/core.c

> @@ -543,17 +543,18 @@ _generic_set_opp_clk_only(struct device *dev, struct clk *clk,

>  	return ret;

>  }

>  

> -static int _generic_set_opp(struct dev_pm_set_opp_data *data)

> +static int _generic_set_opp_regulator(struct opp_table *opp_table,


Can opp_table be const?

> +				      struct device *dev,


Maybe dev too, but that looks like a ripple effect so maybe
in another patch.

> +				      unsigned long old_freq,

> +				      unsigned long freq,

> +				      struct dev_pm_opp_supply *old_supply,

> +				      struct dev_pm_opp_supply *new_supply)


Otherwise

Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>


-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project