devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] of/platform: Unconditionally pause/resume sync state during kernel init
@ 2019-12-09 19:22 Saravana Kannan
  2019-12-09 19:27 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 2+ messages in thread
From: Saravana Kannan @ 2019-12-09 19:22 UTC (permalink / raw)
  To: Rob Herring, Frank Rowand, Greg Kroah-Hartman, Saravana Kannan
  Cc: kernel test robot, kernel-team, devicetree, linux-kernel

Commit 5e6669387e22 ("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: 5e6669387e22 ("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>
---
 drivers/of/platform.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index d93891a05f60..3371e4a06248 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -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
@@ -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);
-- 
2.24.0.393.g34dc348eaf-goog


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] of/platform: Unconditionally pause/resume sync state during kernel init
  2019-12-09 19:22 [PATCH v2] of/platform: Unconditionally pause/resume sync state during kernel init Saravana Kannan
@ 2019-12-09 19:27 ` Greg Kroah-Hartman
  0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2019-12-09 19:27 UTC (permalink / raw)
  To: Saravana Kannan
  Cc: Rob Herring, Frank Rowand, kernel test robot, kernel-team,
	devicetree, linux-kernel

On Mon, Dec 09, 2019 at 11:22:21AM -0800, Saravana Kannan wrote:
> Commit 5e6669387e22 ("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: 5e6669387e22 ("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>
> ---
>  drivers/of/platform.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)


What changed from v1?

Always put that below the --- line.

v3 please?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-12-09 19:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-09 19:22 [PATCH v2] of/platform: Unconditionally pause/resume sync state during kernel init Saravana Kannan
2019-12-09 19:27 ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).