All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
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 16:43:52 +0100	[thread overview]
Message-ID: <20130509154352.GG3200@sirena.org.uk> (raw)
In-Reply-To: <20130509150750.GW18614@n2100.arm.linux.org.uk>

[-- Attachment #1: Type: text/plain, Size: 2919 bytes --]

On Thu, May 09, 2013 at 04:07:50PM +0100, Russell King - ARM Linux wrote:
> On Thu, May 09, 2013 at 03:37:02PM +0100, Mark Brown wrote:

> > That's clearly a "don't do that then" sort of thing; while we don't want
> > to be unhelpful there's no guarantees with this approach.

> That's not a "don't do that then" thing, because in this case it's
> unreasonable to say that.  The display subsystems like fbdev and
> DRM represent quite a sizable chunk:

> - Base DRM is around 200k.
> - DRM drivers typically around 100k each.
> - Base FBdev is around 100k.

> It won't take long before you're into the territory of having a
> significant portion of your kernel being display drivers of one
> type or other, much of which won't be usable on any one specific
> platform.  So to say "don't build your display drivers as modules"
> is an unreasonable position to take.

Sure, it's unhelpful for distro style kernels.  Like I say, 90%.

> > Another option here which is more in tune with deferred probing and
> > hotplugging would be to switch the delay over to be time based rather
> > than initcall based; do the shutdown at some point based on the time the
> > last resource was registered.  That still won't cover everything
> > though we could make the delay tunable.

> Yuck.  That's crap design.  Really, time based stuff is crap.  I've seen
> this too many times with the gnome crap in Ubuntu 12.04 - where if you
> boot this off SD card it will complain that some applets fail to start
> (and sure enough, half your panel is missing.)  Boot it off eSATA and
> it works 100% reliably.

No argument here, there's a reason I immediately went to the "make it
tunable" fudge factor.

> A better solution may be to avoid the problem in kernel space altogether.
> That's already done in the past with the scsi_wait_scan module.  Make the
> the shutdown of stuff a separate loadable module which userspace can load
> at the appropriate time to trigger the shutdown of unused resources.  Or
> provide a different method for userspace to trigger that action.

> With that kind of solution, it is possible to know that the system has
> finished booting (many userspace implementations already do this with
> stuff like not permitting login via network until after the system has
> finished booting despite sshd et.al. already being started.)

This works fine for boot but if we're going to solve this properly and
asking userspace to make changes we probably ought to be trying to
handle the actual hotplug case (which the current bodge doesn't cope
with at all) as well.  A similar tactic with asking for handshaking from
userspace for hotplug notifications should work though it'd be a bit
more hassle to deploy.

Or perhaps given that it should be simple for userspace and there's
probably other uses for the information we just put the hook in there
anyway even if this particular problem gets a better solution later on.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: broonie@kernel.org (Mark Brown)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] driver core: Add API to wait for deferred probe to complete during init
Date: Thu, 9 May 2013 16:43:52 +0100	[thread overview]
Message-ID: <20130509154352.GG3200@sirena.org.uk> (raw)
In-Reply-To: <20130509150750.GW18614@n2100.arm.linux.org.uk>

On Thu, May 09, 2013 at 04:07:50PM +0100, Russell King - ARM Linux wrote:
> On Thu, May 09, 2013 at 03:37:02PM +0100, Mark Brown wrote:

> > That's clearly a "don't do that then" sort of thing; while we don't want
> > to be unhelpful there's no guarantees with this approach.

> That's not a "don't do that then" thing, because in this case it's
> unreasonable to say that.  The display subsystems like fbdev and
> DRM represent quite a sizable chunk:

> - Base DRM is around 200k.
> - DRM drivers typically around 100k each.
> - Base FBdev is around 100k.

> It won't take long before you're into the territory of having a
> significant portion of your kernel being display drivers of one
> type or other, much of which won't be usable on any one specific
> platform.  So to say "don't build your display drivers as modules"
> is an unreasonable position to take.

Sure, it's unhelpful for distro style kernels.  Like I say, 90%.

> > Another option here which is more in tune with deferred probing and
> > hotplugging would be to switch the delay over to be time based rather
> > than initcall based; do the shutdown at some point based on the time the
> > last resource was registered.  That still won't cover everything
> > though we could make the delay tunable.

> Yuck.  That's crap design.  Really, time based stuff is crap.  I've seen
> this too many times with the gnome crap in Ubuntu 12.04 - where if you
> boot this off SD card it will complain that some applets fail to start
> (and sure enough, half your panel is missing.)  Boot it off eSATA and
> it works 100% reliably.

