From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753840AbdDEID7 (ORCPT ); Wed, 5 Apr 2017 04:03:59 -0400 Received: from metis.ext.4.pengutronix.de ([92.198.50.35]:47357 "EHLO metis.ext.4.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752936AbdDEID6 (ORCPT ); Wed, 5 Apr 2017 04:03:58 -0400 Message-ID: <1491379425.2904.0.camel@pengutronix.de> Subject: Re: [PATCH v2 2/4] cpufreq: imx6q: Set max suspend_freq to avoid changes during suspend From: Lucas Stach To: Leonard Crestez Cc: Viresh Kumar , "Rafael J. Wysocki" , Sascha Hauer , Shawn Guo , Mark Brown , Robin Gong , Anson Huang , Irina Tirdea , Fabio Estevam , Octavian Purdila , Liam Girdwood , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Date: Wed, 05 Apr 2017 10:03:45 +0200 In-Reply-To: <5f61b819733127ddc7d41e82bf703a355c845b49.1491324640.git.leonard.crestez@nxp.com> References: <5f61b819733127ddc7d41e82bf703a355c845b49.1491324640.git.leonard.crestez@nxp.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.9-1+b1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2001:67c:670:100:fa0f:41ff:fe58:4010 X-SA-Exim-Mail-From: l.stach@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Dienstag, den 04.04.2017, 20:04 +0300 schrieb Leonard Crestez: > If the cpufreq driver tries to modify voltage/freq during suspend/resume > it might need to control an external PMIC via I2C or SPI but those > devices might be already suspended. This issue is likely to happen > whenever the LDOs have their vin-supply set. > > To avoid this scenario we just increase cpufreq to the maximum before > suspend. > > Signed-off-by: Leonard Crestez Reviewed-by: Lucas Stach > --- > drivers/cpufreq/imx6q-cpufreq.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c > index be90ee3..786122e 100644 > --- a/drivers/cpufreq/imx6q-cpufreq.c > +++ b/drivers/cpufreq/imx6q-cpufreq.c > @@ -161,8 +161,13 @@ static int imx6q_set_target(struct cpufreq_policy *policy, unsigned int index) > > static int imx6q_cpufreq_init(struct cpufreq_policy *policy) > { > + int ret; > + > policy->clk = arm_clk; > - return cpufreq_generic_init(policy, freq_table, transition_latency); > + ret = cpufreq_generic_init(policy, freq_table, transition_latency); > + policy->suspend_freq = policy->max; > + > + return ret; > } > > static struct cpufreq_driver imx6q_cpufreq_driver = { > @@ -173,6 +178,7 @@ static struct cpufreq_driver imx6q_cpufreq_driver = { > .init = imx6q_cpufreq_init, > .name = "imx6q-cpufreq", > .attr = cpufreq_generic_attr, > + .suspend = cpufreq_generic_suspend, > }; > > static int imx6q_cpufreq_probe(struct platform_device *pdev)