From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: David Collins <collinsd@codeaurora.org>
Cc: Liam Girdwood <lrg@slimlogic.co.uk>,
linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: Deadlock scenario in regulator core
Date: Tue, 22 Mar 2011 23:45:45 +0000 [thread overview]
Message-ID: <20110322234544.GA2529@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <4D893125.3030703@codeaurora.org>
On Tue, Mar 22, 2011 at 04:30:45PM -0700, David Collins wrote:
> On 03/22/2011 03:31 PM, Mark Brown wrote:
> > + int disret;
> > +
> > + if (rdev->supply) {
> > + ret = regulator_enable(rdev->supply);
> This should be _regulator_enable instead of regulator_enable. There will
Oh, feh. The supply stuff would generally be easier if it were
consumers as you'd expect, the special casing just makes things more
fragile. It's not clear to me that the best approach here isn't just to
make the supplies have regular consumer structs so we can do things like
this.
> also need to be a mutex lock and unlock around it for rdev->supply->mutex.
Unless we implement the above change - you're assuming that the change
to the unlocked enable is the best one.
> I think that it needs to iterate through all supplies in the chain
> similar to how it is done in regulator_disable.
The current code (if it had compiled) would deal with that through
recursion.
> This should be _regulator_disable instead of regulator_disable. There
> will also need to be a mutex lock and unlock around it for
> rdev->supply->mutex. Additionally, a while loop is needed to disable all
> supplies in the chain (same as in regulator_disable).
Again, no loop needed with the code as written as it's recursive.
next prev parent reply other threads:[~2011-03-22 23:45 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-22 22:02 Deadlock scenario in regulator core David Collins
2011-03-22 22:31 ` Mark Brown
2011-03-22 23:30 ` David Collins
2011-03-22 23:45 ` Mark Brown [this message]
2011-03-22 22:37 ` Steven Rostedt
2011-03-22 23:08 ` David Collins
2011-03-22 23:19 ` Steven Rostedt
2011-03-22 23:41 ` David Collins
2011-03-23 0:07 ` Steven Rostedt
2011-03-23 0:11 ` Mark Brown
2011-03-25 10:55 ` Peter Zijlstra
2011-03-23 0:01 ` Mark Brown
2011-03-23 0:38 ` Steven Rostedt
2011-03-23 10:42 ` Mark Brown
2011-03-25 10:59 ` Peter Zijlstra
2011-03-22 22:43 ` 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=20110322234544.GA2529@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=collinsd@codeaurora.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lrg@slimlogic.co.uk \
/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).