From: Kevin Hilman <khilman@ti.com>
To: "Mohammed, Afzal" <afzal@ti.com>
Cc: "linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
"Kristo, Tero" <t-kristo@ti.com>
Subject: Re: [PATCH/RFT 1/1] OMAP2+: cpufreq: scale voltage along with frequency
Date: Tue, 21 Feb 2012 16:06:12 -0800 [thread overview]
Message-ID: <87vcmz3f63.fsf@ti.com> (raw)
In-Reply-To: <C8443D0743D26F4388EA172BF4E2A7A931782571@DBDE01.ent.ti.com> (Afzal Mohammed's message of "Fri, 17 Feb 2012 07:35:55 +0000")
"Mohammed, Afzal" <afzal@ti.com> writes:
> Hi Kevin,
>
> On Fri, Feb 17, 2012 at 00:50:43, Hilman, Kevin wrote:
>> + /* scaling up? scale voltage before frequency */
>> + if (mpu_reg && (freqs.new > freqs.old))
>> + regulator_set_voltage(mpu_reg, volt, volt);
>
> Probably voltage ranges has to be specified, otherwise
> if I understand correctly, if exact voltage 'volt'
> is a value that cannot be set by voltage regulator,
> it may not work properly.
In this case, volt comes from the OPP table, and was requested using a
rounding call into the OPP table, so the resolution problem is handled
there. If 'volt' cannot be set by the regulator, then the OPP tables
are also broken.
Also, in your patch, you only add some offset. If you want to be
approximate, shouldn't you have plus and minus?
IMO, we should let the OPP table handle that, and not the CPUfreq driver.
>> ret = clk_set_rate(mpu_clk, freqs.new * 1000);
>> - freqs.new = omap_getspeed(policy->cpu);
>>
>> + /* scaling down? scale voltage after frequency */
>> + if (mpu_reg && (freqs.new < freqs.old))
>> + regulator_set_voltage(mpu_reg, volt, volt);
>> +
>> + freqs.new = omap_getspeed(policy->cpu);
>
> It would be better to handle error cases too,
> we have a patch for doing DVFS for AM335X as follows
I agree, my version is not very robust in the face of errors from the
regulator framework.
Hoever, I'm not crazy about the extra notifications in your proposed
patch. I think it's cleaner to always pre and post notify. If there's
a failure, the post notify will have the same freq as the pre-notify,
but that's not a big problem.
I'll send an updated patch that follows this approach instead:
- pre notify
- scale volage up
- if fail, goto done
- scale freq
- scale voltage down
- if fail
- scale freq back
- goto done
- SMP jiffies magic
done:
- post notify
Kevin
next prev parent reply other threads:[~2012-02-22 0:06 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-16 19:20 [PATCH/RFT 0/1] MPU DVFS using SMPS regulator driver Kevin Hilman
2012-02-16 19:20 ` [PATCH/RFT 1/1] OMAP2+: cpufreq: scale voltage along with frequency Kevin Hilman
2012-02-16 19:24 ` Jean Pihet
2012-02-16 19:36 ` Kevin Hilman
2012-02-17 10:19 ` Tero Kristo
2012-02-17 7:35 ` Mohammed, Afzal
2012-02-22 0:06 ` Kevin Hilman [this message]
2012-02-22 6:14 ` Mohammed, Afzal
2012-02-22 18:42 ` Kevin Hilman
2012-02-23 5:28 ` Mohammed, Afzal
2012-02-23 7:17 ` Mohammed, Afzal
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=87vcmz3f63.fsf@ti.com \
--to=khilman@ti.com \
--cc=afzal@ti.com \
--cc=linux-omap@vger.kernel.org \
--cc=t-kristo@ti.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.