linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: lee.jones@linaro.org (Lee Jones)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] driver-core: Add externally callable function to trigger deferred probes
Date: Tue, 12 Jul 2016 17:19:26 +0100	[thread overview]
Message-ID: <20160712161927.7521-2-lee.jones@linaro.org> (raw)
In-Reply-To: <20160712161927.7521-1-lee.jones@linaro.org>

Deferred probes are currently only re-executed if new drivers are successfully
registered and probed.  Drivers which defer their probes based on things like
missing firmware located on rootfs will sometimes only be re-probed if kernel
modules are found.  Unfortunately, this is fragile and can not be guaranteed
or relied upon.  This call allows us to trigger probe re-execution at any
point during boot.  For instance after rootfs is mounted in order to collect
firmwares in rootfs.

Tested-by: Peter Griffin <peter.griffin@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/base/dd.c      | 8 ++++++++
 include/linux/device.h | 1 +
 2 files changed, 9 insertions(+)

diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index 16688f5..ab20851 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -203,6 +203,14 @@ void device_unblock_probing(void)
 }
 
 /**
+ * deferred_probe_tigger() - Trigger a deferred probe
+ */
+void deferred_probe_trigger(void)
+{
+	driver_deferred_probe_trigger();
+}
+
+/**
  * deferred_probe_initcall() - Enable probing of deferred devices
  *
  * We don't want to get in the way when the bulk of drivers are getting probed.
diff --git a/include/linux/device.h b/include/linux/device.h
index 38f0281..d441471 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -293,6 +293,7 @@ extern struct device_driver *driver_find(const char *name,
 					 struct bus_type *bus);
 extern int driver_probe_done(void);
 extern void wait_for_device_probe(void);
+extern void deferred_probe_trigger(void);
 
 
 /* sysfs interface for exporting driver attributes */
-- 
2.9.0

  reply	other threads:[~2016-07-12 16:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-12 16:19 [PATCH 0/2] core: Ensure drivers are given a chance to re-probe() late-on Lee Jones
2016-07-12 16:19 ` Lee Jones [this message]
2016-07-12 16:19 ` [PATCH 2/2] init/main: Trigger re-execution of deferred deferred probe()s Lee Jones

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=20160712161927.7521-2-lee.jones@linaro.org \
    --to=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).