Re: [PATCH v2] PM / OPP: Implement opp_remove and free_opp_table functions

From: Viresh Kumar
Date: Wed May 21 2014 - 03:55:37 EST


On 21 May 2014 11:21, Inderpal Singh <inderpal.s@xxxxxxxxxxx> 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@xxxxxxxxxxx>
> ---
> 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 ...

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

Unrelated change.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/