</>EmbeddedInterview

What is deferred probing (-EPROBE_DEFER)?

MediumLinux Kernel & Device Drivers

Short answer: If a driver's probe() needs a resource from another driver that has not probed yet (a clock, regulator, GPIO controller, PHY, interrupt controller, I2C bus), the get function returns -EPROBE_DEFER. The driver returns that code, and the driver core puts the device on a deferred list and retries it whenever another driver binds successfully. This handles arbitrary probe ordering without hard-coded init sequences.

Correct handling

d->vdd = devm_regulator_get(dev, "vdd");
if (IS_ERR(d->vdd))
    return dev_err_probe(dev, PTR_ERR(d->vdd), "failed to get vdd\n");
/* dev_err_probe() prints nothing for -EPROBE_DEFER and records the reason */

Debugging a device that never probes

  • cat /sys/kernel/debug/devices_deferred lists deferred devices with the reason recorded by dev_err_probe.
  • Common causes: the provider driver is not enabled in the kernel config or is a module not yet loaded; a typo in the DT phandle or -supply name; the provider node has status = "disabled".
  • fw_devlink (enabled by default) uses DT phandles to create device links, so consumers are not probed before suppliers at all, which reduces repeated deferrals and orders suspend/resume correctly.
  • deferred_probe_timeout= on the command line makes the kernel give up after a time so optional dependencies don't block forever.

Do not: busy-wait or sleep in probe hoping the resource appears, or treat -EPROBE_DEFER as a fatal error and print scary messages.