linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
To: gregkh@linuxfoundation.org, dmitry.torokhov@gmail.com,
	tiwai@suse.de, tj@kernel.org, arjan@linux.intel.com
Cc: teg@jklm.no, rmilasan@suse.com, werner@suse.com, oleg@redhat.com,
	hare@suse.com, bpoirier@suse.de, santosh@chelsio.com,
	pmladek@suse.cz, dbueso@suse.com, mcgrof@suse.com,
	linux-kernel@vger.kernel.org
Subject: [PATCH v2 0/7] driver-core: async probe support
Date: Fri,  3 Oct 2014 14:44:36 -0700	[thread overview]
Message-ID: <1412372683-2003-1-git-send-email-mcgrof@do-not-panic.com> (raw)

From: "Luis R. Rodriguez" <mcgrof@suse.com>

This second series addresses all comments from the v1 series, it
removed the white list, tidies up the commit logs, adds documentation
for the kernel parameters, adds a new debug taint flag and uses it
for the testing kernel parameters we have added. This series also
now goes with built-in async probe support by defining a kernel
parameter bus.enable_kern_async=1 userspace can set to indicate to the
kernel userspace has been vetted for async probe support. This essentially
means you will verify your userspace will not depend on sync probe
on scripts / daemons, and if such issues exist you're willing
to fix this in userspace. All of these features require userspace
intervention so by default synchronous probe is used just as before.
Both mechanisms allow us to create a new async probe universe safely
without affecting old userspace.

Folks wanting to do immediate testing can compile and just load
modules manually with async_probe=1 as a module parameter for
any module they wish to probe asynchrounously. Folks wishing to
test a debug feature to enable *all* modules to be probed
asynchronously can enable bus.__DEBUG__module_force_mod_async_probe=1
Likewise to test all built-in drivers with async probe folks can use
both bus.enable_kern_async=1 and bus.__DEBUG__kernel_force_mod_async_probe=1.
Any of these new __DEBUG__ kernel parameters will taint your kernel, in
practice for now folks should not be surprised if they run into issues
with any of these parameters until async probe gets widely tested and
drivers which require sync probe are found. This series goes with one
example driver where sync probe was required, a fix to the driver is
pending to enable async probe but the issue has already been identified
and should be easy to fix.

Folks wishing to test built-in drivers can enable

bus.enable_kern_async=1

and then modify their driver with something like this:

diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index 247335d..9f0b636 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -7241,6 +7241,7 @@ static struct pci_driver e1000_driver = {
 	.remove   = e1000_remove,
 	.driver   = {
 		.pm = &e1000_pm_ops,
+		.prefer_async_probe = true,
 	},
 	.shutdown = e1000_shutdown,
 	.err_handler = &e1000_err_handler

This will *not* taint your kernel. Folks wishing to go all out and use
async probe for *all* device drivers, whether built-in or not can enable
the following and start debugging drivers as their heart pleases:

bus.enable_kern_async=1 bus.__DEBUG__module_force_mod_async_probe=1 bus.__DEBUG__kernel_force_mod_async_probe=1

I've given this a whirl on 3 different machines now, bus.__DEBUG__module_force_mod_async_probe=1
is actually fine for all 3 systems however bus.__DEBUG__kernel_force_mod_async_probe=1
requires quite a bit of drivers identified / annotated for sync probe.

Luis R. Rodriguez (7):
  taint: add TAINT_DEBUG for invasive debugging features
  module: add extra argument for parse_params() callback
  driver-core: enable drivers to opt-out of async probe
  amd64_edac: enforce synchronous probe
  driver-core: generalize freeing driver private member
  driver-core: add driver module asynchronous probe support
  driver-core: add preferred async probe option for built-in and modules

 Documentation/kernel-parameters.txt |  16 ++++
 Documentation/sysctl/kernel.txt     |   1 +
 arch/powerpc/mm/hugetlbpage.c       |   4 +-
 drivers/base/base.h                 |   6 ++
 drivers/base/bus.c                  | 149 ++++++++++++++++++++++++++++++++++--
 drivers/base/dd.c                   |   7 ++
 drivers/edac/amd64_edac.c           |   1 +
 include/linux/device.h              |  12 +++
 include/linux/kernel.h              |   1 +
 include/linux/module.h              |   2 +
 include/linux/moduleparam.h         |   3 +-
 init/main.c                         |  25 +++---
 kernel/module.c                     |  20 +++--
 kernel/panic.c                      |   2 +
 kernel/params.c                     |  11 ++-
 lib/dynamic_debug.c                 |   4 +-
 16 files changed, 234 insertions(+), 30 deletions(-)

-- 
2.1.1


             reply	other threads:[~2014-10-04  0:19 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-03 21:44 Luis R. Rodriguez [this message]
2014-10-03 21:44 ` [PATCH v2 1/7] taint: add TAINT_DEBUG for invasive debugging features Luis R. Rodriguez
2014-10-15  5:35   ` Rusty Russell
2014-10-20 20:37     ` Luis R. Rodriguez
2014-10-03 21:44 ` [PATCH v2 2/7] module: add extra argument for parse_params() callback Luis R. Rodriguez
2014-10-04 12:55   ` [Cocci] " SF Markus Elfring
2014-10-06 20:38     ` Luis R. Rodriguez
2014-10-06 21:06       ` SF Markus Elfring
2014-10-06 22:15         ` Luis R. Rodriguez
2014-10-15  5:35   ` Rusty Russell
2014-10-03 21:44 ` [PATCH v2 3/7] driver-core: enable drivers to opt-out of async probe Luis R. Rodriguez
2014-10-03 21:44 ` [PATCH v2 4/7] amd64_edac: enforce synchronous probe Luis R. Rodriguez
2014-10-03 21:44 ` [PATCH v2 5/7] driver-core: generalize freeing driver private member Luis R. Rodriguez
2014-10-03 21:44 ` [PATCH v2 6/7] driver-core: add driver module asynchronous probe support Luis R. Rodriguez
2014-10-03 21:44 ` [PATCH v2 7/7] driver-core: add preferred async probe option for built-in and modules Luis R. Rodriguez
2014-10-06 20:19   ` Tejun Heo
2014-10-06 20:36     ` Luis R. Rodriguez
2014-10-06 21:01       ` Tejun Heo
2014-10-06 23:10         ` Luis R. Rodriguez
2014-10-07 17:34           ` Tejun Heo
2014-10-07 17:50             ` Luis R. Rodriguez
2014-10-07 17:55               ` Tejun Heo
2014-10-07 18:55                 ` Luis R. Rodriguez
2014-10-07 19:07                   ` Luis R. Rodriguez
2014-10-06 20:41   ` Dmitry Torokhov

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=1412372683-2003-1-git-send-email-mcgrof@do-not-panic.com \
    --to=mcgrof@do-not-panic.com \
    --cc=arjan@linux.intel.com \
    --cc=bpoirier@suse.de \
    --cc=dbueso@suse.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hare@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@suse.com \
    --cc=oleg@redhat.com \
    --cc=pmladek@suse.cz \
    --cc=rmilasan@suse.com \
    --cc=santosh@chelsio.com \
    --cc=teg@jklm.no \
    --cc=tiwai@suse.de \
    --cc=tj@kernel.org \
    --cc=werner@suse.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).