From: "Menon, Nishanth" <nm@ti.com>
To: Kevin Hilman <khilman@ti.com>
Cc: linux-omap <linux-omap@vger.kernel.org>
Subject: Re: [PM-WIP_CPUFREQ][PATCH 1/6 v2] OMAP2+: cpufreq: free up table on exit
Date: Thu, 19 May 2011 08:48:32 -0500 [thread overview]
Message-ID: <BANLkTikCRRBZUH+GXt52uc1osXwkZ=FWdw@mail.gmail.com> (raw)
In-Reply-To: <87liy39eac.fsf@ti.com>
On Thu, May 19, 2011 at 05:26, Kevin Hilman <khilman@ti.com> wrote:
> Nishanth Menon <nm@ti.com> writes:
>
>> freq_table allocated by opp_init_cpufreq_table in omap_cpu_init
>> needs to be freed in omap_cpu_exit.
>
> Actually it needs to be freed by a corresponding OPP layer function.
>
> IOW, what happens if the OPP core code switches from using kmalloc to
> static tables, or something else? The cleanup should be done by the
> same layer that does the init/alloc.
Agreed. We can introduce a new api in OPP layer to free up as well. I
will post a patch for it.
Regards,
Nishanth Menon
> Kevin
>
>> Signed-off-by: Nishanth Menon <nm@ti.com>
>> ---
>> arch/arm/mach-omap2/omap2plus-cpufreq.c | 3 +++
>> 1 files changed, 3 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/omap2plus-cpufreq.c b/arch/arm/mach-omap2/omap2plus-cpufreq.c
>> index d53ce23..e38ebb8 100644
>> --- a/arch/arm/mach-omap2/omap2plus-cpufreq.c
>> +++ b/arch/arm/mach-omap2/omap2plus-cpufreq.c
>> @@ -26,6 +26,7 @@
>> #include <linux/clk.h>
>> #include <linux/io.h>
>> #include <linux/opp.h>
>> +#include <linux/slab.h>
>> #include <linux/cpu.h>
>>
>> #include <asm/system.h>
>> @@ -216,6 +217,8 @@ static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy)
>> static int omap_cpu_exit(struct cpufreq_policy *policy)
>> {
>> clk_exit_cpufreq_table(&freq_table);
>> + kfree(freq_table);
>> + freq_table = NULL;
>> clk_put(mpu_clk);
>> return 0;
>> }
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2011-05-19 13:48 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <[PM-WIP_CPUFREQ][PATCH 0/5] Cleanups for cpufreq>
2011-05-18 7:37 ` [PM-WIP_CPUFREQ][PATCH 0/6 v2] Cleanups for cpufreq Nishanth Menon
2011-05-18 7:37 ` [PM-WIP_CPUFREQ][PATCH 1/6 v2] OMAP2+: cpufreq: free up table on exit Nishanth Menon
2011-05-19 10:26 ` Kevin Hilman
2011-05-19 13:48 ` Menon, Nishanth [this message]
2011-05-18 7:37 ` [PM-WIP_CPUFREQ][PATCH 2/6 v2] OMAP2+: cpufreq: handle invalid cpufreq table Nishanth Menon
2011-05-18 7:37 ` [PM-WIP_CPUFREQ][PATCH 3/6 v2] OMAP2+: cpufreq: minor comment cleanup Nishanth Menon
2011-05-18 20:08 ` Todd Poynor
2011-05-18 20:34 ` Menon, Nishanth
2011-05-18 7:37 ` [PM-WIP_CPUFREQ][PATCH 4/6 v2] OMAP2: cpufreq: use clk_init_cpufreq_table if OPPs not available Nishanth Menon
2011-05-19 13:12 ` Kevin Hilman
2011-05-19 13:51 ` Menon, Nishanth
2011-05-25 0:01 ` Kevin Hilman
2011-05-25 7:44 ` Menon, Nishanth
2011-05-18 7:37 ` [PM-WIP_CPUFREQ][PATCH 5/6 v2] OMAP2+: cpufreq: use cpufreq_frequency_table_target Nishanth Menon
2011-05-18 7:37 ` [PM-WIP_CPUFREQ][PATCH 6/6 v2] OMAP2+: cpufreq: fix freq_table leak Nishanth Menon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='BANLkTikCRRBZUH+GXt52uc1osXwkZ=FWdw@mail.gmail.com' \
--to=nm@ti.com \
--cc=khilman@ti.com \
--cc=linux-omap@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).