Re: [PATCH] opp: Prepare for ->set_opp() helper to work without regulators

2021-01-21 Thread Viresh Kumar
On 20-01-21, 17:50, Dmitry Osipenko wrote: > If OPP API was meant to be thread-safe, then the > dev_pm_opp_unregister_set_opp_helper() should unset the > opp_table->set_opp_data under the lock since it races with > dev_pm_opp_set_regulators(). Right, I will fix that. > Secondly, functions like de

Re: [PATCH] opp: Prepare for ->set_opp() helper to work without regulators

2021-01-21 Thread Viresh Kumar
On 20-01-21, 13:38, Viresh Kumar wrote: > On 19-01-21, 12:05, Viresh Kumar wrote: > > Until now the ->set_opp() helper (i.e. special implementation for > > setting the OPPs for platforms) was implemented only to take care of > > multiple regulators case, but going forward we would need that for oth

Re: [PATCH] opp: Prepare for ->set_opp() helper to work without regulators

2021-01-20 Thread Dmitry Osipenko
20.01.2021 10:39, Viresh Kumar пишет: > On 19-01-21, 20:16, Dmitry Osipenko wrote: >> 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_su

Re: [PATCH] opp: Prepare for ->set_opp() helper to work without regulators

2021-01-20 Thread Viresh Kumar
On 19-01-21, 12:05, Viresh Kumar wrote: > Until now the ->set_opp() helper (i.e. special implementation for > setting the OPPs for platforms) was implemented only to take care of > multiple regulators case, but going forward we would need that for other > use cases as well. > > This patch prepares

Re: [PATCH] opp: Prepare for ->set_opp() helper to work without regulators

2021-01-19 Thread Viresh Kumar
On 19-01-21, 20:16, Dmitry Osipenko wrote: > 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.sup

Re: [PATCH] opp: Prepare for ->set_opp() helper to work without regulators

2021-01-19 Thread Dmitry Osipenko
19.01.2021 09:35, Viresh Kumar пишет: > Until now the ->set_opp() helper (i.e. special implementation for > setting the OPPs for platforms) was implemented only to take care of > multiple regulators case, but going forward we would need that for other > use cases as well. > > This patch prepares f

Re: [PATCH] opp: Prepare for ->set_opp() helper to work without regulators

2021-01-19 Thread Dmitry Osipenko
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 + > +

[PATCH] opp: Prepare for ->set_opp() helper to work without regulators

2021-01-18 Thread Viresh Kumar
Until now the ->set_opp() helper (i.e. special implementation for setting the OPPs for platforms) was implemented only to take care of multiple regulators case, but going forward we would need that for other use cases as well. This patch prepares for that by allocating the regulator specific part