From: Kevin Hilman <khilman@deeprootsystems.com>
To: Nishanth Menon <nm@ti.com>
Cc: linux-omap <linux-omap@vger.kernel.org>,
Benoit Cousson <b-cousson@ti.com>,
Madhusudhan Chikkature Rajashekar <madhu.cr@ti.com>,
Paul Walmsley <paul@pwsan.com>, Romit Dasgupta <romit@ti.com>,
Sanjeev Premi <premi@ti.com>,
Santosh Shilimkar <santosh.shilimkar@ti.com>,
Sergio Alberto Aguirre Rodriguez <saaguirre@ti.com>,
Thara Gopinath <thara@ti.com>,
Vishwanath Sripathy <vishwanath.bs@ti.com>
Subject: Re: [PATCH 5/9] omap3: pm: sr: replace get_opp with freq_to_opp
Date: Fri, 18 Dec 2009 15:12:49 -0800 [thread overview]
Message-ID: <87eimrx4em.fsf@deeprootsystems.com> (raw)
In-Reply-To: <1258004721-7315-6-git-send-email-nm@ti.com> (Nishanth Menon's message of "Wed\, 11 Nov 2009 23\:45\:17 -0600")
Nishanth Menon <nm@ti.com> writes:
> SmartReflex implements a get_opp to search through the opp table,
> replace it with the accessor function as it is a duplicate of
> freq_to_opp
SmartReflex is not quite working with this version which is in
pm-wip-opp. My (untested) theory below...
[...]
> --- a/arch/arm/mach-omap2/smartreflex.c
> +++ b/arch/arm/mach-omap2/smartreflex.c
> @@ -146,49 +146,29 @@ static u32 cal_test_nvalue(u32 sennval, u32 senpval)
> (rnsenn << NVALUERECIPROCAL_RNSENN_SHIFT);
> }
>
> -/* determine the current OPP from the frequency
> - * we need to give this function last element of OPP rate table
> - * and the frequency
> - */
> -static u16 get_opp(struct omap_opp *opp_freq_table,
> - unsigned long freq)
> -{
> - struct omap_opp *prcm_config;
> -
> - prcm_config = opp_freq_table;
> -
> - if (prcm_config->rate <= freq)
> - return prcm_config->opp_id; /* Return the Highest OPP */
> - for (; prcm_config->rate; prcm_config--)
> - if (prcm_config->rate < freq)
> - return (prcm_config+1)->opp_id;
> - else if (prcm_config->rate == freq)
> - return prcm_config->opp_id;
> - /* Return the least OPP */
> - return (prcm_config+1)->opp_id;
> -}
The function you removed here is doing the equivalent of
opp_find_freq_ceil()
> -static u16 get_vdd1_opp(void)
> +static u8 get_vdd1_opp(void)
> {
> - u16 opp;
> + u8 opp;
>
> if (sr1.vdd_opp_clk == NULL || IS_ERR(sr1.vdd_opp_clk) ||
> mpu_opps == NULL)
> return 0;
>
> - opp = get_opp(mpu_opps + MAX_VDD1_OPP, sr1.vdd_opp_clk->rate);
> + /* Not expected to fail.. */
> + BUG_ON(freq_to_opp(&opp, mpu_opps, sr1.vdd_opp_clk->rate));
> return opp;
> }
Ih this version you use freq_to_opp(), but in the V5 tarball you sent,
you replace get_opp with:
opp = opp_find_freq_exact(mpu_opps, sr1.vdd_opp_clk->rate, true);
This results in never finding an OPP, and SR never scaling.
This should probably be opp_find_freq_ceil(), right?
Kevin
next prev parent reply other threads:[~2009-12-18 23:12 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-12 5:45 [PATCH 0/9] OMAP3: PM: introduce support for 3630 OPPs Nishanth Menon
2009-11-12 5:45 ` [PATCH 1/9] omap3: pm: introduce enabled flag to omap_opp Nishanth Menon
2009-11-12 5:45 ` [PATCH 2/9] omap3: pm: introduce opp accessor functions Nishanth Menon
2009-11-12 5:45 ` [PATCH 3/9] omap3: pm: srf: introduce accessor function Nishanth Menon
2009-11-12 5:45 ` [PATCH 4/9] omap3: pm: use opp accessor functions for omap-target Nishanth Menon
2009-11-12 5:45 ` [PATCH 5/9] omap3: pm: sr: replace get_opp with freq_to_opp Nishanth Menon
2009-11-12 5:45 ` [PATCH 6/9] omap3: clk: use pm accessor functions for cpufreq table Nishanth Menon
2009-11-12 5:45 ` [PATCH 7/9] omap3: pm: remove VDDx_MIN/MAX macros Nishanth Menon
2009-11-12 5:45 ` [PATCH 8/9] omap3: pm: introduce dynamic OPP Nishanth Menon
2009-11-12 5:45 ` [PATCH 9/9] omap3: pm: introduce 3630 opps Nishanth Menon
2009-12-18 23:12 ` Kevin Hilman [this message]
2009-12-19 11:35 ` [PATCH 5/9] omap3: pm: sr: replace get_opp with freq_to_opp Menon, Nishanth
2009-12-22 16:45 ` Kevin Hilman
2010-01-06 23:46 ` Nishanth Menon
2010-01-07 0:23 ` Kevin Hilman
2010-01-07 8:35 ` Sripathy, Vishwanath
2010-01-07 8:53 ` Romit Dasgupta
2010-01-07 9:13 ` Sripathy, Vishwanath
2010-01-07 12:15 ` Nishanth Menon
2010-01-07 14:18 ` Nishanth Menon
2009-12-21 6:58 ` Romit Dasgupta
-- strict thread matches above, loose matches on Subject: below --
2009-11-13 6:05 [PATCH 0/9 v2] omap3: pm: introduce support for 3630 OPPs Nishanth Menon
2009-11-13 6:05 ` [PATCH 1/9] omap3: pm: introduce enabled flag to omap_opp Nishanth Menon
2009-11-13 6:05 ` [PATCH 2/9 v2] omap3: pm: introduce opp accessor functions Nishanth Menon
2009-11-13 6:05 ` [PATCH 3/9] omap3: pm: srf: use opp accessor function Nishanth Menon
2009-11-13 6:05 ` [PATCH 4/9] omap3: pm: use opp accessor functions for omap-target Nishanth Menon
2009-11-13 6:05 ` [PATCH 5/9] omap3: pm: sr: replace get_opp with freq_to_opp 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=87eimrx4em.fsf@deeprootsystems.com \
--to=khilman@deeprootsystems.com \
--cc=b-cousson@ti.com \
--cc=linux-omap@vger.kernel.org \
--cc=madhu.cr@ti.com \
--cc=nm@ti.com \
--cc=paul@pwsan.com \
--cc=premi@ti.com \
--cc=romit@ti.com \
--cc=saaguirre@ti.com \
--cc=santosh.shilimkar@ti.com \
--cc=thara@ti.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