lkml.org 
[lkml]   [2014]   [May]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2] PM / OPP: Implement opp_remove and free_opp_table functions
From
On Wed, May 21, 2014 at 1:25 PM, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> On 21 May 2014 11:21, Inderpal Singh <inderpal.s@samsung.com> wrote:
>> At the driver unloading time the associated opps and its table may need
>> to be deleted. Otherwise it amounts to memory leak. The existing
>> OPP library does not have provision to do so.
>>
>> Hence this patch implements the required functions to free the same.
>>
>> Signed-off-by: Inderpal Singh <inderpal.s@samsung.com>
>> ---
>> Changes in v2:
>> - As suggested by Nishanth, added support to remove a single OPP
>> for non-DT users
>> - Added an internal helper function to avoid the code duplication
>> between opp_remove and free_opp_table functions
>>
>> drivers/base/power/opp.c | 122 ++++++++++++++++++++++++++++++++++++++++++++++-
>> include/linux/pm_opp.h | 14 +++++-
>> 2 files changed, 134 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
>> index faae9cf..22adef3 100644
>> --- a/drivers/base/power/opp.c
>> +++ b/drivers/base/power/opp.c
>> @@ -89,6 +89,7 @@ struct device_opp {
>> struct device *dev;
>> struct srcu_notifier_head head;
>> struct list_head opp_list;
>> + struct rcu_head head_rcu;
>
> This isn't used ...

Its being used in opp_remove_and_free function to free dev_opp with kfree_rcu.

>
>> };
>>
>> /*
>> @@ -427,7 +428,6 @@ int dev_pm_opp_add(struct device *dev, unsigned long freq, unsigned long u_volt)
>> __func__);
>> return -ENOMEM;
>> }
>> -
>
> Unrelated change.

Ahhh, missed it. Thanks for pointing.

> --
> To unsubscribe from this list: send the line "unsubscribe linux-pm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html


\
 
 \ /
  Last update: 2014-05-21 10:41    [W:0.067 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site