From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Bill Gatliff <bgat@billgatliff.com>
Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH/RFC] regulator: Reverse the disable sequence in regulator_bulk_disable()
Date: Wed, 25 Jan 2012 13:44:06 +0000 [thread overview]
Message-ID: <20120125134406.GL3687@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <CADkCAuudPtdb04HXMgHzgDpFWrr9xPJu3yMRe9pE4YDLD+_cUw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2320 bytes --]
On Wed, Jan 25, 2012 at 02:35:25PM +0100, Bill Gatliff wrote:
> On Wed, Jan 25, 2012 at 12:57 PM, Mark Brown
> > On Wed, Jan 25, 2012 at 12:35:38PM +0100, Sylwester Nawrocki wrote:
> > guarantees about ordering - in particular when we do the enable we fire
> > off a bunch of threads to bring the regulators up in parallel so the
> Presumably, then, the notifier mechanism will remain positive
> confirmation that the associated regulator has indeed come up? And
The notifiers are called after the enable has finished, yes.
> that multithreading thing will be interesting to implement given
> parent-child relationships of regulator sources at times...
This multithreading thing is already implemented, and has been since
v3.1. It's pretty trivial, it just fires up a bunch of threads in
parallel to call the underlying regulator_enable() API which already
needs locking to handle concurrent users anyway.
> > Whatever driver inspired you to submit this change is therefore probably
> > buggy or fragile at the minute - is it something that's in mainline or
> > next right now?
> I think he's probably dealing with a "VLOGIC <= VDD"-type requirement,
> which isn't uncommon. I'm dealing with it myself right now, actually.
I'd imagine so, that's one of the common cases for requiring sequencing,
but if the driver is using the bulk APIs for this then it's buggy.
> In addition to the sequencing that imposes, it also has implications
> for recalculating VLOGIC when VDD changes--- which means a notifier
> somewhere. I might be convinced that implementing this logic inside
> the API itself might be of benefit, though I don't see right now how
> to do it in a clear and generic way.
I can imagine a bulk set_voltage() that applied constraints and unwound
things when they went wrong but actually working out the values doesn't
feel generic.
> >> The alternatives to directly modifying regulator_bulk_disable() could be:
> I really don't have a problem with the disable order being the reverse
> of the enable order, as it generally follows common sense for people
> who work with e.g. multiple mutexes. I kind of would have expected it
> to be that way, actually.
Right, that's why I applied the patch - I'm just saying we might not
actually wind up implementing that ordering due to the concurrency.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2012-01-25 13:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-25 11:35 [PATCH/RFC] regulator: Reverse the disable sequence in regulator_bulk_disable() Sylwester Nawrocki
2012-01-25 11:57 ` Mark Brown
2012-01-25 13:35 ` Bill Gatliff
2012-01-25 13:44 ` Mark Brown [this message]
2012-01-25 17:20 ` Sylwester Nawrocki
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=20120125134406.GL3687@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=bgat@billgatliff.com \
--cc=linux-kernel@vger.kernel.org \
--cc=s.nawrocki@samsung.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