From patchwork Tue Aug 22 10:22:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 715871 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7C7E0EE4996 for ; Tue, 22 Aug 2023 10:22:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233252AbjHVKWo (ORCPT ); Tue, 22 Aug 2023 06:22:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233612AbjHVKWo (ORCPT ); Tue, 22 Aug 2023 06:22:44 -0400 Received: from michel.telenet-ops.be (michel.telenet-ops.be [IPv6:2a02:1800:110:4::f00:18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8EF311B2 for ; Tue, 22 Aug 2023 03:22:41 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed40:c9ff:e2bc:6893:f4e3]) by michel.telenet-ops.be with bizsmtp id caNd2A00M2hAXNh06aNd1a; Tue, 22 Aug 2023 12:22:37 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1qYOWq-001Oc2-WC; Tue, 22 Aug 2023 12:22:37 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1qYOWz-00H0ho-Hi; Tue, 22 Aug 2023 12:22:37 +0200 From: Geert Uytterhoeven To: Rob Herring , Frank Rowand , Peng Fan Cc: devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH] of: unittest: Run overlay apply/revert sequence three times Date: Tue, 22 Aug 2023 12:22:34 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 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 --- 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();