lkml.org 
[lkml]   [2020]   [Oct]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] opp: Reduce the size of critical section in _opp_table_kref_release()
From
Date
27.10.2020 10:57, Viresh Kumar пишет:
> 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>
> ---
> Rob: I know this only fixes the issue partially for you and I am still
> looking into that. I just wanted to get this merged in early as this
> fixes lockdep for other users as well.
>
> drivers/opp/core.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/opp/core.c b/drivers/opp/core.c
> index 4ac4e7ce6b8b..0e0a5269dc82 100644
> --- a/drivers/opp/core.c
> +++ b/drivers/opp/core.c
> @@ -1181,6 +1181,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 */
> @@ -1208,10 +1212,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)
>

Fixes the NVIDIA Tegra devfreq driver lockup using WIP ICC patches, thanks.

Tested-by: Dmitry Osipenko <digetx@gmail.com>

\
 
 \ /
  Last update: 2020-10-29 15:38    [W:0.102 / U:6.524 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site