public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	linux-mmc <linux-mmc@vger.kernel.org>,
	Kevin Hilman <khilman@kernel.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Aaron Lu <aaron.lu@intel.com>
Subject: Re: [PATCH] mmc: core: Attach PM domain prior probing of SDIO func driver
Date: Tue, 2 Jun 2015 09:51:01 +0100	[thread overview]
Message-ID: <20150602085101.GY2067@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <CAPDyKFr+SucSGZRigc4a6zei9TR4f5TuNHXTqWDDj2YQK1yn5A@mail.gmail.com>

On Tue, Jun 02, 2015 at 09:54:13AM +0200, Ulf Hansson wrote:
> On the other hand, the "long term plan" is to have PM domain pointers
> assigned at device registration point instead of at probe. Since
> driver core then invokes the ->activate|sync|dismiss() callbacks, it
> will make the dev_pm_domain_attach|detach() APIs redundant.

How does that work if the PM domain doesn't exist yet, because the driver
supplying it hasn't had its own device probed ?

You can't return -EPROBE_DEFER to anything that isn't being called via a
driver's probe function.  So, when the OF code is scanning the device
tree, creating the various struct device's, returning -EPROBE_DEFER will
cause it to fail to register that struct device and there is no mechanism
to retry.

Also, your idea above goes against the grain that other resources are
heading - that is, towards probe time resolution of resources.  IRQ
resources have the same problem, and this has caused real problems on
platforms to have the IRQ resources resolved to a number at registration
time.

To me, your idea sounds like the wrong approach and unworkable.

What would resolve that would be to have the device registration succeed,
but also to scan all devices in the system when a PM domain is attached
and attach the PM domain to matching devices.  The problem you then have
is the same race between attaching the PM domain to all devices in the
domain, and devices being probed.  Remember, this may not be happening at
boot time, but during module load, which on some systems is multithreaded.
So, the problem of not having all devices in the PM domain hasn't changed
and nothing is solved by this approach - the only thing is the code has
become more complex.

I don't think that's an improvement.

-- 
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.

  reply	other threads:[~2015-06-02  8:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-01 10:18 [PATCH] mmc: core: Attach PM domain prior probing of SDIO func driver Ulf Hansson
2015-06-01 19:42 ` Dmitry Torokhov
2015-06-02  7:54   ` Ulf Hansson
2015-06-02  8:51     ` Russell King - ARM Linux [this message]
2015-06-02 11:07       ` Russell King - ARM Linux
2015-06-02 13:18         ` Ulf Hansson
2015-06-02 15:06           ` Russell King - ARM Linux
2015-06-03  8:45             ` Ulf Hansson

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=20150602085101.GY2067@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=aaron.lu@intel.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=khilman@kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=ulf.hansson@linaro.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