cpufreq Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Shawn Guo <shawn.guo@linaro.org>
To: Eric Nelson <eric.nelson@boundarydevices.com>
Cc: cpufreq@vger.kernel.org, linux-pm@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	"Rafael J. Wysocki" <rjw@sisk.pl>
Subject: Re: [PATCH v3 1/2] cpufreq: add imx6q-cpufreq driver
Date: Tue, 15 Jan 2013 22:53:57 +0800	[thread overview]
Message-ID: <20130115145356.GD6574@S2101-09.ap.freescale.net> (raw)
In-Reply-To: <50F427A7.7000203@boundarydevices.com>

Hi Eric,

On Mon, Jan 14, 2013 at 08:43:35AM -0700, Eric Nelson wrote:
> >+	/* scaling up?  scale voltage before frequency */
> >+	if (freqs.new > freqs.old) {
> >+		ret = regulator_set_voltage_tol(arm_reg, volt, 0);
> >+		if (ret) {
> >+			dev_err(cpu_dev, "failed to scale voltage up: %d\n", ret);
> >+			return ret;
> >+		}
> >+
> >+		/*
> >+		 * Need to increase vddpu and vddsoc for safety
> >+		 * if we are about to run at 1.2 GHz.
> >+		 */
> >+		if (freqs.new == FREQ_1P2_GHZ / 1000) {
> >+			regulator_set_voltage_tol(pu_reg,
> >+					PU_SOC_VOLTAGE_HIGH, 0);
> >+			regulator_set_voltage_tol(soc_reg,
> >+					PU_SOC_VOLTAGE_HIGH, 0);
> >+		}
> 
> I believe you need a delay here to let the LDOs ramp before changing
> the CPU frequency.
> 
> According to the i.MX6Q reference manual, with the factory default
> step times in PMU_MISC2 and the maximum voltage swing is
> 	1.25V (1.2GHz) - 0.95V (400MHz) == 0.325V
> 
> or 13 steps at 25mV.
> 
> The default step time is 0.000021333s (512 clocks at 24MHz), so
> the worst case delay needed is ~280uS.
> 
> This could also be done in the regulator driver, but that may
> require multiple delays if multiple rails are changed.
> 
I initially thought that regulator driver should take care of it.  But
now I agree with you that we can do it here for the least latency.

Will roll it into v4.  Thanks.

Shawn


  reply	other threads:[~2013-01-15 14:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-14 15:02 [PATCH v3 0/2] Add imx6q-cpufreq driver support Shawn Guo
2013-01-14 15:02 ` [PATCH v3 1/2] cpufreq: add imx6q-cpufreq driver Shawn Guo
2013-01-14 15:43   ` Eric Nelson
2013-01-15 14:53     ` Shawn Guo [this message]
2013-01-14 15:02 ` [PATCH v3 2/2] ARM: imx: enable imx6q-cpufreq support Shawn Guo

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=20130115145356.GD6574@S2101-09.ap.freescale.net \
    --to=shawn.guo@linaro.org \
    --cc=cpufreq@vger.kernel.org \
    --cc=eric.nelson@boundarydevices.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@sisk.pl \
    /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