• Saravana Kannan's avatar
    driver core: Improve fw_devlink & deferred_probe_timeout interaction · d46f3e3e
    Saravana Kannan authored
    deferred_probe_timeout kernel commandline parameter allows probing of
    consumer devices if the supplier devices don't have any drivers.
    
    fw_devlink=on will indefintely block probe() calls on a device if all
    its suppliers haven't probed successfully. This completely skips calls
    to driver_deferred_probe_check_state() since that's only called when a
    .probe() function calls framework APIs. So fw_devlink=on breaks
    deferred_probe_timeout.
    
    deferred_probe_timeout in its current state also ignores a lot of
    information that's now available to the kernel. It assumes all suppliers
    that haven't probed when the timer expires (or when initcalls are done
    on a static kernel) will never probe and fails any calls to acquire
    resources from these unprobed suppliers.
    
    However, this assumption by deferred_probe_timeout isn't true under many
    conditions. For example:
    - If the consumer happens to be before the supplier in the deferred
      probe list.
    - If the supplier itself is waiting on its supplier to probe.
    
    This patch fixes both these issues by relaxing device links between
    devices only if the supplier doesn't have any driver that could match
    with (NOT bound to) the supplier device. This way, we only fail attempts
    to acquire resources from suppliers that truly don't have any driver vs
    suppliers that just happen to not have probed yet.
    Signed-off-by: default avatarSaravana Kannan <saravanak@google.com>
    Link: https://lore.kernel.org/r/20210402040342.2944858-3-saravanak@google.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    d46f3e3e
base.h 7.37 KB