linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leonard Crestez <leonard.crestez@nxp.com>
To: Anson Huang <anson.huang@nxp.com>,
	"viresh.kumar@linaro.org" <viresh.kumar@linaro.org>
Cc: "rjw@rjwysocki.net" <rjw@rjwysocki.net>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>,
	"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	"festevam@gmail.com" <festevam@gmail.com>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	dl-linux-imx <linux-imx@nxp.com>,
	Lucas Stach <l.stach@pengutronix.de>
Subject: Re: [PATCH] cpufreq: imx-cpufreq-dt: Assign max supported frequency as suspend frequency
Date: Mon, 8 Jul 2019 11:04:01 +0000	[thread overview]
Message-ID: <VI1PR04MB5055565FFF1241B61B47F22AEEF60@VI1PR04MB5055.eurprd04.prod.outlook.com> (raw)
In-Reply-To: 20190708074624.910-1-Anson.Huang@nxp.com

On 7/8/2019 10:55 AM, Anson.Huang@nxp.com wrote:
> To reduce the suspend/resume latency, CPU's max supported frequency
> should be used during low level suspend/resume phase, "opp-suspend"
> property is NOT feasible since OPP defined in DT could be NOT supported
> according to speed garding and market segment fuse settings. So we
> can assign the cpufreq policy's suspend_freq with max available
> frequency provided by cpufreq driver.
> 
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>

> diff --git a/drivers/cpufreq/imx-cpufreq-dt.c b/drivers/cpufreq/imx-cpufreq-dt.c

> +static int __init imx_cpufreq_dt_setup_suspend_opp(void)
> +{
> +	struct cpufreq_policy *policy = cpufreq_cpu_get(0);
> +
> +	policy->suspend_freq = cpufreq_quick_get_max(0);
> +
> +	return 0;
> +}
> +late_initcall(imx_cpufreq_dt_setup_suspend_opp);

The imx-cpufreq-dt driver is built as a module by default and this patch 
produces an error:

In file included from ../drivers/cpufreq/imx-cpufreq-dt.c:11:
../include/linux/module.h:131:42: error: redefinition of ‘__inittest’
   static inline initcall_t __maybe_unused __inittest(void)  \
                                           ^~~~~~~~~~
../include/linux/device.h:1656:1: note: in expansion of macro ‘module_init’
  module_init(__driver##_init); \
  ^~~~~~~~~~~

As far as I can tell late_initcall is not supported for modules.

Viresh: "max freq as suspend freq" is something that could be useful for 
other SOC families. The hardware can suspend at any freq; it's just that 
the highest one makes sense because it makes suspend/resume slightly faster.

Could this behavior be pushed to cpufreq-dt as a bool flag inside struct 
cpufreq_dt_platform_data?

Only a few other platforms use this, most others pass NULL like imx. But 
passing custom SOC-specific flags to cpufreq-dt makes a lot of sense

--
Regards,
Leonard


  reply	other threads:[~2019-07-08 11:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-08  7:46 [PATCH] cpufreq: imx-cpufreq-dt: Assign max supported frequency as suspend frequency Anson.Huang
2019-07-08 11:04 ` Leonard Crestez [this message]
2019-07-09  3:09   ` Anson Huang
2019-07-09  7:24     ` Anson Huang

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=VI1PR04MB5055565FFF1241B61B47F22AEEF60@VI1PR04MB5055.eurprd04.prod.outlook.com \
    --to=leonard.crestez@nxp.com \
    --cc=anson.huang@nxp.com \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=l.stach@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=viresh.kumar@linaro.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).