summaryrefslogtreecommitdiff
path: root/drivers/of/unittest-data
diff options
context:
space:
mode:
authorFrank Rowand <frowand.list@gmail.com>2023-02-13 21:56:59 +0300
committerRob Herring <robh@kernel.org>2023-02-21 00:36:51 +0300
commit74df14cd301a1433947077e79ce2c610654a32e7 (patch)
tree4bfd35c904f7bd848d7925c516b3ae05acee9e2e /drivers/of/unittest-data
parentf381b31a80bc47102f5a3f3001d8e45c328eb548 (diff)
downloadlinux-74df14cd301a1433947077e79ce2c610654a32e7.tar.xz
of: unittest: add node lifecycle tests
Add tests to exercise the actions that occur when the reference count of devicetree nodes decrement to zero and beyond. Decrementing to zero triggers freeing memory allocated for the node. This commit will expose a pr_err() issue in of_node_release(), resulting in some kernal warnings and stack traces. When scripts/dtc/of_unittest_expect processes the console messages, it will also report related problems for EXPECT messages due to the pr_err() issue: ** missing EXPECT begin : 5 Signed-off-by: Frank Rowand <frowand.list@gmail.com> Link: https://lore.kernel.org/r/20230213185702.395776-5-frowand.list@gmail.com [robh: Fix !CONFIG_OF_DYNAMIC build] Signed-off-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'drivers/of/unittest-data')
-rw-r--r--drivers/of/unittest-data/testcases_common.dtsi1
-rw-r--r--drivers/of/unittest-data/tests-lifecycle.dtsi8
2 files changed, 9 insertions, 0 deletions
diff --git a/drivers/of/unittest-data/testcases_common.dtsi b/drivers/of/unittest-data/testcases_common.dtsi
index 19292bbb4cbb..e7887f2301c1 100644
--- a/drivers/of/unittest-data/testcases_common.dtsi
+++ b/drivers/of/unittest-data/testcases_common.dtsi
@@ -17,3 +17,4 @@
#include "tests-address.dtsi"
#include "tests-platform.dtsi"
#include "tests-overlay.dtsi"
+#include "tests-lifecycle.dtsi"
diff --git a/drivers/of/unittest-data/tests-lifecycle.dtsi b/drivers/of/unittest-data/tests-lifecycle.dtsi
new file mode 100644
index 000000000000..28509a8783a7
--- /dev/null
+++ b/drivers/of/unittest-data/tests-lifecycle.dtsi
@@ -0,0 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0
+
+/ {
+ testcase-data {
+ refcount-node {
+ };
+ };
+};