• Viresh Kumar's avatar
    cpufreq: scpi/scmi: Fix freeing of dynamic OPPs · 1690d8bb
    Viresh Kumar authored
    Since the commit 2a4eb735 "OPP: Don't remove dynamic OPPs from
    _dev_pm_opp_remove_table()", dynamically created OPP aren't
    automatically removed anymore by dev_pm_opp_cpumask_remove_table(). This
    affects the scpi and scmi cpufreq drivers which no longer free OPPs on
    failures or on invocations of the policy->exit() callback.
    
    Create a generic OPP helper dev_pm_opp_remove_all_dynamic() which can be
    called from these drivers instead of dev_pm_opp_cpumask_remove_table().
    
    In dev_pm_opp_remove_all_dynamic(), we need to make sure that the
    opp_list isn't getting accessed simultaneously from other parts of the
    OPP core while the helper is freeing dynamic OPPs, i.e. we can't drop
    the opp_table->lock while traversing through the OPP list. And to
    accomplish that, this patch also creates _opp_kref_release_unlocked()
    which can be called from this new helper with the opp_table lock already
    held.
    
    Cc: 4.20 <stable@vger.kernel.org> # v4.20
    Reported-by: 's avatarValentin Schneider <valentin.schneider@arm.com>
    Fixes: 2a4eb735 "OPP: Don't remove dynamic OPPs from _dev_pm_opp_remove_table()"
    Signed-off-by: 's avatarViresh Kumar <viresh.kumar@linaro.org>
    Tested-by: 's avatarValentin Schneider <valentin.schneider@arm.com>
    Reviewed-by: 's avatarSudeep Holla <sudeep.holla@arm.com>
    Signed-off-by: 's avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    1690d8bb
Name
Last commit
Last update
Documentation Loading commit data...
LICENSES Loading commit data...
arch Loading commit data...
block Loading commit data...
certs Loading commit data...
crypto Loading commit data...
drivers Loading commit data...
firmware Loading commit data...
fs Loading commit data...
include Loading commit data...
init Loading commit data...
ipc Loading commit data...
kernel Loading commit data...
lib Loading commit data...
mm Loading commit data...
net Loading commit data...
samples Loading commit data...
scripts Loading commit data...
security Loading commit data...
sound Loading commit data...
tools Loading commit data...
usr Loading commit data...
virt Loading commit data...
.clang-format Loading commit data...
.cocciconfig Loading commit data...
.get_maintainer.ignore Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
COPYING Loading commit data...
CREDITS Loading commit data...
Kbuild Loading commit data...
Kconfig Loading commit data...
MAINTAINERS Loading commit data...
Makefile Loading commit data...
README Loading commit data...