From: "Saravana Kannan" <skannan@codeaurora.org>
To: "Mark Brown" <broonie@opensource.wolfsonmicro.com>
Cc: "Saravana Kannan" <skannan@codeaurora.org>,
"Liam Girdwood" <lrg@slimlogic.co.uk>,
linux-kernel@vger.kernel.org,
patches@opensource.wolfsonmicro.com,
"Mark Brown" <broonie@opensource.wolfsonmicro.com>
Subject: Re: [PATCH 2/2] regulator: Optimise out noop voltage changes
Date: Thu, 16 Dec 2010 17:46:07 -0800 (PST) [thread overview]
Message-ID: <3bf69fb1c4f33c8a1f405b4f05ba1a59.squirrel@www.codeaurora.org> (raw)
> Reported-by: Saravana Kannan <skannan@codeaurora.org>
Thanks
> int regulator_set_voltage(struct regulator *regulator, int min_uV, int
> max_uV)
> {
> struct regulator_dev *rdev = regulator->rdev;
> - int ret;
> + int ret = 0;
>
> mutex_lock(&rdev->mutex);
>
> + /* If we're setting the same range as last time the change
> + * should be a noop (some cpufreq implementations use the same + *
voltage for multiple frequencies, for example).
> + */
> + if (regulator->min_uV == min_uV && regulator->max_uV == max_uV)
+ goto out;
> +
I have only web email access now. Sorry for the vague references to code
that follow.
When you reported a merge/rebase issue the other day, I didn't respond
with a similar patch for the following reasons:
1. With support for multiple consumers, we can further optimize and call
the producer's set voltage only if the final voltage range changes. So if
consumer A asks for (2.0 - 5.0) and consumer B keeps changing between (1.0
- 5.0) and (1.5 - 5.0), then we can completely no-op all of consumer B's
calls.
2. When I was trying to do the above this Sunday, I also noticed what
looks like a bug or at least an unpleasant behavior. A consumer's min_uV
and max_uV were being updated (for-next around Dec 12th) before calling
the producer's set voltage. So, in the above example, if consumer C comes
in and asks for (10 - 15), it will prevent the producer voltage from ever
changing again. All of consumer A and B's future requests will result in a
failure since min_uV > max_uV when you do the consumer aggregation.
Hope my vague references to code is good enough to point you the code I'm
talking about. May be you already fixed it too!
Thanks,
Saravana
--
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
next reply other threads:[~2010-12-17 1:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-17 1:46 Saravana Kannan [this message]
2010-12-17 11:44 ` [PATCH 2/2] regulator: Optimise out noop voltage changes Mark Brown
2010-12-18 5:50 ` Saravana Kannan
-- strict thread matches above, loose matches on Subject: below --
2010-12-16 15:49 [PATCH 1/2] regulator: Add API to re-apply voltage to hardware Mark Brown
2010-12-16 15:49 ` [PATCH 2/2] regulator: Optimise out noop voltage changes Mark Brown
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=3bf69fb1c4f33c8a1f405b4f05ba1a59.squirrel@www.codeaurora.org \
--to=skannan@codeaurora.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lrg@slimlogic.co.uk \
--cc=patches@opensource.wolfsonmicro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox