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

From: Dmitry Osipenko
Date: Thu Jan 21 2021 - 16:06:50 EST


21.01.2021 14:30, Viresh Kumar пишет:
> @@ -1952,9 +1930,16 @@ void dev_pm_opp_put_regulators(struct opp_table *opp_table)
> for (i = opp_table->regulator_count - 1; i >= 0; i--)
> regulator_put(opp_table->regulators[i]);
>
> - _free_set_opp_data(opp_table);
> + mutex_lock(&opp_table->lock);
> + if (opp_table->set_opp_data) {
> + opp_table->set_opp_data->old_opp.supplies = NULL;
> + opp_table->set_opp_data->new_opp.supplies = NULL;
> + }
> + mutex_unlock(&opp_table->lock);
>
> + kfree(opp_table->sod_supplies);
> kfree(opp_table->regulators);
> + opp_table->sod_supplies = NULL;
> opp_table->regulators = NULL;
> opp_table->regulator_count = -1;

The sod_supplies should be unset under the lock.