Skip to content

Asynchronous device/driver probing support

Dmitry Torokhov lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest8 patches 16 repliesIn review
  2. v18 patches 26 repliesSuperseded

Changes in v2 from the cover letter

- Changed verbage in change logs and code to emphasise that PROBE_PREFER_ASYNCHRONOUS is a temporary measure and the end goal is to enable asynchronous probing by default, as requested by Tejun.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8module: add extra argument for parse_params() callbackarch/powerpc/mm/hugetlbpage.c include/linux/moduleparam.h init/main.c +3 more+32 -210 replies
2/8driver-core: add asynchronous probing support for driversdrivers/base/base.h drivers/base/bus.c drivers/base/dd.c +1 more+182 -277 replies
3/8driver-core: add driver module asynchronous probe supportDocumentation/kernel-parameters.txt drivers/base/dd.c include/linux/device.h +2 more+27 -60 replies
4/8driver-core: enable drivers to opt-out of async probedrivers/base/dd.c include/linux/device.h+17 -100 replies
5/8driver-core: platform_driver_probe() must probe synchronouslydrivers/base/platform.c+13 -00 replies
6/8amd64_edac: enforce synchronous probedrivers/edac/amd64_edac.c+1 -00 replies
7/8module: add core_param_unsafeinclude/linux/moduleparam.h+9 -00 replies
8/8driver-core: allow enabling async probing for all modules and builtinsDocumentation/kernel-parameters.txt drivers/base/dd.c kernel/module.c+26 -44 replies

Reviews trailers per patch

3 of 8 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchTejun HeoRusty Russell
SeriesA-b
1/8R-b A-b
2/8
3/8
4/8
5/8
6/8R-b
7/8A-b
8/8

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/8] Asynchronous device/driver probing support

This series is a combination of changes proposed by Luis a couple months ago and implementation used by Chrome OS. The issue we are trying to solve here is "slow" devices and drivers spending "too much time" in their probe() methods and it affects:

- overall kernel boot process when drivers are compiled into the kernel and slow devices stall entire boot progress;
- systemd desire to time out module loading process.

Unlike Luis' proposal we do make use of asycn_schedule() infrastructure instead of using a dedicated workqueue, so all existing synchronization points in kernel that wait for device registration still work the same. Also, the asynchronous probing is done not only during driver registration (i.e. when devices are probed asynchronously only if they are registered before the driver), but also during device registration and deferred probe handling. This way slow devices do not stall kernel boot even when drivers are compiled into the kernel.

The last patch is for adventurous people to try and force fully-asynchronous boot. It works for me with limited success - I can boot Rockhip-based box to userspace as long as I force serial to be sychronously probed and ignore the fact that most devices are using "dummy" regulators as regulator subsystem really expects regulators to be registered in orderly fashion on OF-based systems.

Changes from v1:

- Changed verbage in change logs and code to emphasise that PROBE_PREFER_ASYNCHRONOUS is a temporary measure and the end goal is to enable asynchronous probing by default, as requested by Tejun.

Thanks,
Dmitry