All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Menon, Nishanth" <nm@ti.com>
To: Kevin Hilman <khilman@ti.com>
Cc: "Turquette, Mike" <mturquette@ti.com>,
	Santosh Shilimkar <santosh.shilimkar@ti.com>,
	linux-omap <linux-omap@vger.kernel.org>
Subject: Re: [PM-WIP_CPUFREQ][PATCH 0/6 V3] Cleanups for cpufreq
Date: Sun, 29 May 2011 12:25:18 -0500	[thread overview]
Message-ID: <BANLkTimLvXDhExHoPTvWZKo4_O6bM_JQeQ@mail.gmail.com> (raw)
In-Reply-To: <871uzjwwq7.fsf@ti.com>

On Fri, May 27, 2011 at 18:27, Kevin Hilman <khilman@ti.com> wrote:
> All of this came up because this series is going through contortions to
> make two CPUfreq registrations only using one freq_table, protect
> against concurrent access from different CPUs etc.,  which led me to
> wonder why we need two registrations.
I believe we have two cpu_inits and exits per cpu -> the
/sys/devices/system/cpu/cpu1/online and
/sys/devices/system/cpu/cpu0/online
are not soft links. this is where the issue starts

Try this diff on the pm-wip/cpufreq branch:
diff --git a/arch/arm/mach-omap2/omap2plus-cpufreq.c
b/arch/arm/mach-omap2/omap2plus-cpufreq.c
index 33a91ec..f3e82ce 100644
--- a/arch/arm/mach-omap2/omap2plus-cpufreq.c
+++ b/arch/arm/mach-omap2/omap2plus-cpufreq.c
@@ -199,11 +199,15 @@ static int __cpuinit omap_cpu_init(struct
cpufreq_policy *policy)
        /* FIXME: what's the actual transition time? */
        policy->cpuinfo.transition_latency = 300 * 1000;

+       dev_err(mpu_dev, "%s: XXX: cpu%d freq_table pointer=%p\n", __func__,
+                       policy->cpu, freq_table);
        return 0;
 }

 static int omap_cpu_exit(struct cpufreq_policy *policy)
 {
+       dev_err(mpu_dev, "%s: XXX: cpu%d freq_table pointer=%p\n", __func__,
+                       policy->cpu, freq_table);
        clk_exit_cpufreq_table(&freq_table);
        clk_put(mpu_clk);
        return 0;

[    2.045623] platform mpu.0: omap_cpu_init: XXX: cpu0 freq_table
pointer=eeff7e20
[    2.055664] platform mpu.0: omap_cpu_init: XXX: cpu1 freq_table
pointer=eeff7de0 <- Freq table eeff7e20 got overwritten by the new
alloc
[    2.063537] platform mpu.0: omap_cpu_exit: XXX: cpu1 freq_table
pointer=eeff7de0 <- if I had a kfree/ opp_freqtable_free in exit, we'd
have had a dangling pointer.

in this series:
patch 1: OMAP2+: cpufreq: dont support !freq_table -> This is a proper
fix to cleanup the code which seems to think that silicon with no
freq_table is to be supported - this is a hang over from OMAP1 time
and should be removed.
patch 2: OMAP2+: cpufreq: use OPP library -> Since we are using OPP
table and from your recommendation of a previous patch incarnation, I
have moved the cpufreq usage depdendent on OPP.
Patch 3: OMAP2+: cpufreq: put clk if cpu_init failed -> this is a
valid fix as well
Patch 4: OMAP2+: cpufreq: fix freq_table leak -> This is what I have
explained above -> Since online variables are not really a softlink, I
dont think we should be confused as to what the fix should look like!

table creation and registration is done as part of cpu_init - this is
probably the most appropriate place for it. but we should consider the
potential of cpu onlining and offlining dynamically in the system as
well. hence the need for patch 4 where I have used freq_table users.

Regards,
Nishanth Menon
--
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

      reply	other threads:[~2011-05-29 17:25 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-25 23:38 [PM-WIP_CPUFREQ][PATCH 0/6 V3] Cleanups for cpufreq Nishanth Menon
2011-05-25 23:38 ` [PM-WIP_CPUFREQ][PATCH V3 1/8] OMAP2+: cpufreq: move clk name decision to init Nishanth Menon
2011-05-26 17:33   ` Kevin Hilman
2011-05-25 23:38 ` [PM-WIP_CPUFREQ][PATCH V3 2/8] OMAP2+: cpufreq: deny initialization if no mpudev Nishanth Menon
2011-05-26 17:34   ` Kevin Hilman
2011-05-25 23:38 ` [PM-WIP_CPUFREQ][PATCH V3 3/8] OMAP2+: cpufreq: use opp/clk_*cpufreq_table based on silicon Nishanth Menon
2011-05-26 17:38   ` Kevin Hilman
2011-05-26 18:35     ` Menon, Nishanth
2011-05-26 18:39       ` Menon, Nishanth
2011-05-26 20:25         ` Kevin Hilman
2011-05-25 23:38 ` [PM-WIP_CPUFREQ][PATCH V3 4/8] OMAP2+: cpufreq: dont support !freq_table Nishanth Menon
2011-05-26  0:51   ` Todd Poynor
2011-05-26  0:53     ` Menon, Nishanth
     [not found]     ` <SNT104-W336E0DDFB034FA635C328BBA770@phx.gbl>
2011-05-26  1:03       ` Menon, Nishanth
2011-05-25 23:38 ` [PM-WIP_CPUFREQ][PATCH V3 5/8] OMAP2+: cpufreq: fix invalid cpufreq table with central alloc/free Nishanth Menon
2011-05-26  1:09   ` Todd Poynor
2011-05-26  1:21     ` Menon, Nishanth
2011-05-25 23:38 ` [PM-WIP_CPUFREQ][PATCH V3 6/8] OMAP2+: cpufreq: fix freq_table leak Nishanth Menon
2011-05-26  0:16   ` Kevin Hilman
2011-05-26  0:47     ` Menon, Nishanth
2011-05-26 17:11       ` Kevin Hilman
2011-05-26 18:34         ` Menon, Nishanth
2011-05-26  1:25   ` Todd Poynor
2011-05-26  1:36     ` Menon, Nishanth
2011-05-25 23:38 ` [PM-WIP_CPUFREQ][PATCH V3 7/8] OMAP2+: cpufreq: put clk if cpu_init failed Nishanth Menon
2011-05-25 23:38 ` [PM-WIP_CPUFREQ][PATCH V3 8/8] OMAP: cpufreq: minor file header updates Nishanth Menon
2011-05-26  0:18   ` Kevin Hilman
2011-05-26  0:48     ` Menon, Nishanth
2011-05-26 18:15   ` Kevin Hilman
2011-05-26 18:10 ` [PM-WIP_CPUFREQ][PATCH 0/6 V3] Cleanups for cpufreq Kevin Hilman
2011-05-26 18:36   ` Menon, Nishanth
2011-05-27  5:06   ` Santosh Shilimkar
2011-05-27  6:07     ` Menon, Nishanth
2011-05-27  6:26       ` Santosh Shilimkar
2011-05-27 15:33         ` Turquette, Mike
2011-05-27 23:27           ` Kevin Hilman
2011-05-29 17:25             ` Menon, Nishanth [this message]

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=BANLkTimLvXDhExHoPTvWZKo4_O6bM_JQeQ@mail.gmail.com \
    --to=nm@ti.com \
    --cc=khilman@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=mturquette@ti.com \
    --cc=santosh.shilimkar@ti.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.