]> git.baikalelectronics.ru Git - kernel.git/commit
of/platform: Pause/resume sync state during init and of_platform_populate()
authorSaravana Kannan <saravanak@google.com>
Wed, 4 Sep 2019 21:11:24 +0000 (14:11 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Oct 2019 15:30:19 +0000 (17:30 +0200)
commitba0d2d81870c269292c7807eca4d287b662d49cd
tree1d47981bc16314157d9eef91bd0e695c012a08f7
parentf0f035f9e0f04fc3325a8a5063ecd06c8b257e24
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 from a module 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/20190904211126.47518-6-saravanak@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/of/platform.c