mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Alan Stern <stern@rowland.harvard.edu>,
	Linus Walleij <linus.ml.walleij@gmail.com>,
	linux-kernel@vger.kernel.org,
	Linus Walleij <linus.walleij@stericsson.com>,
	Liam Girdwood <lrg@slimlogic.co.uk>,
	Samuel Ortiz <sameo@linux.intel.com>,
	linux-arm-kernel@lists.arm.linux.org.uk
Subject: Re: [PATCH] AB3100 regulator support v1
Date: Tue, 1 Sep 2009 13:12:12 +0100	[thread overview]
Message-ID: <20090901121212.GI19719@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20090830190102.GA4235@sirena.org.uk>

On Sun, Aug 30, 2009 at 08:01:07PM +0100, Mark Brown wrote:
> On Sun, Aug 30, 2009 at 12:27:32PM -0400, Alan Stern wrote:
> > On Sun, 30 Aug 2009, Mark Brown wrote:
> 
> > > On the face of it (and without having actually looked at a running
> > > system or anything yet) I'm rather surprised that platform based MFD
> > > drivers aren't running into this issue more often.  CCing in Alan who
> > > made the change.
> 
> > I'm not at all familiar with the detailed issues involved here.  
> > Perhaps because of this, I don't see why there's any reason for
> > deadlocking.  __driver_attach() is invoked when a new driver is
> > registered; to avoid problems all you have to do is make sure you
> > aren't holding any device locks when you register a driver.
> 
> Ah, it's platform_driver_probe() that's causing issues.  When it is used
> the devices need to have been registered previously since the driver
> probe function isn't kept around.  In order to do this for the child
> device the driver for the subdevice has to be registered from within the
> probe function of the parent, which is itself happening within the
> parent device registration.

The simple solution to this is to avoid platform_driver_probe() in this
case.  platform_driver_probe() assumes that the device has already been
registered.  If it hasn't, then it really doesn't work.

Rather than plastering over platform_driver_probe() by playing games with
locks, it would be much better to do things the standard way and leave
the sub device probe code around such that it can cope with devices
registered after driver initialization.

      parent reply	other threads:[~2009-09-01 12:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-20 22:11 Linus Walleij
2009-08-21 10:56 ` Mark Brown
2009-08-29 23:03   ` Linus Walleij
2009-08-30  0:37     ` Linus Walleij
2009-08-30 10:08       ` Mark Brown
2009-08-30 10:34     ` Mark Brown
2009-08-30 12:51       ` Linus Walleij
2009-08-30 13:03         ` Mark Brown
2009-08-30 16:27       ` Alan Stern
2009-08-30 19:01         ` Mark Brown
2009-08-31 20:27           ` Alan Stern
2009-09-01 12:12           ` Russell King - ARM Linux [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=20090901121212.GI19719@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=linus.ml.walleij@gmail.com \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@slimlogic.co.uk \
    --cc=sameo@linux.intel.com \
    --cc=stern@rowland.harvard.edu \
    /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

all inboxes | Powered by JetHome®