From: Kevin Hilman <khilman@ti.com>
To: "Menon, Nishanth" <nm@ti.com>
Cc: Vishwanath Sripathy <vishwanath.bs@ti.com>,
linux-omap <linux-omap@vger.kernel.org>,
Tony Lindgren <tony@atomide.com>
Subject: Re: [PATCH 03/19] omap3+: voltage: remove initial voltage
Date: Wed, 02 Mar 2011 15:52:53 -0800 [thread overview]
Message-ID: <8762s1xep6.fsf@ti.com> (raw)
In-Reply-To: <AANLkTi=ofKtTZjSjEaPyeK52isPZhaVK8_cb1-LZ1qUT@mail.gmail.com> (Nishanth Menon's message of "Wed, 23 Feb 2011 14:38:38 +0530")
"Menon, Nishanth" <nm@ti.com> writes:
> On Wed, Feb 23, 2011 at 14:29, Vishwanath Sripathy <vishwanath.bs@ti.com> wrote:
>>> -----Original Message-----
>>> From: Menon, Nishanth [mailto:nm@ti.com]
>>> Sent: Wednesday, February 23, 2011 1:48 PM
>>> To: Vishwanath Sripathy
>>> Cc: linux-omap; Tony Lindgren; Kevin Hilman
>>> Subject: Re: [PATCH 03/19] omap3+: voltage: remove initial voltage
>>>
>>> Wed, Feb 23, 2011 at 12:24, Vishwanath Sripathy
>>> <vishwanath.bs@ti.com> wrote:
>>> >> -----Original Message-----
>>> >> From: Nishanth Menon [mailto:nm@ti.com]
>>> >> Sent: Sunday, February 20, 2011 10:42 AM
>>> >> To: Vishwanath Sripathy
>>> >> Cc: linux-omap; Tony Lindgren; Kevin Hilman
>>> >> Subject: Re: [PATCH 03/19] omap3+: voltage: remove initial voltage
>>> >>
>>> >> Vishwanath Sripathy wrote, on 02/19/2011 06:54 PM:
>>> >> [..]
>>> >> >> omap2_set_init_voltage should setup the curr_volt based on
>>> which
>>> >> OPP
>>> >> >> the system is functioning at. Blindly setting a 1.2v setting in
>> the
>>> >> >> initial structure may not even match the default voltages stored
>>> in
>>> >> >> the voltage table which are supported for the domain.
>>> >> >>
>>> >> >> For example, OMAP3430 core domain does not use 1.2v and ends
>>> up
>>> >> >> generating a warning on the first transition.
>>> >> >>
>>> >> [..]
>>> >> >> diff --git a/arch/arm/mach-omap2/voltage.c b/arch/arm/mach-
>>> >> >> omap2/voltage.c
>>> >> >> index 12be525..280ee12 100644
>>> >> >> --- a/arch/arm/mach-omap2/voltage.c
>>> >> >> +++ b/arch/arm/mach-omap2/voltage.c
>>> >> [..]
>>> >> >> /* Generic voltage parameters */
>>> >> >> - vdd->curr_volt = 1200000;
>>> >> > Where do you update this parameter upon initialization? Shouldn't
>>> you
>>> >> read
>>> >> > the VP register and find the actual current voltage and update this
>>> >> param?
>>> >>
>>> >> The sequence is as follows:
>>> >> a) omapx_vdd_data configure is called as part of sr init sequence.
>>> >> And the curr_volt with this patch is not updated at this stage.
>>> >> b) somewhere down in the boot sequence, pm.c's
>>> >> omap2_set_init_voltage
>>> >> starts up. This looks up the current clk frequency from clock layer
>> of
>>> >> the parent device for the domain, picks up the nominal voltages
>>> stored
>>> >> in the opp layer, then does a omap_voltage_scale_vdd to that
>>> voltage. In
>>> >> omap_voltage_scale_vdd, The current voltage is merely picked off
>>> the vp
>>> >> (in _pre_volt_scale). the last step it does is to setup
>> vdd->curr_volt.
>>> >> This can then be used by dvfs layer etc to make appropriate
>>> decisions.
>>> >>
>>> >> So, No, I dont think I need to update it here, it should happen as
>>> part
>>> >> of the pm init sequence.
>>> >>
>>> >> Could you explain what problem do you foresee by doing this?
>>> > What if omap_voltage_scale_vdd fails when called from
>>> > omap2_set_init_voltage? Or omap2_set_init_voltage returns error
>>> even
>>> > before calling omap_voltage_scale_vdd because it could not find the
>>> > matching voltage for the frequency set by bootloader?
>>> >
>>> > Your assumption that curr_volt is always set by
>>> omap2_set_init_voltage
>>> > need not be true always.
>>>
>>> set_init_voltage's job is to set the initial voltage. if it is
>>> incapable of doing it, I say fix that instead of hacking in some
>>> random number as curr_volt.
>> I never said to use random numbers. All I suggested was that instead of
>> relying on some others function's behavior, read the VP register to fill
>> in the right values. If set_init_voltage succeeds, it will anyway update
>> with right voltage.
> OK, lets take this argument for a moment.
> Q: which voltage to set as curr_volt?
> a) what if the update was done over vcbypass by bootloader? Cannot
> trust the vp register for the value.
> b) what if the voltage was updated over i2c1 to the PMIC by
> bootloader? cant trust vp register again.
> c) use some number like 1.2v - which we are aligned is wrong.
>
> in short, what should we do for a accurate curr_volt? vp register may
> not be correct, instead, the right steps to do:
> find my current freq, check the OPP table for the voltage needed,
> setup the voltage for it, update curr_volt for it. this is trust
> worthy, rest are not.
>
> This is what set_init_voltage does, replicating that logic in
> voltage.c makes no sense again to me.
Agreed.
Please update the changelog with a summary of how curr_volt is properly
updated so it's clear that you're not removing something that isn't
updated elsewhere.
Thanks,
Kevin
--
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-03-02 23:53 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-19 12:01 [PATCH 00/19] OMAP3+: introduce SR class 1.5 Nishanth Menon
2011-02-19 12:01 ` [PATCH 01/19] omap3: hwmod: add smartreflex irqs Nishanth Menon
2011-03-02 23:48 ` Kevin Hilman
2011-03-03 0:43 ` Nishanth Menon
2011-02-19 12:01 ` [PATCH 02/19] omap3630: hwmod: sr: enable for higher ES Nishanth Menon
2011-02-19 13:22 ` Vishwanath Sripathy
2011-02-20 5:26 ` Nishanth Menon
2011-02-20 5:38 ` do we need CHIP_GE_OMAP3630ES1in .oc? (was Re: [PATCH 02/19] omap3630: hwmod: sr: enable for higher ES) Nishanth Menon
2011-02-21 5:50 ` Anand Gadiyar
2011-02-19 12:01 ` [PATCH 03/19] omap3+: voltage: remove initial voltage Nishanth Menon
2011-02-19 13:24 ` Vishwanath Sripathy
2011-02-20 5:12 ` Nishanth Menon
2011-02-23 6:54 ` Vishwanath Sripathy
2011-02-23 8:18 ` Menon, Nishanth
2011-02-23 8:59 ` Vishwanath Sripathy
2011-02-23 9:08 ` Menon, Nishanth
2011-03-02 23:52 ` Kevin Hilman [this message]
2011-03-03 0:35 ` Nishanth Menon
2011-03-03 0:53 ` Kevin Hilman
2011-02-19 12:01 ` [PATCH 04/19] omap3+: voltage: remove spurious pr_notice for debugfs Nishanth Menon
2011-02-19 12:01 ` [PATCH 05/19] omap3+: voltage: use IS_ERR_OR_NULL Nishanth Menon
2011-02-19 12:01 ` [PATCH 06/19] omap3+: voltage: use volt_data pointer instead values Nishanth Menon
2011-02-24 5:28 ` Gulati, Shweta
2011-02-24 8:29 ` Gulati, Shweta
2011-02-24 17:22 ` Menon, Nishanth
2011-02-19 12:01 ` [PATCH 07/19] omap3+: voltage: add transdone apis Nishanth Menon
2011-02-19 12:01 ` [PATCH 08/19] omap3+: sr: make notify independent of class Nishanth Menon
2011-03-03 0:05 ` Kevin Hilman
2011-02-19 12:01 ` [PATCH 09/19] omap3+: sr: introduce class init,deinit and priv data Nishanth Menon
2011-03-03 0:08 ` Kevin Hilman
2011-03-03 0:41 ` Nishanth Menon
2011-03-03 0:57 ` Kevin Hilman
2011-03-03 1:22 ` Nishanth Menon
2011-02-19 12:01 ` [PATCH 10/19] omap3+: sr: fix cosmetic indentation Nishanth Menon
2011-03-03 0:09 ` Kevin Hilman
2011-02-19 12:01 ` [PATCH 11/19] omap3+: sr: call handler with interrupt disabled Nishanth Menon
2011-03-03 0:11 ` Kevin Hilman
2011-03-03 0:46 ` Nishanth Menon
2011-02-19 12:01 ` [PATCH 12/19] omap3+: sr: disable interrupt by default Nishanth Menon
2011-03-03 0:15 ` Kevin Hilman
2011-03-03 0:26 ` Nishanth Menon
2011-03-03 0:59 ` Kevin Hilman
2011-03-03 1:23 ` Nishanth Menon
2011-02-19 12:01 ` [PATCH 13/19] omap3+: sr: enable/disable SR only on need Nishanth Menon
2011-02-19 12:01 ` [PATCH 14/19] omap3+: sr: introduce notifiers flags Nishanth Menon
2011-03-03 0:17 ` Kevin Hilman
2011-03-03 0:47 ` Nishanth Menon
2011-02-19 12:01 ` [PATCH 15/19] omap3+: sr: introduce notifier_control Nishanth Menon
2011-02-19 13:40 ` Vishwanath Sripathy
2011-02-20 4:50 ` Nishanth Menon
2011-02-23 6:46 ` Vishwanath Sripathy
2011-02-23 8:14 ` Menon, Nishanth
2011-02-19 12:01 ` [PATCH 16/19] omap3+: sr: disable spamming interrupts Nishanth Menon
2011-03-03 0:21 ` Kevin Hilman
2011-02-19 12:01 ` [PATCH 17/19] omap3+: sr: make enable path use volt_data pointer Nishanth Menon
2011-02-19 12:01 ` [PATCH 18/19] omap3630+: sr: add support for class 1.5 Nishanth Menon
2011-03-01 9:53 ` Gulati, Shweta
2011-03-01 10:17 ` Menon, Nishanth
2011-03-01 12:20 ` Gulati, Shweta
2011-02-19 12:01 ` [PATCH 19/19] omap3430: sr: class3: restrict cpu to run on Nishanth Menon
2011-03-03 0:33 ` [PATCH 00/19] OMAP3+: introduce SR class 1.5 Kevin Hilman
2011-03-03 0:37 ` Nishanth Menon
2011-03-03 1:00 ` Kevin Hilman
2011-03-03 1:30 ` 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=8762s1xep6.fsf@ti.com \
--to=khilman@ti.com \
--cc=linux-omap@vger.kernel.org \
--cc=nm@ti.com \
--cc=tony@atomide.com \
--cc=vishwanath.bs@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox