devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] of: unittest: Run overlay apply/revert sequence three times
@ 2023-08-22 10:22 Geert Uytterhoeven
  2023-08-22 15:32 ` Rob Herring
  0 siblings, 1 reply; 8+ messages in thread
From: Geert Uytterhoeven @ 2023-08-22 10:22 UTC (permalink / raw)
  To: Rob Herring, Frank Rowand, Peng Fan
  Cc: devicetree, linux-renesas-soc, Geert Uytterhoeven

Run the test for the overlay apply/revert sequence three times, to
test if there are unbalanced of_node_put() calls causing reference
counts to become negative.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
This is a reproducer for the issue fixed by commit 7882541ca06d51a6
("of/platform: increase refcount of fwnode") in dt/linus.
---
 drivers/of/unittest.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
index 9af5337c76f62162..67e32977341a6f0c 100644
--- a/drivers/of/unittest.c
+++ b/drivers/of/unittest.c
@@ -3035,6 +3035,7 @@ static void __init of_unittest_overlay_notify(void)
 static void __init of_unittest_overlay(void)
 {
 	struct device_node *bus_np = NULL;
+	unsigned int i;
 
 	if (platform_driver_register(&unittest_driver)) {
 		unittest(0, "could not register unittest driver\n");
@@ -3072,7 +3073,8 @@ static void __init of_unittest_overlay(void)
 	of_unittest_overlay_2();
 	of_unittest_overlay_3();
 	of_unittest_overlay_4();
-	of_unittest_overlay_5();
+	for (i = 0; i < 3; i++)
+		of_unittest_overlay_5();
 	of_unittest_overlay_6();
 	of_unittest_overlay_8();
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread
[parent not found: <a9fb4eb560c58d11a7f167bc78a137b46e76cf15.1692699743.git.geert%2Brenesas@glider.be>]

end of thread, other threads:[~2023-08-29  4:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-22 10:22 [PATCH] of: unittest: Run overlay apply/revert sequence three times Geert Uytterhoeven
2023-08-22 15:32 ` Rob Herring
2023-08-22 17:52   ` Geert Uytterhoeven
2023-08-22 17:59     ` Rob Herring
2023-08-22 19:21       ` Rob Herring
2023-08-23  7:41         ` Geert Uytterhoeven
2023-08-23 13:26           ` Rob Herring
     [not found] <a9fb4eb560c58d11a7f167bc78a137b46e76cf15.1692699743.git.geert%2Brenesas@glider.be>
2023-08-29  4:37 ` kernel test robot

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).