From: MyungJoo Ham <myungjoo.ham@samsung.com>
To: 최찬우 <cw00.choi@samsung.com>, 박경민 <kyungmin.park@samsung.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>
Subject: Re: [PATCH 4/6] PM / devfreq: Set the freq_table of devfreq device
Date: Mon, 23 Nov 2015 06:44:08 +0000 (GMT) [thread overview]
Message-ID: <693585704.122261448261048874.JavaMail.weblogic@epmlwas06a> (raw)
> This patch initialize the freq_table array of each devfreq device by using
> the devfreq_set_freq_table(). If freq_table is NULL, the devfreq framework
> is not able to support the frequency transtion information through sysfs.
>
> The OPP core uses the integer type for the number of opps in the opp list
> and uses the 'unsigned long' type for each frequency. So, this patch modifies
> the type of some variable as following:
> - the type of freq_table : unsigned int -> unsigned long
> - the type of max_state : unsigned int -> int
I have some comments on this patch described below.
I've created an 'updated' patch based on this at:
https://git.kernel.org/cgit/linux/kernel/git/mzx/devfreq.git/commit/?h=for-rafael&id=9e35a6caf143cd77f14d5e62269ed00ea1775854
It will be applied as suggested on the link above unless you
have strong reason to make max_state signed.
[]
> +static void devfreq_set_freq_table(struct devfreq *devfreq)
> +{
> + struct devfreq_dev_profile *profile = devfreq->profile;
> + struct dev_pm_opp *opp;
> + unsigned long freq;
# - int i;
+ int i, count;
> +
> + /* Initialize the freq_table from OPP table */
# - profile->max_state = dev_pm_opp_get_opp_count(devfreq->dev.parent);
# - if (profile->max_state <= 0)
# - return;
+ count = dev_pm_opp_get_opp_count(devfreq->dev.parent);
+ if (count < 0)
+ return;
If dev_pm_opp_get_opp_count() gives us an error (probably, this
device does not support OPP and does not give freq_table for the
statistics support), we do not need to store that error in
profile->max_state. We just need to return. (no need to be
signed.)
[]
> - len += sprintf(buf + len, "%8u",
> + len += sprintf(buf + len, "%8ld",
> devfreq->profile->freq_table[i]);
[]
> - len += sprintf(buf + len, "%8u:",
> + len += sprintf(buf + len, "%8ld:",
> devfreq->profile->freq_table[i]);
freq_table is unsigned.
next reply other threads:[~2015-11-23 6:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-23 6:44 MyungJoo Ham [this message]
-- strict thread matches above, loose matches on Subject: below --
2015-11-23 7:29 [PATCH 4/6] PM / devfreq: Set the freq_table of devfreq device MyungJoo Ham
2015-11-23 8:51 ` Chanwoo Choi
2015-11-19 8:17 [PATCH 0/6] PM / devfreq: Clean code and add set the freq_table array Chanwoo Choi
2015-11-19 8:17 ` [PATCH 4/6] PM / devfreq: Set the freq_table of devfreq device Chanwoo Choi
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=693585704.122261448261048874.JavaMail.weblogic@epmlwas06a \
--to=myungjoo.ham@samsung.com \
--cc=cw00.choi@samsung.com \
--cc=kyungmin.park@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@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