From: 함명주 <myungjoo.ham@samsung.com>
To: Saravana Kannan <skannan@codeaurora.org>
Cc: 박경민 <kyungmin.park@samsung.com>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-arm-msm@vger.kernel.org" <linux-arm-msm@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: Re: [PATCH] PM / devfreq: Use freq_table for available_frequencies
Date: Tue, 15 Apr 2014 01:36:00 +0000 (GMT) [thread overview]
Message-ID: <8568895.444151397525760132.JavaMail.weblogic@epml02> (raw)
> MyungJoo/Kyungmin,
>
> Bump. Can we accept this patch please?
>
> -Saravana
Nack.
Please note that freq_table is also an optional value, which may
be null.
Besides, please be aware that your code is under rcu_read_lock().
Cheers,
MyungJoo.
ps. I'll send a related patch (avoid accessing null but not-an-error
pointer at other sysfs nodes). Thank you for letting me catch such bugs anyway.
>
>
> On 04/10/2014 07:54 PM, Saravana Kannan wrote:
> > Some devices use freq_table instead of OPP. For those devices, the
> > available_frequencies file shows up empty. Fix that by using freq_table to
> > generate the available_frequencies data when OPP is not present.
> >
> > Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
> > ---
> > drivers/devfreq/devfreq.c | 15 +++++++++++----
> > 1 file changed, 11 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
> > index 2042ec3..a715d15 100644
> > --- a/drivers/devfreq/devfreq.c
> > +++ b/drivers/devfreq/devfreq.c
> > @@ -912,19 +912,26 @@ static ssize_t available_frequencies_show(struct device *d,
> > struct devfreq *df = to_devfreq(d);
> > struct device *dev = df->dev.parent;
> > struct dev_pm_opp *opp;
> > + unsigned int i = 0, max_state = df->profile->max_state;
> > + bool use_opp;
> > ssize_t count = 0;
> > unsigned long freq = 0;
> >
> > rcu_read_lock();
> > + use_opp = dev_pm_opp_get_opp_count(dev) > 0;
> > do {
> > - opp = dev_pm_opp_find_freq_ceil(dev, &freq);
> > - if (IS_ERR(opp))
> > - break;
> > + if (use_opp) {
> > + opp = dev_pm_opp_find_freq_ceil(dev, &freq);
> > + if (IS_ERR(opp))
> > + break;
> > + } else {
> > + freq = df->profile->freq_table[i++];
> > + }
> >
> > count += scnprintf(&buf[count], (PAGE_SIZE - count - 2),
> > "%lu ", freq);
> > freq++;
> > - } while (1);
> > + } while (use_opp || (!use_opp && i < max_state));
> > rcu_read_unlock();
> >
> > /* Truncate the trailing space */
> >
>
>
> --
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> hosted by The Linux Foundation
>
>
>
>
>
>
>
next reply other threads:[~2014-04-15 1:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-15 1:36 함명주 [this message]
2014-04-15 5:16 ` [PATCH] PM / devfreq: Use freq_table for available_frequencies Saravana Kannan
-- strict thread matches above, loose matches on Subject: below --
2014-04-15 6:30 함명주
2014-04-18 10:47 MyungJoo Ham
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=8568895.444151397525760132.JavaMail.weblogic@epml02 \
--to=myungjoo.ham@samsung.com \
--cc=kyungmin.park@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=skannan@codeaurora.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;
as well as URLs for NNTP newsgroup(s).