]> git.baikalelectronics.ru Git - kernel.git/commit
PM / OPP: Add 'struct kref' to OPP table
authorViresh Kumar <viresh.kumar@linaro.org>
Mon, 23 Jan 2017 04:41:42 +0000 (10:11 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 30 Jan 2017 08:22:20 +0000 (09:22 +0100)
commit231d73fdb72825fa36aff55d0d37e6499d309892
treeabc4cc23a4e49cb000104b09182ec4defab569dd
parent6a8489fb12ce52292c7a6b7fba33ff562d3fd241
PM / OPP: Add 'struct kref' to OPP table

Add kref to struct opp_table for easier accounting of the OPP table.

Note that the new routine dev_pm_opp_get_opp_table() takes the reference
from under the opp_table_lock, which guarantees that the OPP table
doesn't get freed unless dev_pm_opp_put_opp_table() is called for the
OPP table.

Two separate release mechanisms are added: locked and unlocked. In
unlocked version the routines aren't required to take/drop
opp_table_lock as the callers have already done that. This is required
to avoid breaking git bisect, otherwise we may get lockdeps between
commits. Once all the users of OPP table are updated the unlocked
version shall be removed.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/base/power/opp/core.c
drivers/base/power/opp/opp.h
include/linux/pm_opp.h