[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c657b5b0-b841-1b26-8008-2fb4b490d63d@gmail.com>
Date: Tue, 19 Jan 2021 20:16:11 +0300
From: Dmitry Osipenko <digetx@...il.com>
To: Viresh Kumar <viresh.kumar@...aro.org>,
Viresh Kumar <vireshk@...nel.org>, Nishanth Menon <nm@...com>,
Stephen Boyd <sboyd@...nel.org>
Cc: linux-pm@...r.kernel.org,
Vincent Guittot <vincent.guittot@...aro.org>,
Rafael Wysocki <rjw@...ysocki.net>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] opp: Prepare for ->set_opp() helper to work without
regulators
19.01.2021 09:35, Viresh Kumar пишет:
> + mutex_lock(&opp_table->lock);
> + opp_table->set_opp_data = data;
> + if (opp_table->sod_supplies) {
> + data->old_opp.supplies = opp_table->sod_supplies;
> + data->new_opp.supplies = opp_table->sod_supplies +
> + opp_table->regulator_count;
> + }
> + mutex_unlock(&opp_table->lock);
Why do we need all these locks in this patch?
The OPP API isn't thread-safe, these locks won't make the API
thread-safe. At least both sod_supplies and set_opp() pointers should be
set and unset under the lock.
If you're about to make OPP thread-safe, then I suggest to do it
separately from this change. Otherwise this patch looks good to me.
Powered by blists - more mailing lists