Skip to content

Commit 51ba8b3

Browse files
Saravana Kannangregkh
authored andcommitted
of/platform: Unconditionally pause/resume sync state during kernel init
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 <[email protected]> Signed-off-by: Saravana Kannan <[email protected]> Reviewed-by: Frank Rowand <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent e42617b commit 51ba8b3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/of/platform.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -518,10 +518,11 @@ static int __init of_platform_default_populate_init(void)
518518
{
519519
struct device_node *node;
520520

521+
device_links_supplier_sync_state_pause();
522+
521523
if (!of_have_populated_dt())
522524
return -ENODEV;
523525

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

546547
static int __init of_platform_sync_state_init(void)
547548
{
548-
if (of_have_populated_dt())
549-
device_links_supplier_sync_state_resume();
549+
device_links_supplier_sync_state_resume();
550550
return 0;
551551
}
552552
late_initcall_sync(of_platform_sync_state_init);

0 commit comments

Comments
 (0)