Skip to content

Commit

Permalink
opp: Reduce the size of critical section in _opp_table_kref_release()
Browse files Browse the repository at this point in the history
[ Upstream commit e0df59d ]

There is a lot of stuff here which can be done outside of the big
opp_table_lock, do that. This helps avoiding few circular dependency
lockdeps around debugfs and interconnects.

Reported-by: Rob Clark <robdclark@gmail.com>
Reported-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
vireshk authored and gregkh committed Nov 18, 2020
1 parent 5389f45 commit 8ec600a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/opp/core.c
Expand Up @@ -1160,6 +1160,10 @@ static void _opp_table_kref_release(struct kref *kref)
struct opp_device *opp_dev, *temp;
int i;

/* Drop the lock as soon as we can */
list_del(&opp_table->node);
mutex_unlock(&opp_table_lock);

_of_clear_opp_table(opp_table);

/* Release clk */
Expand Down Expand Up @@ -1187,10 +1191,7 @@ static void _opp_table_kref_release(struct kref *kref)

mutex_destroy(&opp_table->genpd_virt_dev_lock);
mutex_destroy(&opp_table->lock);
list_del(&opp_table->node);
kfree(opp_table);

mutex_unlock(&opp_table_lock);
}

void dev_pm_opp_put_opp_table(struct opp_table *opp_table)
Expand Down

0 comments on commit 8ec600a

Please sign in to comment.