From: "MyungJoo Ham" <myungjoo.ham@samsung.com>
To: "Lin Huang" <hl@rock-chips.com>
Cc: "Chanwoo Choi" <cw00.choi@samsung.com>,
"dianders@chromium.org" <dianders@chromium.org>,
"linux-rockchip@lists.infradead.org"
<linux-rockchip@lists.infradead.org>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
"dbasehore@chromium.org" <dbasehore@chromium.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [RESEND PATCH v3 1/2] PM/devfreq: add suspend frequency support
Date: Tue, 08 Nov 2016 02:06:58 +0000 [thread overview]
Message-ID: <960394560.458817.1478570818491.JavaMail.weblogic@ep2ml102b> (raw)
In-Reply-To: CGME20161107063403epcas5p4f8d0d95b9a997ca7bf2b2702c3e5d337@epcas5p4.samsung.com
[-- Attachment #1: Type: text/plain, Size: 2160 bytes --]
> Add suspend frequency support and if needed set it to
> the frequency obtained from the suspend opp (can be defined
> using opp-v2 bindings and is optional).
>
> Signed-off-by: Lin Huang <hl@rock-chips.com>
> ---
> Changes in v2:
> - use update_devfreq() instead devfreq_update_status()
> Changes in v3:
> - fix build error
>
> drivers/devfreq/devfreq.c | 18 ++++++++++++++++--
> drivers/devfreq/governor_simpleondemand.c | 9 +++++++++
> include/linux/devfreq.h | 8 ++++++++
> 3 files changed, 33 insertions(+), 2 deletions(-)
>
>
[]
> +void devfreq_opp_get_suspend_opp(struct device *dev, struct devfreq *devfreq)
> +{
> + struct dev_pm_opp *suspend_opp;
> +
> + rcu_read_lock();
> + suspend_opp = dev_pm_opp_get_suspend_opp(dev);
> + if (suspend_opp)
> + devfreq->suspend_freq = dev_pm_opp_get_freq(suspend_opp);
> + rcu_read_unlock();
> +}
> +EXPORT_SYMBOL(devfreq_opp_get_suspend_opp);
> +
Why do we need this function?
This could be done at the init time (devfreq_add_device).
Plus, when it does not have dev_pm_opp_get_suspend_opp() available,
> /**
> * devfreq_register_opp_notifier() - Helper function to get devfreq notified
> * for any changes in the OPP availability
> diff --git a/drivers/devfreq/governor_simpleondemand.c b/drivers/devfreq/governor_simpleondemand.c
> index ae72ba5..a3efee0 100644
> --- a/drivers/devfreq/governor_simpleondemand.c
> +++ b/drivers/devfreq/governor_simpleondemand.c
> @@ -29,6 +29,15 @@ static int devfreq_simple_ondemand_func(struct devfreq *df,
> struct devfreq_simple_ondemand_data *data = df->data;
> unsigned long max = (df->max_freq) ? df->max_freq : UINT_MAX;
>
> + /*
> + * if devfreq in suspend status and have suspend_freq,
> + * the frequency need to set to suspend_freq
> + */
> + if (df->stop_polling && df->suspend_freq) {
> + *freq = df->suspend_freq;
> + return 0;
> + }
> +
Why are you adding this? "Stop polling" does not necessarily mean that
we are doing suspend-to-RAM/disk. It may really mean just to stop at
the current frequency.
Cheers,
MyungJoo
prev parent reply other threads:[~2016-11-08 2:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-07 6:33 [RESEND PATCH v3 0/2] set specific ddr frequency when stop ddr dvfs Lin Huang
2016-11-07 6:33 ` [RESEND PATCH v3 1/2] PM/devfreq: add suspend frequency support Lin Huang
2016-11-07 6:33 ` [RESEND PATCH v3 2/2] PM/devfreq: rk3399: get devfreq suspend frequency Lin Huang
[not found] ` <CGME20161107063403epcas5p4f8d0d95b9a997ca7bf2b2702c3e5d337@epcas5p4.samsung.com>
2016-11-08 2:06 ` MyungJoo Ham [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=960394560.458817.1478570818491.JavaMail.weblogic@ep2ml102b \
--to=myungjoo.ham@samsung.com \
--cc=cw00.choi@samsung.com \
--cc=dbasehore@chromium.org \
--cc=dianders@chromium.org \
--cc=hl@rock-chips.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.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).