Skip to content

driver-core: async probe support

Luis R. Rodriguez cocci linux-scsi lkml netdev 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest7 patches 17 repliesIn review
  2. v15 patches 29 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7taint: add TAINT_DEBUG for invasive debugging featuresDocumentation/sysctl/kernel.txt include/linux/kernel.h kernel/module.c +1 more+6 -22 replies
2/7module: add extra argument for parse_params() callbackarch/powerpc/mm/hugetlbpage.c include/linux/moduleparam.h init/main.c +3 more+32 -215 replies
3/7driver-core: enable drivers to opt-out of async probeinclude/linux/device.h+3 -00 replies
4/7amd64_edac: enforce synchronous probedrivers/edac/amd64_edac.c+1 -00 replies
5/7driver-core: generalize freeing driver private memberdrivers/base/bus.c+10 -30 replies
6/7driver-core: add driver module asynchronous probe supportDocumentation/kernel-parameters.txt drivers/base/base.h drivers/base/bus.c +3 more+133 -50 replies
7/7driver-core: add preferred async probe option for built-in and modulesDocumentation/kernel-parameters.txt drivers/base/bus.c include/linux/device.h+60 -1010 replies

Reviews trailers per patch

3 of 7 patches have a Reviewed-by or Acked-by.

PatchTom GundersenTejun HeoRusty Russell
1/7
2/7A-b
3/7
4/7
5/7
6/7A-b
7/7R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [PATCH v2 0/7] driver-core: async probe support

From: "Luis R. Rodriguez" <[email protected]>

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:

drivers/net/ethernet/intel/e1000e/netdev.c +1 -0
index 247335d..9f0b636 100644
@@ -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(-)
Signature · 1 line
2.1.1