linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@secretlab.ca>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Jassi Brar <jassisinghbrar@gmail.com>,
	Jassi Brar <jassi.brar@samsung.com>,
	David Brownell <dbrownell@users.sourceforge.net>,
	spi-devel-general@lists.sourceforge.net,
	patches@opensource.wolfsonmicro.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] spi/spi_s3c64xx: Move to subsys_initcall()
Date: Wed, 8 Sep 2010 10:44:32 -0600	[thread overview]
Message-ID: <20100908164432.GG3686@angua.secretlab.ca> (raw)
In-Reply-To: <20100908162251.GA15562@rakim.wolfsonmicro.main>

On Wed, Sep 08, 2010 at 05:22:51PM +0100, Mark Brown wrote:
> On Wed, Sep 08, 2010 at 10:12:45AM -0600, Grant Likely wrote:
> 
> [reflowed into 80 columns]

Sorry about that.  I'm in the process of switching to mutt+vim for my
mailer.  gmail is just not efficient enough when managing patches.

> > ... but it seems to me that there is a systemic problem in the way the
> > driver model is being used if SPI (and I2C) bus drivers need to be
> > 'special' in this regard.  What are the ordering requirements on things
> > like PMICs?  (My uneducated assumption is that other devices depend on
> > them being enabled before being probed.)  Would it be better to have a
> 
> Pretty much this, yes - if you might want to turn on your supplies
> when you're probed it's rather helpful if the subsystem needed to
> control the regulators is available when you probe.
> 
> > mechanism to defer probing on certain devices until other devices are
> > probed?  Then the relationships could be made explicit instead of the
> > rather coarse-grained (and potentially fragile) approach of changing the
> > init order.
> 
> That would be much nicer (and this is far from the only case where we
> need to deal with it) but it's a substantial change to core kernel
> infrastructure so it's being worked around like this.  Given how all the
> discussions about sorting and dependencies for suspend and resume went
> it might be an uphill struggle to do much more, especially while we are
> able to continue to deal with things fairly easily using the current
> infrastructure.
> 
> Doing dependencies could get pretty complicated, especially once you
> handle optional dependencies ("is this missing because it didn't probe
> yet or because it's just not there?") so it's not entirely clear to me
> that it's worth the hassle.

I think it might be doable.  I had a similar problem with Ethernet
MACs and PHYs where the PHY was on a completely separate bus from the
MAC with zero guarantees on probe order.  I had some code that made it
simple to use a bus notifier to defer MAC initialization until the
required phy turned up and was probed.  I eventually abandoned it
because accessing the PHY could be deferred until .ndo_open() time.
However, it would be easy to resurrect, and might be a reasonable
solution.  At the very least it is worth an investigation.

g.

  reply	other threads:[~2010-09-08 16:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-07 10:29 [PATCH] spi/spi_s3c64xx: Move to subsys_initcall() Mark Brown
2010-09-08  4:55 ` Jassi Brar
2010-09-08  9:12   ` Mark Brown
2010-09-08  9:37     ` Jassi Brar
2010-09-08 16:12       ` Grant Likely
2010-09-08 16:22         ` Mark Brown
2010-09-08 16:44           ` Grant Likely [this message]
2010-09-08 16:55             ` 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=20100908164432.GG3686@angua.secretlab.ca \
    --to=grant.likely@secretlab.ca \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=dbrownell@users.sourceforge.net \
    --cc=jassi.brar@samsung.com \
    --cc=jassisinghbrar@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@opensource.wolfsonmicro.com \
    --cc=spi-devel-general@lists.sourceforge.net \
    /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).