of/platform: Pause/resume sync state during init and of_platform_populate()
authorSaravana Kannan <saravanak@google.com>
Wed, 31 Jul 2019 22:17:18 +0000 (15:17 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Aug 2019 14:04:14 +0000 (16:04 +0200)
commit21871a99b34c65c56a24193c277a4981529c306f
treec8cdd03265fdd8714db60fffd23254bf1de895dc
parent8f8184d6bf676a8680d6f441e40317d166b46f73
of/platform: Pause/resume sync state during init and of_platform_populate()

When all the top level devices are populated from DT during kernel
init, the supplier devices could be added and probed before the
consumer devices are added and linked to the suppliers. To avoid the
sync_state() callback from being called prematurely, pause the
sync_state() callbacks before populating the devices and resume them
at late_initcall_sync().

Similarly, when children devices are populated after kernel init using
of_platform_populate(), there could be supplier-consumer dependencies
between the children devices that are populated. To avoid the same
problem with sync_state() being called prematurely, pause and resume
sync_state() callbacks across of_platform_populate().

Signed-off-by: Saravana Kannan <saravanak@google.com>
Link: https://lore.kernel.org/r/20190731221721.187713-6-saravanak@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/of/platform.c