summaryrefslogtreecommitdiff
path: root/mali_kbase/tests
diff options
context:
space:
mode:
authorDebarshi Dutta <debarshid@google.com>2023-06-02 13:36:22 +0000
committerDebarshi Dutta <debarshid@google.com>2023-07-12 18:55:15 +0000
commit20fff721667a227b3d6decf9dbc3798476390302 (patch)
treefba7129be28198dc2af1fb34fe0ec3a9ec0ce572 /mali_kbase/tests
parent9e12ba5986f91fa0192b1ab55fafcea5e9b37094 (diff)
downloadgpu-20fff721667a227b3d6decf9dbc3798476390302.tar.gz
Merge upstream DDK R43P0 KMD
Merge DDK version R43P0 from upstream branch Provenance: 48a9c7e25986318c8475bc245de51e7bec2606e8 (ipdelivery/EAC/v_r43p0) VX504X08X-BU-00000-r43p0-01eac0 - Valhall Android DDK VX504X08X-BU-60000-r43p0-01eac0 - Valhall Android Document Bundle VX504X08X-DC-11001-r43p0-01eac0 - Valhall Android DDK Software Errata VX504X08X-SW-99006-r43p0-01eac0 - Valhall Android Renderscript AOSP parts Bug 278174418 Commit-Topic: R43P0_KMD Signed-off-by: Debarshi Dutta <debarshid@google.com> Change-Id: I84fb19e7ce5f28e735d44a4993d51bd985aac80b
Diffstat (limited to 'mali_kbase/tests')
-rw-r--r--mali_kbase/tests/Mconfig16
-rw-r--r--mali_kbase/tests/build.bp10
-rw-r--r--mali_kbase/tests/include/kutf/kutf_helpers.h27
-rw-r--r--mali_kbase/tests/kutf/kutf_helpers.c14
-rw-r--r--mali_kbase/tests/mali_kutf_clk_rate_trace/kernel/mali_kutf_clk_rate_trace_test.c2
-rw-r--r--mali_kbase/tests/mali_kutf_irq_test/mali_kutf_irq_test_main.c7
-rw-r--r--mali_kbase/tests/mali_kutf_mgm_integration_test/build.bp2
7 files changed, 62 insertions, 16 deletions
diff --git a/mali_kbase/tests/Mconfig b/mali_kbase/tests/Mconfig
index 4203971..d81c639 100644
--- a/mali_kbase/tests/Mconfig
+++ b/mali_kbase/tests/Mconfig
@@ -26,8 +26,8 @@ menuconfig MALI_KUTF
This option will build the Mali testing framework modules.
Modules:
- - kutf.ko
- - kutf_test.ko
+ - kutf.ko
+ - kutf_test.ko
config MALI_KUTF_IRQ_TEST
bool "Build Mali KUTF IRQ test module"
@@ -38,7 +38,7 @@ config MALI_KUTF_IRQ_TEST
It can determine the latency of the Mali GPU IRQ on your system.
Modules:
- - mali_kutf_irq_test.ko
+ - mali_kutf_irq_test.ko
config MALI_KUTF_CLK_RATE_TRACE
bool "Build Mali KUTF Clock rate trace test module"
@@ -50,7 +50,7 @@ config MALI_KUTF_CLK_RATE_TRACE
basic trace test in the system.
Modules:
- - mali_kutf_clk_rate_trace_test_portal.ko
+ - mali_kutf_clk_rate_trace_test_portal.ko
config MALI_KUTF_MGM_INTEGRATION_TEST
bool "Build Mali KUTF MGM integration test module"
@@ -62,12 +62,12 @@ config MALI_KUTF_MGM_INTEGRATION_TEST
group ids.
Modules:
- - mali_kutf_mgm_integration_test.ko
+ - mali_kutf_mgm_integration_test.ko
# Enable MALI_DEBUG for KUTF modules support
config UNIT_TEST_KERNEL_MODULES
- bool
- default y if UNIT_TEST_CODE && BACKEND_KERNEL
- default n
+ bool
+ default y if UNIT_TEST_CODE && BACKEND_KERNEL
+ default n
diff --git a/mali_kbase/tests/build.bp b/mali_kbase/tests/build.bp
index 9d6137d..5581ba9 100644
--- a/mali_kbase/tests/build.bp
+++ b/mali_kbase/tests/build.bp
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/*
*
- * (C) COPYRIGHT 2021 ARM Limited. All rights reserved.
+ * (C) COPYRIGHT 2021-2023 ARM Limited. All rights reserved.
*
* This program is free software and is provided to you under the terms of the
* GNU General Public License version 2 as published by the Free Software
@@ -25,7 +25,7 @@ bob_defaults {
"include",
"./../../",
"./../",
- "./"
+ "./",
],
}
@@ -38,3 +38,9 @@ bob_defaults {
kbuild_options: ["CONFIG_UNIT_TEST_KERNEL_MODULES=y"],
},
}
+
+bob_defaults {
+ name: "kernel_unit_tests",
+ add_to_alias: ["unit_tests"],
+ srcs: [".*_unit_test/"],
+}
diff --git a/mali_kbase/tests/include/kutf/kutf_helpers.h b/mali_kbase/tests/include/kutf/kutf_helpers.h
index c4c713c..3f68efa 100644
--- a/mali_kbase/tests/include/kutf/kutf_helpers.h
+++ b/mali_kbase/tests/include/kutf/kutf_helpers.h
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/*
*
- * (C) COPYRIGHT 2017, 2020-2021 ARM Limited. All rights reserved.
+ * (C) COPYRIGHT 2017, 2020-2022 ARM Limited. All rights reserved.
*
* This program is free software and is provided to you under the terms of the
* GNU General Public License version 2 as published by the Free Software
@@ -31,6 +31,7 @@
*/
#include <kutf/kutf_suite.h>
+#include <linux/device.h>
/**
* kutf_helper_pending_input() - Check any pending lines sent by user space
@@ -81,4 +82,28 @@ int kutf_helper_input_enqueue(struct kutf_context *context,
*/
void kutf_helper_input_enqueue_end_of_data(struct kutf_context *context);
+/**
+ * kutf_helper_ignore_dmesg() - Write message in dmesg to instruct parser
+ * to ignore errors, until the counterpart
+ * is written to dmesg to stop ignoring errors.
+ * @dev: Device pointer to write to dmesg using.
+ *
+ * This function writes "Start ignoring dmesg warnings" to dmesg, which
+ * the parser will read and not log any errors. Only to be used in cases where
+ * we expect an error to be produced in dmesg but that we do not want to be
+ * flagged as an error.
+ */
+void kutf_helper_ignore_dmesg(struct device *dev);
+
+/**
+ * kutf_helper_stop_ignoring_dmesg() - Write message in dmesg to instruct parser
+ * to stop ignoring errors.
+ * @dev: Device pointer to write to dmesg using.
+ *
+ * This function writes "Stop ignoring dmesg warnings" to dmesg, which
+ * the parser will read and continue to log any errors. Counterpart to
+ * kutf_helper_ignore_dmesg().
+ */
+void kutf_helper_stop_ignoring_dmesg(struct device *dev);
+
#endif /* _KERNEL_UTF_HELPERS_H_ */
diff --git a/mali_kbase/tests/kutf/kutf_helpers.c b/mali_kbase/tests/kutf/kutf_helpers.c
index d207d1c..4273619 100644
--- a/mali_kbase/tests/kutf/kutf_helpers.c
+++ b/mali_kbase/tests/kutf/kutf_helpers.c
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
/*
*
- * (C) COPYRIGHT 2017, 2020-2021 ARM Limited. All rights reserved.
+ * (C) COPYRIGHT 2017, 2020-2022 ARM Limited. All rights reserved.
*
* This program is free software and is provided to you under the terms of the
* GNU General Public License version 2 as published by the Free Software
@@ -127,3 +127,15 @@ void kutf_helper_input_enqueue_end_of_data(struct kutf_context *context)
{
kutf_helper_input_enqueue(context, NULL, 0);
}
+
+void kutf_helper_ignore_dmesg(struct device *dev)
+{
+ dev_info(dev, "KUTF: Start ignoring dmesg warnings\n");
+}
+EXPORT_SYMBOL(kutf_helper_ignore_dmesg);
+
+void kutf_helper_stop_ignoring_dmesg(struct device *dev)
+{
+ dev_info(dev, "KUTF: Stop ignoring dmesg warnings\n");
+}
+EXPORT_SYMBOL(kutf_helper_stop_ignoring_dmesg);
diff --git a/mali_kbase/tests/mali_kutf_clk_rate_trace/kernel/mali_kutf_clk_rate_trace_test.c b/mali_kbase/tests/mali_kutf_clk_rate_trace/kernel/mali_kutf_clk_rate_trace_test.c
index 2d7289d..a6f54b6 100644
--- a/mali_kbase/tests/mali_kutf_clk_rate_trace/kernel/mali_kutf_clk_rate_trace_test.c
+++ b/mali_kbase/tests/mali_kutf_clk_rate_trace/kernel/mali_kutf_clk_rate_trace_test.c
@@ -825,7 +825,7 @@ static void *mali_kutf_clk_rate_trace_create_fixture(
if (!data)
return NULL;
- *data = (const struct kutf_clk_rate_trace_fixture_data){ NULL };
+ memset(data, 0, sizeof(*data));
pr_debug("Hooking up the test portal to kbdev clk rate trace\n");
spin_lock(&kbdev->pm.clk_rtm.lock);
diff --git a/mali_kbase/tests/mali_kutf_irq_test/mali_kutf_irq_test_main.c b/mali_kbase/tests/mali_kutf_irq_test/mali_kutf_irq_test_main.c
index 2d6e689..f2a014d 100644
--- a/mali_kbase/tests/mali_kutf_irq_test/mali_kutf_irq_test_main.c
+++ b/mali_kbase/tests/mali_kutf_irq_test/mali_kutf_irq_test_main.c
@@ -51,8 +51,6 @@ struct kutf_irq_fixture_data {
struct kbase_device *kbdev;
};
-#define SEC_TO_NANO(s) ((s)*1000000000LL)
-
/* ID for the GPU IRQ */
#define GPU_IRQ_HANDLER 2
@@ -212,6 +210,11 @@ static void mali_kutf_irq_latency(struct kutf_context *context)
average_time += irq_time - start_time;
udelay(10);
+ /* Sleep for a ms, every 10000 iterations, to avoid misleading warning
+ * of CPU softlockup when all GPU IRQs keep going to the same CPU.
+ */
+ if (!(i % 10000))
+ msleep(1);
}
/* Go back to default handler */
diff --git a/mali_kbase/tests/mali_kutf_mgm_integration_test/build.bp b/mali_kbase/tests/mali_kutf_mgm_integration_test/build.bp
index 2e4a083..8b995f8 100644
--- a/mali_kbase/tests/mali_kutf_mgm_integration_test/build.bp
+++ b/mali_kbase/tests/mali_kutf_mgm_integration_test/build.bp
@@ -38,4 +38,4 @@ bob_kernel_module {
kbuild_options: ["CONFIG_MALI_KUTF_MGM_INTEGRATION_TEST=y"],
enabled: true,
},
-} \ No newline at end of file
+}