No argument here, there's a reason I immediately went to the "make it
tunable" fudge factor.

> A better solution may be to avoid the problem in kernel space altogether.
> That's already done in the past with the scsi_wait_scan module.  Make the
> the shutdown of stuff a separate loadable module which userspace can load
> at the appropriate time to trigger the shutdown of unused resources.  Or
> provide a different method for userspace to trigger that action.

> With that kind of solution, it is possible to know that the system has
> finished booting (many userspace implementations already do this with
> stuff like not permitting login via network until after the system has
> finished booting despite sshd et.al. already being started.)

This works fine for boot but if we're going to solve this properly and
asking userspace to make changes we probably ought to be trying to
handle the actual hotplug case (which the current bodge doesn't cope
with at all) as well.  A similar tactic with asking for handshaking from
userspace for hotplug notifications should work though it'd be a bit
more hassle to deploy.

Or perhaps given that it should be simple for userspace and there's
probably other uses for the information we just put the hook in there
anyway even if this particular problem gets a better solution later on.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130509/10ea8e4c/attachment-0001.sig>

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

Thread overview: 58+ 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 ` 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  5:18   ` Saravana Kannan
2013-05-09 10:07   ` Ming Lei
2013-05-09 10:07     ` Ming Lei
2013-05-09 11:50     ` Grant Likely
2013-05-09 11:50       ` Grant Likely
2013-05-09 13:50       ` Mark Brown
2013-05-09 13:50         ` Mark Brown
2013-05-09 14:14         ` Russell King - ARM Linux
2013-05-09 14:14           ` Russell King - ARM Linux
2013-05-09 14:37           ` Mark Brown
2013-05-09 14:37             ` Mark Brown
2013-05-09 15:07             ` Russell King - ARM Linux
2013-05-09 15:07               ` Russell King - ARM Linux
2013-05-09 15:43               ` Mark Brown [this message]
2013-05-09 15:43                 ` Mark Brown
2013-05-09 18:39               ` Jean-Christophe PLAGNIOL-VILLARD
2013-05-09 18:39                 ` Jean-Christophe PLAGNIOL-VILLARD
2013-05-09 18:39                 ` Jean-Christophe PLAGNIOL-VILLARD
2013-05-09 16:39           ` Grant Likely
2013-05-09 16:39             ` Grant Likely
2013-05-10  9:30             ` Mark Brown
2013-05-10  9:30               ` Mark Brown
2013-05-09 16:52       ` Saravana Kannan
2013-05-09 16:52         ` Saravana Kannan
2013-05-09 18:09         ` Grant Likely
2013-05-09 18:09           ` Grant Likely
2013-05-09 18:12           ` Saravana Kannan
2013-05-09 18:12             ` Saravana Kannan
2013-05-09 14:32   ` Ming Lei
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   ` Saravana Kannan
2013-05-09  5:18 ` [PATCH 3/3] regulator: core: Disable unused regulators " Saravana Kannan
2013-05-09  5:18   ` Saravana Kannan
2013-05-09 18:35 ` [PATCH v2 1/2] clk: Disable unused clocks " Saravana Kannan
2013-05-09 18:35   ` Saravana Kannan
2013-05-10  6:45   ` Jean-Christophe PLAGNIOL-VILLARD
2013-05-10  6:45     ` Jean-Christophe PLAGNIOL-VILLARD
2013-05-10 23:03     ` Saravana Kannan
2013-05-10 23:03       ` Saravana Kannan
2013-05-22 10:35       ` Jean-Christophe PLAGNIOL-VILLARD
2013-05-22 10:35         ` Jean-Christophe PLAGNIOL-VILLARD
2013-05-16  4:34   ` Saravana Kannan
2013-05-16  4:34     ` Saravana Kannan
2013-05-16 12:55     ` Ulf Hansson
2013-05-16 12:55       ` Ulf Hansson
2013-05-16 19:23       ` Saravana Kannan
2013-05-16 19:23         ` Saravana Kannan
2013-05-29  7:51     ` Mike Turquette
2013-05-29  7:51       ` Mike Turquette
2013-05-30  1:46       ` Saravana Kannan
2013-05-30  1:46         ` Saravana Kannan
2013-05-30  1:46         ` Saravana Kannan
2013-05-09 18:35 ` [PATCH 2/2] regulator: core: Disable unused regulators " Saravana Kannan
2013-05-09 18:35   ` 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=20130509154352.GG3200@sirena.org.uk \
    --to=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=linux@arm.linux.org.uk \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.