[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <159747812515.33733.6233341429546003955@swboyd.mtv.corp.google.com>
Date: Sat, 15 Aug 2020 00:55:25 -0700
From: Stephen Boyd <sboyd@...nel.org>
To: Nishanth Menon <nm@...com>, Viresh Kumar <viresh.kumar@...aro.org>,
Viresh Kumar <vireshk@...nel.org>
Cc: Viresh Kumar <viresh.kumar@...aro.org>, linux-pm@...r.kernel.org,
Vincent Guittot <vincent.guittot@...aro.org>,
Rafael Wysocki <rjw@...ysocki.net>, mka@...omium.org,
sibis@...eaurora.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/4] opp: Reused enabled flag and remove regulator_enabled
Quoting Viresh Kumar (2020-08-12 21:29:00)
> The common "enabled" flag can be used here instead of
> "regulator_enabled" now.
>
> Signed-off-by: Viresh Kumar <viresh.kumar@...aro.org>
Why not put this before the other patch? And mention that it will be
reused in another place soon? Then the previous patch won't look like
we're adding a variable to the struct when it is only used inside a
single function. Or at least squash it with the previous patch.
> ---
> drivers/opp/core.c | 13 +++----------
> drivers/opp/opp.h | 2 --
> 2 files changed, 3 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/opp/core.c b/drivers/opp/core.c
> index e8882e7fd8a5..5f5da257f58a 100644
> --- a/drivers/opp/core.c
> +++ b/drivers/opp/core.c
> @@ -703,12 +703,10 @@ static int _generic_set_opp_regulator(struct opp_table *opp_table,
> * Enable the regulator after setting its voltages, otherwise it breaks
> * some boot-enabled regulators.
> */
> - if (unlikely(!opp_table->regulator_enabled)) {
> + if (unlikely(!opp_table->enabled)) {
> ret = regulator_enable(reg);
> if (ret < 0)
> dev_warn(dev, "Failed to enable regulator: %d", ret);
> - else
> - opp_table->regulator_enabled = true;
A quick glance makes this look unsafe now because we're only checking
'enabled' and not actually setting it when this function is called. I
have to go back to the previous patch to understand where enabled is now
set to confirm that it is OK. If it was all one patch all the context
would be here.
Powered by blists - more mailing lists