From: Kevin Hilman <khilman@deeprootsystems.com>
To: Nishanth Menon <nm@ti.com>
Cc: Phil Carmody <ext-phil.2.carmody@nokia.com>,
linux-doc <linux-doc@vger.kernel.org>,
"H. Peter Anvin" <hpa@zytor.com>,
Jesse Barnes <jbarnes@virtuousgeek.org>,
"Chikkature Rajashekar, Madhusudhan" <madhu.cr@ti.com>,
"Aguirre, Sergio" <saaguirre@ti.com>,
Andi Kleen <ak@linux.intel.com>,
linux-pm <linux-pm@lists.linux-foundation.org>,
Matthew Garrett <mjg@redhat.com>, Len Brown <len.brown@intel.com>,
Eduardo Valentin <eduardo.valentin@nokia.com>,
linux-omap <linux-omap@vger.kernel.org>,
"Gopinath, Thara" <thara@ti.com>,
linux-arm <linux-arm-kernel@lists.infradead.org>,
Linus Walleij <linus.walleij@stericsson.com>,
"Granados Dorado, Roberto" <x0095451@ti.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
lkml <linux-kernel@vger.kernel.org>, Romit Dasgupta <ro.m>
Subject: Re: [PATCH] opp: introduce library for device-specific OPPs
Date: Fri, 17 Sep 2010 15:51:58 -0700 [thread overview]
Message-ID: <878w30ugoh.fsf@deeprootsystems.com> (raw)
In-Reply-To: <4C93DC4E.5020506@ti.com> (Nishanth Menon's message of "Fri, 17 Sep 2010 16:23:26 -0500")
Nishanth Menon <nm@ti.com> writes:
> Andrew Morton had written, on 09/17/2010 02:19 PM, the following:
>> On Thu, 16 Sep 2010 20:29:33 -0500
>> Nishanth Menon <nm@ti.com> wrote:
>>
[...]
>>> +void opp_init_cpufreq_table(struct device *dev,
>>> + struct cpufreq_frequency_table **table)
>>> +{
>>> + struct device_opp *dev_opp;
>>> + struct opp *opp;
>>> + struct cpufreq_frequency_table *freq_table;
>>> + int i = 0;
>>> +
>>> + dev_opp = find_device_opp(dev);
>>> + if (IS_ERR(dev_opp)) {
>>> + pr_warning("%s: unable to find device\n", __func__);
>>> + return;
>>> + }
>>> +
>>> + freq_table = kzalloc(sizeof(struct cpufreq_frequency_table) *
>>> + (dev_opp->enabled_opp_count + 1), GFP_ATOMIC);
>>> + if (!freq_table) {
>>> + pr_warning("%s: failed to allocate frequency table\n",
>>> + __func__);
>>> + return;
>>> + }
>>> +
>>> + list_for_each_entry(opp, &dev_opp->opp_list, node) {
>>> + if (opp->enabled) {
>>> + freq_table[i].index = i;
>>> + freq_table[i].frequency = opp->rate / 1000;
>>> + i++;
>>> + }
>>> + }
>>> +
>>> + freq_table[i].index = i;
>>> + freq_table[i].frequency = CPUFREQ_TABLE_END;
>>> +
>>> + *table = &freq_table[0];
>>> +}
>>
>> So we're playing with cpufreq internals here but there's no #ifdef
>> CONFIG_CPUFREQ and there's no Kconfig dependency on cpufreq. That
>> needs fixing I think, if only from a reduce-code-bloat perspective.
>
> Thanks and ouch.. Again missing documentation. Apologies.
> http://marc.info/?l=linux-arm-kernel&m=128473931626114&w=2
>
> c) Dependency of OPP layer is on CONFIG_PM as certain SOCs such as Texas
> Instrument's OMAP support have frameworks to optionally boot at a
> certain opp without needing cpufreq.
>
> This is called "mpurate" bootarg parameter in OMAP framework. I will
> put this under #ifdef CPUFREQ and provide header coverage for the same
> appropriately.
The OPP layer in general is dependent on CONFIG_PM, but the snippit
above is called only by CPUfreq core when CPUfreq is enabled, so at
least that function should be under #ifdef CPUFREQ.
Kevin
next prev parent reply other threads:[~2010-09-17 22:51 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <[PATCH 1/4] OMAP: introduce OPP layer for device-specific OPPs>
2010-09-17 1:29 ` [PATCH] opp: introduce library for device-specific OPPs Nishanth Menon
[not found] ` <1284686973-13993-1-git-send-email-nm@ti.com>
2010-09-17 14:09 ` Aguirre, Sergio
[not found] ` <AANLkTin2fBriymD7p-YfhPL24hMfYttsZBdighCSJxV2@mail.gmail.com>
2010-09-17 15:05 ` Nishanth Menon
[not found] ` <4C9383C8.4020608@ti.com>
2010-09-17 15:59 ` Nishanth Menon
[not found] ` <4C93904A.9000109@ti.com>
2010-09-17 22:45 ` Rafael J. Wysocki
2010-09-17 23:19 ` Nishanth Menon
2010-09-18 19:11 ` Rafael J. Wysocki
[not found] ` <A24693684029E5489D1D202277BE89447260B073@dlee02.ent.ti.com>
2010-09-17 15:30 ` Nishanth Menon
[not found] ` <4C93898B.2070606@ti.com>
2010-09-17 16:11 ` Aguirre, Sergio
2010-09-17 16:15 ` Aguirre, Sergio
[not found] ` <A24693684029E5489D1D202277BE89447260B287@dlee02.ent.ti.com>
2010-09-17 16:20 ` Nishanth Menon
2010-09-17 15:36 ` Mark Brown
[not found] ` <20100917153643.GC29739@sirena.org.uk>
2010-09-17 15:53 ` Nishanth Menon
2010-09-17 16:45 ` Phil Carmody
[not found] ` <4C938EE2.1010307@ti.com>
2010-09-17 15:59 ` Mark Brown
2010-09-17 22:22 ` Rafael J. Wysocki
[not found] ` <201009180022.51011.rjw@sisk.pl>
2010-09-17 22:26 ` Nishanth Menon
[not found] ` <4C93EB1A.7020203@ti.com>
2010-09-17 22:52 ` Rafael J. Wysocki
[not found] ` <20100917155937.GB29596@rakim.wolfsonmicro.main>
2010-09-18 0:37 ` Kevin Hilman
[not found] ` <87hbhnq43x.fsf@deeprootsystems.com>
2010-09-18 10:04 ` Mark Brown
[not found] ` <20100917164543.GI20325@esdhcp04044.research.nokia.com>
2010-09-18 10:08 ` Mark Brown
2010-09-17 19:19 ` Andrew Morton
[not found] ` <20100917121958.1dbb57af.akpm@linux-foundation.org>
2010-09-17 21:23 ` Nishanth Menon
2010-09-17 22:07 ` Rafael J. Wysocki
[not found] ` <4C93DC4E.5020506@ti.com>
2010-09-17 22:51 ` Kevin Hilman [this message]
2010-09-17 23:07 ` Rafael J. Wysocki
2010-09-17 23:33 ` Nishanth Menon
2010-09-18 18:41 ` Rafael J. Wysocki
[not found] ` <201009182041.41675.rjw@sisk.pl>
2010-09-20 15:26 ` Kevin Hilman
[not found] ` <878w2w4erv.fsf@deeprootsystems.com>
2010-09-20 16:38 ` Rafael J. Wysocki
[not found] ` <201009201838.59013.rjw@sisk.pl>
2010-09-20 17:21 ` Kevin Hilman
[not found] ` <87eicoz5yi.fsf@deeprootsystems.com>
2010-09-20 17:35 ` Rafael J. Wysocki
2010-09-19 19:46 ` Mark Brown
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=878w30ugoh.fsf@deeprootsystems.com \
--to=khilman@deeprootsystems.com \
--cc=ak@linux.intel.com \
--cc=eduardo.valentin@nokia.com \
--cc=ext-phil.2.carmody@nokia.com \
--cc=hpa@zytor.com \
--cc=jbarnes@virtuousgeek.org \
--cc=len.brown@intel.com \
--cc=linus.walleij@stericsson.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=madhu.cr@ti.com \
--cc=martin.petersen@oracle.com \
--cc=mjg@redhat.com \
--cc=nm@ti.com \
--cc=saaguirre@ti.com \
--cc=thara@ti.com \
--cc=x0095451@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