From: Viresh Kumar <viresh.kumar@linaro.org>
To: Markus Mayer <markus.mayer@broadcom.com>
Cc: Markus Mayer <code@mmayer.net>,
"Rafael J . Wysocki" <rjw@rjwysocki.net>,
Power Management List <linux-pm@vger.kernel.org>,
Broadcom Kernel List <bcm-kernel-feedback-list@broadcom.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] cpufreq: brcmstb-cpufreq: CPUfreq driver for older Broadcom STB SoCs
Date: Fri, 18 Nov 2016 08:39:34 +0530 [thread overview]
Message-ID: <20161118030934.GB3110@vireshk-i7> (raw)
In-Reply-To: <CAGt4E5tguK-wCapbjgP3_b5wbmxVW-W=MnfpPx_5AdrxUWmRnQ@mail.gmail.com>
On 17-11-16, 10:38, Markus Mayer wrote:
> No, because I am trying to find the lowest frequency that doesn't
> require safe mode and it's looping through the table from highest to
> lowest. So there could still be a lower frequency after the current
> one that doesn't require safe mode.
>
> What I can do, however, is something like this:
>
> static ssize_t show_brcmstb_safe_freq(struct cpufreq_policy *policy, char *buf)
> {
> struct cpufreq_frequency_table *entry;
> unsigned int safe_freq = 0;
>
> cpufreq_for_each_valid_entry(entry, policy->freq_table) {
> if (!(entry->driver_data & BRCMSTB_TBL_SAFE_MODE))
> safe_freq = entry->frequency;
> }
>
> return sprintf(buf, "%u\n", safe_freq);
> }
>
> This is using the existing data from the frequency table rather than
> re-generating it on the fly by calling freq_requires_safe_mode().
> All my allocations are managed (i.e. using devm* functions), so
> cleanup should be automatic. Do I still need one?
> It's using for a clock node (brcm,brcmstb-cpu-clk-div) which exists
> independently of this driver.
All these seem fine to me.
--
viresh
prev parent reply other threads:[~2016-11-18 3:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-10 23:56 [PATCH] cpufreq: brcmstb-cpufreq: CPUfreq driver for older Broadcom STB SoCs Markus Mayer
2016-11-11 6:14 ` kbuild test robot
2016-11-11 19:00 ` Markus Mayer
2016-11-17 9:02 ` Viresh Kumar
2016-11-17 18:38 ` Markus Mayer
2016-11-18 3:09 ` Viresh Kumar [this message]
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=20161118030934.GB3110@vireshk-i7 \
--to=viresh.kumar@linaro.org \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=code@mmayer.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=markus.mayer@broadcom.com \
--cc=rjw@rjwysocki.net \
/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).