]> asedeno.scripts.mit.edu Git - linux.git/commit
driver core: Add support for linking devices during device addition
authorSaravana Kannan <saravanak@google.com>
Wed, 31 Jul 2019 22:17:14 +0000 (15:17 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Aug 2019 14:04:13 +0000 (16:04 +0200)
commit5302dd7dd0b6d04c63cdce51d1e9fda9ef0be886
treef168591fba3257dc48e79814cd60c6d49052659f
parent313b46d831189f593840c625d7972092cb0088fc
driver core: Add support for linking devices during device addition

When devices are added, the bus might want to create device links to track
functional dependencies between supplier and consumer devices. This
tracking of supplier-consumer relationship allows optimizing device probe
order and tracking whether all consumers of a supplier are active. The
add_links bus callback is added to support this.

However, when consumer devices are added, they might not have a supplier
device to link to despite needing mandatory resources/functionality from
one or more suppliers. A waiting_for_suppliers list is created to track
such consumers and retry linking them when new devices get added.

Signed-off-by: Saravana Kannan <saravanak@google.com>
Link: https://lore.kernel.org/r/20190731221721.187713-2-saravanak@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/core.c
include/linux/device.h