From: andy@warmcat.com (Andy Green)
To: linux-arm-kernel@lists.infradead.org
Subject: Device probe order (i2c regulator vs. platform device)
Date: Wed, 24 Mar 2010 12:29:41 +0000 [thread overview]
Message-ID: <4BAA05B5.9000800@warmcat.com> (raw)
In-Reply-To: <20100324121930.GD5831@opensource.wolfsonmicro.com>
On 03/24/10 12:19, Somebody in the thread at some point said:
(snipped what's covered elsewhere)
> For the bus controller itself there's a much more general issue which
> most platforms resolve by either using the _noirq suspend operations,
> not suspending at all (on some platforms there's just not anything to
> do), or suspending as part of the arch suspend work. I2C tends to be
> used in enough applications that cause sequencing issues that this is
> required anyway and has often been solved before anyone tries to use
> software controlled regulators.
I dunno what that solution looks like but I doubt it's very pretty. I
have several times seen "other driver is in suspend" flags that defeat
the operation if so, then there is unpredictable behaviour (even if some
deadlock is avoided).
If the devices are explicit children of the PMU then there can never be
a race about doing i2c-based activity that the PMU relys on.
> Note also that the suspend and resume ordering flow from the ordering
> with which things appear at system startup so solving the problem at
> startup tends to mean you've coped with things well enough. See the
> thread on allowing us to explicitly specify interdependencies for the
> device graph that occurred during the last release cycle for Linus'
> analysis of this.
Yeah I agree totally, but to enforce the system startup order in a solid
way it's also needed to have probe callbacks.
>> To do that, you need a post-PMU-probe callback into the machine
>> file, or some even nicer API arrangement you're in a good position
>> to invent :-)
>
> This isn't really regulator specific, it's a generic problem that
> affects other areas too (this sort of multi-chip arrangement is hardly
> unusual in embedded cases, and I understand there are some similar
> issues on PCs) and the regulator API doesn't have the information to
> deal with anyway. You're really looking for something at the device
> core level here.
That's right, you just reminded me of another non-PMU race where
framebuffer device raced on LCM controller chip driver suspend, and IIRC
framebuffer device again raced on backlight which raced on PMU
availability to set the level.
All of that nightmare dispersed into order once the device hierarchy was
set properly (which required probe callbacks at init-time).
So I think you have it correct, some kind of generic probe callback
allowing init staging and parent setting would solve everything.
-Andy
prev parent reply other threads:[~2010-03-24 12:29 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-24 7:10 Device probe order (i2c regulator vs. platform device) Marek Szyprowski
2010-03-24 9:19 ` Andy Green
2010-03-24 11:11 ` Marek Szyprowski
2010-03-24 12:50 ` Andy Green
2010-03-24 13:11 ` Mark Brown
2010-03-24 13:22 ` Andy Green
2010-03-24 11:32 ` Mark Brown
2010-03-24 12:11 ` Andy Green
2010-03-24 14:01 ` Mark Brown
2010-03-24 14:38 ` Andy Green
2010-03-25 10:22 ` Mark Brown
2010-03-25 10:52 ` Andy Green
2010-03-24 10:21 ` Mark Brown
2010-03-24 10:57 ` Andy Green
2010-03-24 11:02 ` Marek Szyprowski
2010-03-24 11:08 ` Mark Brown
2010-03-24 11:27 ` Andy Green
2010-03-24 12:19 ` Mark Brown
2010-03-24 12:29 ` Andy Green [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=4BAA05B5.9000800@warmcat.com \
--to=andy@warmcat.com \
--cc=linux-arm-kernel@lists.infradead.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).