• Viresh Kumar's avatar
    PM / OPP: Add 'struct kref' to OPP table · f067a982
    Viresh Kumar authored
    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: default avatarViresh Kumar <viresh.kumar@linaro.org>
    Reviewed-by: default avatarStephen Boyd <sboyd@codeaurora.org>
    Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    f067a982
opp.h 7.71 KB