linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Saravana Kannan <skannan@codeaurora.org>
Cc: Liam Girdwood <lrg@slimlogic.co.uk>,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] regulator: Update consumer state only after set voltage succeeds.
Date: Tue, 21 Dec 2010 16:34:41 +0000	[thread overview]
Message-ID: <20101221163441.GC21871@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <4D0FD85C.1020307@codeaurora.org>

On Mon, Dec 20, 2010 at 02:27:40PM -0800, Saravana Kannan wrote:

> I agree it looks a bit odd and I'm willing to do the code reorg if
> there is a better way. But I definitely wouldn't call this as

See the suggestion I made in the previous mail - try doing it by making
the change, then backing it out again if the attempt fails.

> randomly ignoring a consumer. We are just avoiding the consumer
> that's changing the range from "voting twice". We already send the
> new request thru min/max params.

It's a code clarity issue rather than a correctness issue.  When you're
in the code doing the check it's not terribly obvious why you're
ignoring it, and if you make any changes to the structure here or check
from other places you need to worry about which consumer to ignore.  If
we ever end up wanting to ignore two it'd be fun also...

> Do you have any suggestions for a better way to compute the min/max
> while leaving out a single consumer? I'm very much open to do that.

It seems better to arrange things so we don't ignore a consumer so the
check function doesn't need to worry about what it's checking, it just
goes and does it.

      reply	other threads:[~2010-12-21 16:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-17 22:44 [PATCH] regulator: Update consumer state only after set voltage succeeds Saravana Kannan
2010-12-20 12:39 ` Mark Brown
2010-12-20 22:27   ` Saravana Kannan
2010-12-21 16:34     ` Mark Brown [this message]

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=20101221163441.GC21871@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@slimlogic.co.uk \
    --cc=skannan@codeaurora.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).