public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: anish singh <anish198519851985@gmail.com>
Cc: Grant Likely <grant.likely@secretlab.ca>,
	Haojian Zhuang <haojian.zhuang@linaro.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	viro@zeniv.linux.org.uk, rusty@rustcorp.com.au,
	hpa@linux.intel.com, jim.cromie@gmail.com,
	linux-kernel@vger.kernel.org,
	"Russell King - ARM Linux" <linux@arm.linux.org.uk>,
	Linus Walleij <linus.walleij@linaro.org>,
	broonie@opensource.wolfsonmicro.com,
	Patch Tracking <patches@linaro.org>
Subject: Re: [PATCH] driver core: add wait event for deferred probe
Date: Thu, 14 Feb 2013 09:56:36 +0000	[thread overview]
Message-ID: <201302140956.36843.arnd@arndb.de> (raw)
In-Reply-To: <CAK7N6voJJ_g_LLmKdd=95fQOQPaTvQbs3HJsKJoPcrDUyUWxaA@mail.gmail.com>

On Thursday 14 February 2013, anish singh wrote:
> Grant, Can you please explain me this problem?My understanding is below:
> If all the detection of devices with there respective driver is done before
> __init section is freed then we will not have the problem mentioned.
> However if the driver requests the probing to be deferred then __init section
> of the deferred driver will not be freed right?

The kernel has no idea which drivers are deferred at the time when all the
__init sections are freed.

> I am afraid but the patch description is bit cryptic for me specially
> this line "kernel has to open console failure & release __init section before
> reinvoking failure".

I would put it this way: With the introduction of deferred probing, the
rules for the use of __init sections have changed slightly for some
corner cases. While normal device drivers can, as before, not call
__init functions from their .probe() callbacks, we could do that in
drivers as long as they were built-in and did not support hotplug,
and that exception was used in console drivers. This exception has
now become more specific, and those drivers also must not use
deferred probing that depends on other loadable modules or hotpluggable
devices.

Grant's patch fixes the corner case where you have a device whose .probe()
callback gets deferred and waits for some object that is provided
by a different built-in driver for a non-hotpluggable device, by making
sure that this particular deferred probe has completed before the __init
section is freed. Unlike Haojian's patch, it allows other deferred
device probe functions that do not need to call __init functions to be
delayed until much later, when a driver module is loaded or a device
is hotplugged.

	Arnd

  reply	other threads:[~2013-02-14  9:57 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-09 16:57 [PATCH] driver core: add wait event for deferred probe Haojian Zhuang
2013-02-11 23:10 ` Andrew Morton
2013-02-12  2:52   ` Haojian Zhuang
2013-02-13 21:36     ` Grant Likely
2013-02-14  3:27       ` anish singh
2013-02-14  9:56         ` Arnd Bergmann [this message]
2013-02-14 10:04           ` Russell King - ARM Linux
2013-02-14 11:08             ` Arnd Bergmann
2013-02-14 16:33         ` Grant Likely
2013-02-14 17:42           ` anish kumar
2013-02-14 15:52       ` Haojian Zhuang
2013-02-14 15:57         ` Arnd Bergmann
2013-02-14 16:04           ` Haojian Zhuang
2013-02-14 16:50             ` Arnd Bergmann
2013-02-14 16:58               ` Haojian Zhuang
2013-02-14 17:54                 ` Grant Likely
2013-02-14 17:42           ` Grant Likely
2013-02-14 17:38         ` Grant Likely

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=201302140956.36843.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=akpm@linux-foundation.org \
    --cc=anish198519851985@gmail.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=grant.likely@secretlab.ca \
    --cc=gregkh@linuxfoundation.org \
    --cc=haojian.zhuang@linaro.org \
    --cc=hpa@linux.intel.com \
    --cc=jim.cromie@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=patches@linaro.org \
    --cc=rusty@rustcorp.com.au \
    --cc=viro@zeniv.linux.org.uk \
    /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