summaryrefslogtreecommitdiff
path: root/drivers/of/unittest-data
diff options
context:
space:
mode:
authorFrank Rowand <frank.rowand@sony.com>2022-05-02 13:17:41 -0500
committerRob Herring <robh@kernel.org>2022-05-03 11:53:15 -0500
commit992b0dc5c38a4e79dca17577960c5201275b83f1 (patch)
treeae80fca086d8ba9942400578c2b240c0639bdf78 /drivers/of/unittest-data
parent1ac17586c950a2c129393f8a92901a2b357acf24 (diff)
of: overlay: unittest: add tests for overlay notifiers
Add tests for overlay apply and remove notifiers. Trigger errors for each of the notifier actions. These tests will reveal a memory leak problem when a notifier returns an error for action OF_OVERLAY_POST_APPLY. The pr_err() message is: OF: ERROR: memory leak, expected refcount 1 instead of 3, of_node_get()/of_node_put() unbalanced - destroy cset entry: attach overlay node /testcase-data/overlay-node/test-bus/test-unittest17 Signed-off-by: Frank Rowand <frank.rowand@sony.com> Signed-off-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20220502181742.1402826-3-frowand.list@gmail.com
Diffstat (limited to 'drivers/of/unittest-data')
-rw-r--r--drivers/of/unittest-data/Makefile10
-rw-r--r--drivers/of/unittest-data/overlay_16.dts15
-rw-r--r--drivers/of/unittest-data/overlay_17.dts15
-rw-r--r--drivers/of/unittest-data/overlay_18.dts15
-rw-r--r--drivers/of/unittest-data/overlay_19.dts15
-rw-r--r--drivers/of/unittest-data/overlay_20.dts15
6 files changed, 85 insertions, 0 deletions
diff --git a/drivers/of/unittest-data/Makefile b/drivers/of/unittest-data/Makefile
index fbded24c608c..d072f3ba3971 100644
--- a/drivers/of/unittest-data/Makefile
+++ b/drivers/of/unittest-data/Makefile
@@ -17,6 +17,11 @@ obj-$(CONFIG_OF_OVERLAY) += overlay.dtb.o \
overlay_12.dtb.o \
overlay_13.dtb.o \
overlay_15.dtb.o \
+ overlay_16.dtb.o \
+ overlay_17.dtb.o \
+ overlay_18.dtb.o \
+ overlay_19.dtb.o \
+ overlay_20.dtb.o \
overlay_bad_add_dup_node.dtb.o \
overlay_bad_add_dup_prop.dtb.o \
overlay_bad_phandle.dtb.o \
@@ -75,6 +80,11 @@ apply_static_overlay_1 := overlay_0.dtbo \
overlay_12.dtbo \
overlay_13.dtbo \
overlay_15.dtbo \
+ overlay_16.dtbo \
+ overlay_17.dtbo \
+ overlay_18.dtbo \
+ overlay_19.dtbo \
+ overlay_20.dtbo \
overlay_gpio_01.dtbo \
overlay_gpio_02a.dtbo \
overlay_gpio_02b.dtbo \
diff --git a/drivers/of/unittest-data/overlay_16.dts b/drivers/of/unittest-data/overlay_16.dts
new file mode 100644
index 000000000000..80a46dc02581
--- /dev/null
+++ b/drivers/of/unittest-data/overlay_16.dts
@@ -0,0 +1,15 @@
+// SPDX-License-Identifier: GPL-2.0
+/dts-v1/;
+/plugin/;
+
+/* overlay_16 - notify test */
+
+&unittest_test_bus {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ test-unittest16 {
+ compatible = "unittest";
+ reg = <16>;
+ };
+};
diff --git a/drivers/of/unittest-data/overlay_17.dts b/drivers/of/unittest-data/overlay_17.dts
new file mode 100644
index 000000000000..5b8a2209177f
--- /dev/null
+++ b/drivers/of/unittest-data/overlay_17.dts
@@ -0,0 +1,15 @@
+// SPDX-License-Identifier: GPL-2.0
+/dts-v1/;
+/plugin/;
+
+/* overlay_17 - notify test */
+
+&unittest_test_bus {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ test-unittest17 {
+ compatible = "unittest";
+ reg = <17>;
+ };
+};
diff --git a/drivers/of/unittest-data/overlay_18.dts b/drivers/of/unittest-data/overlay_18.dts
new file mode 100644
index 000000000000..dcddd5f6d301
--- /dev/null
+++ b/drivers/of/unittest-data/overlay_18.dts
@@ -0,0 +1,15 @@
+// SPDX-License-Identifier: GPL-2.0
+/dts-v1/;
+/plugin/;
+
+/* overlay_18 - notify test */
+
+&unittest_test_bus {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ test-unittest18 {
+ compatible = "unittest";
+ reg = <18>;
+ };
+};
diff --git a/drivers/of/unittest-data/overlay_19.dts b/drivers/of/unittest-data/overlay_19.dts
new file mode 100644
index 000000000000..32b3ba0b66a3
--- /dev/null
+++ b/drivers/of/unittest-data/overlay_19.dts
@@ -0,0 +1,15 @@
+// SPDX-License-Identifier: GPL-2.0
+/dts-v1/;
+/plugin/;
+
+/* overlay_19 - notify test */
+
+&unittest_test_bus {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ test-unittest19 {
+ compatible = "unittest";
+ reg = <19>;
+ };
+};
diff --git a/drivers/of/unittest-data/overlay_20.dts b/drivers/of/unittest-data/overlay_20.dts
new file mode 100644
index 000000000000..d4a4f2f32ec7
--- /dev/null
+++ b/drivers/of/unittest-data/overlay_20.dts
@@ -0,0 +1,15 @@
+// SPDX-License-Identifier: GPL-2.0
+/dts-v1/;
+/plugin/;
+
+/* overlay_20 - notify test */
+
+&unittest_test_bus {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ test-unittest20 {
+ compatible = "unittest";
+ reg = <20>;
+ };
+};