Skip to content

Commit

Permalink
of/platform: Unconditionally pause/resume sync state during kernel init
Browse files Browse the repository at this point in the history
Commit 5e66693 ("of/platform: Pause/resume sync state during init
and of_platform_populate()") paused/resumed sync state during init only
if Linux had parsed and populated a devicetree.

However, the check for that (of_have_populated_dt()) can change after
of_platform_default_populate_init() executes.  One example of this is
when devicetree unittests are enabled.  This causes an unmatched
pause/resume of sync state. To avoid this, just unconditionally
pause/resume sync state during init.

Fixes: 5e66693 ("of/platform: Pause/resume sync state during init and of_platform_populate()")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Saravana Kannan <saravanak@google.com>
Reviewed-by: Frank Rowand <frowand.list@gmail.com>
Link: https://lore.kernel.org/r/20191209193119.147056-1-saravanak@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Saravana Kannan authored and Greg Kroah-Hartman committed Dec 10, 2019
1 parent e42617b commit 51ba8b3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/of/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -518,10 +518,11 @@ static int __init of_platform_default_populate_init(void)
{
struct device_node *node;

device_links_supplier_sync_state_pause();

if (!of_have_populated_dt())
return -ENODEV;

device_links_supplier_sync_state_pause();
/*
* Handle certain compatibles explicitly, since we don't want to create
* platform_devices for every node in /reserved-memory with a
Expand All @@ -545,8 +546,7 @@ arch_initcall_sync(of_platform_default_populate_init);

static int __init of_platform_sync_state_init(void)
{
if (of_have_populated_dt())
device_links_supplier_sync_state_resume();
device_links_supplier_sync_state_resume();
return 0;
}
late_initcall_sync(of_platform_sync_state_init);
Expand Down

0 comments on commit 51ba8b3

Please sign in to comment.