linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Mark Brown <broonie@kernel.org>
Cc: Grant Likely <grant.likely@secretlab.ca>,
	Mike Turquette <mturquette@linaro.org>,
	Ming Lei <tom.leiming@gmail.com>,
	"linux-arm-msm@vger.kernel.org" <linux-arm-msm@vger.kernel.org>,
	Stephen Boyd <sboyd@codeaurora.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Saravana Kannan <skannan@codeaurora.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Liam Girdwood <lrg@ti.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 1/3] driver core: Add API to wait for deferred probe to complete during init
Date: Thu, 9 May 2013 15:14:45 +0100	[thread overview]
Message-ID: <20130509141444.GV18614@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20130509135017.GD3200@sirena.org.uk>

On Thu, May 09, 2013 at 02:50:17PM +0100, Mark Brown wrote:
> On Thu, May 09, 2013 at 12:50:46PM +0100, Grant Likely wrote:
> 
> > However, if a device that shuts down resources after init has
> > completed and then cannot turn those resources back on when another
> > driver requests them then it sounds like there is a bigger design
> > problem. We're in a hotplug world and most of the time a driver cannot
> > assume that a resource will never get requested after initcalls have
> > completed. It sounds like a design bug in the driver if it cannot
> > handle that use case.
> 
> Even if the driver copes fine it can still be desirable to avoid the
> power down/up cycle if it involves some user visible effect - things
> like blinking the display off then on for example.  That said I am a
> little suspicious about this approach, it doesn't feel as robust as it
> should to go round individual callers.

What if the driver for something like your display is a module which
needs to be loaded from userland?

Where the design bug lies is in the "lets probe all the drivers and then
shut down resources which drivers haven't claimed".  That contains an
implied assumption: that all drivers have been loaded and probed at the
point where you shut down those resources.

That simply may not be true in todays kernel - it's not true for a start
if you have modular drivers, and you have built most of the drivers as
modules (as a distro would want to with single zImage).  It's
coincidentally not true if you have deferred probing and some drivers
defer.

The real problem is this: at what point has the system actually finished
"booting" in the sense that all drivers for a platform have been
initialised?  With user loadable modules and deferred probing, that's
actually a very fuzzy concept.

As you can't really tell when that point has been reached, how can you
decide to shut down resources which "aren't being used" in a sane way
without avoiding the down/up cycle?  Basically, you can't.

So, trying to solve the problem may be totally fruitless because you
can't actually solve it - you can only put a sticky plaster over it and
hope that it catches most of the problem.  But reality is that you can't
have both a shutdown of unused resources _and_ avoid the down/up cycle.

  reply	other threads:[~2013-05-09 14:15 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-09  5:18 [PATCH 0/3] Fix disable of unused clk/regulator with deferred probe Saravana Kannan
2013-05-09  5:18 ` [PATCH 1/3] driver core: Add API to wait for deferred probe to complete during init Saravana Kannan
2013-05-09 10:07   ` Ming Lei
2013-05-09 11:50     ` Grant Likely
2013-05-09 13:50       ` Mark Brown
2013-05-09 14:14         ` Russell King - ARM Linux [this message]
2013-05-09 14:37           ` Mark Brown
2013-05-09 15:07             ` Russell King - ARM Linux
2013-05-09 15:43               ` Mark Brown
2013-05-09 18:39               ` Jean-Christophe PLAGNIOL-VILLARD
2013-05-09 16:39           ` Grant Likely
2013-05-10  9:30             ` Mark Brown
2013-05-09 16:52       ` Saravana Kannan
2013-05-09 18:09         ` Grant Likely
2013-05-09 18:12           ` Saravana Kannan
2013-05-09 14:32   ` Ming Lei
2013-05-09  5:18 ` [PATCH 2/3] clk: Disable unused clocks after deferred probing is done Saravana Kannan
2013-05-09  5:18 ` [PATCH 3/3] regulator: core: Disable unused regulators " Saravana Kannan
2013-05-09 18:35 ` [PATCH v2 1/2] clk: Disable unused clocks " Saravana Kannan
2013-05-10  6:45   ` Jean-Christophe PLAGNIOL-VILLARD
2013-05-10 23:03     ` Saravana Kannan
2013-05-22 10:35       ` Jean-Christophe PLAGNIOL-VILLARD
2013-05-16  4:34   ` Saravana Kannan
2013-05-16 12:55     ` Ulf Hansson
2013-05-16 19:23       ` Saravana Kannan
2013-05-29  7:51     ` Mike Turquette
2013-05-30  1:46       ` Saravana Kannan
2013-05-09 18:35 ` [PATCH 2/2] regulator: core: Disable unused regulators " Saravana Kannan

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=20130509141444.GV18614@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=broonie@kernel.org \
    --cc=grant.likely@secretlab.ca \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@ti.com \
    --cc=mturquette@linaro.org \
    --cc=sboyd@codeaurora.org \
    --cc=skannan@codeaurora.org \
    --cc=tom.leiming@gmail.com \
    /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).