summaryrefslogtreecommitdiff
path: root/mali_kbase/tests/kutf
diff options
context:
space:
mode:
authorSiddharth Kapoor <ksiddharth@google.com>2022-03-02 14:51:29 +0800
committerSiddharth Kapoor <ksiddharth@google.com>2022-03-02 14:51:29 +0800
commit88d7d984fed1c2a4358ce2bbc334e82d71e3a391 (patch)
tree18f20402a0ed15ae9fe62b29a9957922ebcc2ada /mali_kbase/tests/kutf
parent0207d6c3b7a2002f15c60d08617e956faf5ba90c (diff)
downloadgpu-88d7d984fed1c2a4358ce2bbc334e82d71e3a391.tar.gz
Mali Valhall Android DDK r36p0 KMD
Provenance: 9f72c118d9 (ipdelivery/EAC/v_r36p0) VX504X08X-BU-00000-r36p0-01eac0 - Valhall Android DDK VX504X08X-BU-60000-r36p0-01eac0 - Valhall Android Document Bundle VX504X08X-DC-11001-r36p0-01eac0 - Valhall Android DDK Software Errata VX504X08X-SW-99006-r36p0-01eac0 - Valhall Android Renderscript AOSP parts Signed-off-by: Siddharth Kapoor <ksiddharth@google.com> Change-Id: I4a63b707fedc68d7b7d046596c7098da47a139cb
Diffstat (limited to 'mali_kbase/tests/kutf')
-rw-r--r--mali_kbase/tests/kutf/kutf_helpers.c45
-rw-r--r--mali_kbase/tests/kutf/kutf_helpers_user.c2
-rw-r--r--mali_kbase/tests/kutf/kutf_resultset.c2
-rw-r--r--mali_kbase/tests/kutf/kutf_suite.c35
-rw-r--r--mali_kbase/tests/kutf/kutf_utils.c4
5 files changed, 23 insertions, 65 deletions
diff --git a/mali_kbase/tests/kutf/kutf_helpers.c b/mali_kbase/tests/kutf/kutf_helpers.c
index d76cebe..d207d1c 100644
--- a/mali_kbase/tests/kutf/kutf_helpers.c
+++ b/mali_kbase/tests/kutf/kutf_helpers.c
@@ -28,10 +28,6 @@
#include <linux/wait.h>
#include <linux/uaccess.h>
#include <linux/export.h>
-#include <linux/io.h>
-#include <linux/delay.h>
-#include "gpu/mali_kbase_gpu_regmap.h"
-#include <device/mali_kbase_device.h>
static DEFINE_SPINLOCK(kutf_input_lock);
@@ -131,44 +127,3 @@ void kutf_helper_input_enqueue_end_of_data(struct kutf_context *context)
{
kutf_helper_input_enqueue(context, NULL, 0);
}
-
-/* Values are taken from juno-fpga.dtsi */
-#define FPGA_SYSCTL_START_ADDR ((resource_size_t)0x6f020000)
-#define FPGA_SYSCTL_SIZE ((size_t)0xCC)
-
-/* Offset of FPGA_SYSCTL_GPU_RESET_REG register */
-#define FPGA_SYSCTL_GPU_RESET_REG 0x64
-#define GPU_RESET_HIGH 0x1
-#define GPU_RESET_LOW 0x0
-
-int kutf_helper_external_reset_gpu(void)
-{
- void __iomem *regs = NULL;
- void __iomem *gpu_reset_reg = NULL;
- int error = -ENXIO;
- int repeat = 100;
-
- regs = ioremap(FPGA_SYSCTL_START_ADDR, FPGA_SYSCTL_SIZE);
- if (!regs)
- return -ENOMEM;
-
- /* Reset GPU via SYSCTL_GPU_RESET by rising & falling the reset signal */
- gpu_reset_reg = regs + FPGA_SYSCTL_GPU_RESET_REG;
- while (error && repeat--) {
- writel(GPU_RESET_HIGH, gpu_reset_reg);
- if (readl(gpu_reset_reg) == GPU_RESET_HIGH) {
- mdelay(100);
- writel(GPU_RESET_LOW, gpu_reset_reg);
- mdelay(100);
-
- /* Succeed in resetting GPU */
- if (readl(gpu_reset_reg) == GPU_RESET_LOW)
- error = 0;
- }
- }
-
- iounmap(regs);
-
- return error;
-}
-EXPORT_SYMBOL(kutf_helper_external_reset_gpu);
diff --git a/mali_kbase/tests/kutf/kutf_helpers_user.c b/mali_kbase/tests/kutf/kutf_helpers_user.c
index a8b59f7..f88e138 100644
--- a/mali_kbase/tests/kutf/kutf_helpers_user.c
+++ b/mali_kbase/tests/kutf/kutf_helpers_user.c
@@ -368,7 +368,7 @@ int kutf_helper_receive_named_val(
named_val->u.val_str = strval;
break;
default:
- pr_err("Unreachable, fix kutf_helper_receive_named_val\n");
+ pr_err("Unreachable, fix %s\n", __func__);
/* Coding error, report as though 'run' file failed */
return -EINVAL;
}
diff --git a/mali_kbase/tests/kutf/kutf_resultset.c b/mali_kbase/tests/kutf/kutf_resultset.c
index c7572bd..3a7ade2 100644
--- a/mali_kbase/tests/kutf/kutf_resultset.c
+++ b/mali_kbase/tests/kutf/kutf_resultset.c
@@ -89,7 +89,7 @@ int kutf_add_result(struct kutf_context *context,
void kutf_destroy_result_set(struct kutf_result_set *set)
{
if (!list_empty(&set->results))
- pr_err("kutf_destroy_result_set: Unread results from test\n");
+ pr_err("%s: Unread results from test\n", __func__);
kfree(set);
}
diff --git a/mali_kbase/tests/kutf/kutf_suite.c b/mali_kbase/tests/kutf/kutf_suite.c
index d45d9df..91065b5 100644
--- a/mali_kbase/tests/kutf/kutf_suite.c
+++ b/mali_kbase/tests/kutf/kutf_suite.c
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
/*
*
- * (C) COPYRIGHT 2014, 2017-2021 ARM Limited. All rights reserved.
+ * (C) COPYRIGHT 2014, 2017-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
@@ -319,7 +319,8 @@ static void kutf_run_test(struct work_struct *data)
}
/**
- * kutf_debugfs_run_open() Debugfs open callback for the "run" entry.
+ * kutf_debugfs_run_open() - Debugfs open callback for the "run" entry.
+ *
* @inode: inode of the opened file
* @file: Opened file to read from
*
@@ -493,7 +494,7 @@ exit:
}
/**
- * kutf_debugfs_run_write() Debugfs write callback for the "run" entry.
+ * kutf_debugfs_run_write() - Debugfs write callback for the "run" entry.
* @file: Opened file to write to
* @buf: User buffer to read the data from
* @len: Amount of data to write
@@ -589,7 +590,7 @@ static int create_fixture_variant(struct kutf_test_function *test_func,
goto fail_dir;
}
- tmp = debugfs_create_file("type", S_IROTH, test_fix->dir, "fixture\n",
+ tmp = debugfs_create_file("type", 0004, test_fix->dir, "fixture\n",
&kutf_debugfs_const_string_ops);
if (IS_ERR_OR_NULL(tmp)) {
pr_err("Failed to create debugfs file \"type\" when adding fixture\n");
@@ -671,7 +672,7 @@ void kutf_add_test_with_filters_and_data(
goto fail_dir;
}
- tmp = debugfs_create_file("type", S_IROTH, test_func->dir, "test\n",
+ tmp = debugfs_create_file("type", 0004, test_func->dir, "test\n",
&kutf_debugfs_const_string_ops);
if (IS_ERR_OR_NULL(tmp)) {
pr_err("Failed to create debugfs file \"type\" when adding test %s\n", name);
@@ -680,10 +681,10 @@ void kutf_add_test_with_filters_and_data(
test_func->filters = filters;
#if KERNEL_VERSION(5, 5, 0) <= LINUX_VERSION_CODE
- tmp = debugfs_create_file_unsafe("filters", S_IROTH, test_func->dir,
+ tmp = debugfs_create_file_unsafe("filters", 0004, test_func->dir,
&test_func->filters, &kutfp_fops_x32_ro);
#else
- tmp = debugfs_create_x32("filters", S_IROTH, test_func->dir,
+ tmp = debugfs_create_x32("filters", 0004, test_func->dir,
&test_func->filters);
#endif
if (IS_ERR_OR_NULL(tmp)) {
@@ -693,10 +694,10 @@ void kutf_add_test_with_filters_and_data(
test_func->test_id = id;
#if KERNEL_VERSION(5, 5, 0) <= LINUX_VERSION_CODE
- debugfs_create_u32("test_id", S_IROTH, test_func->dir,
- &test_func->test_id);
+ debugfs_create_u32("test_id", 0004, test_func->dir,
+ &test_func->test_id);
#else
- tmp = debugfs_create_u32("test_id", S_IROTH, test_func->dir,
+ tmp = debugfs_create_u32("test_id", 0004, test_func->dir,
&test_func->test_id);
if (IS_ERR_OR_NULL(tmp)) {
pr_err("Failed to create debugfs file \"test_id\" when adding test %s\n", name);
@@ -766,7 +767,7 @@ void kutf_add_test(struct kutf_suite *suite,
EXPORT_SYMBOL(kutf_add_test);
/**
- * kutf_remove_test(): Remove a previously added test function.
+ * kutf_remove_test() - Remove a previously added test function.
* @test_func: Test function
*/
static void kutf_remove_test(struct kutf_test_function *test_func)
@@ -810,7 +811,7 @@ struct kutf_suite *kutf_create_suite_with_filters_and_data(
goto fail_debugfs;
}
- tmp = debugfs_create_file("type", S_IROTH, suite->dir, "suite\n",
+ tmp = debugfs_create_file("type", 0004, suite->dir, "suite\n",
&kutf_debugfs_const_string_ops);
if (IS_ERR_OR_NULL(tmp)) {
pr_err("Failed to create debugfs file \"type\" when adding test %s\n", name);
@@ -918,7 +919,7 @@ struct kutf_application *kutf_create_application(const char *name)
goto fail_debugfs;
}
- tmp = debugfs_create_file("type", S_IROTH, app->dir, "application\n",
+ tmp = debugfs_create_file("type", 0004, app->dir, "application\n",
&kutf_debugfs_const_string_ops);
if (IS_ERR_OR_NULL(tmp)) {
pr_err("Failed to create debugfs file \"type\" when creating application %s\n", name);
@@ -1162,8 +1163,9 @@ EXPORT_SYMBOL(kutf_test_abort);
/**
* init_kutf_core() - Module entry point.
- *
* Create the base entry point in debugfs.
+ *
+ * Return: 0 on success, error code otherwise.
*/
static int __init init_kutf_core(void)
{
@@ -1197,9 +1199,10 @@ static void __exit exit_kutf_core(void)
#else /* CONFIG_DEBUG_FS */
/**
- * init_kutf_core() - Module entry point.
+ * init_kutf_core - Module entry point
+ * Stub for when build against a kernel without debugfs support.
*
- * Stub for when build against a kernel without debugfs support
+ * Return: -ENODEV
*/
static int __init init_kutf_core(void)
{
diff --git a/mali_kbase/tests/kutf/kutf_utils.c b/mali_kbase/tests/kutf/kutf_utils.c
index c0fb3ba..2ae1510 100644
--- a/mali_kbase/tests/kutf/kutf_utils.c
+++ b/mali_kbase/tests/kutf/kutf_utils.c
@@ -47,12 +47,12 @@ const char *kutf_dsprintf(struct kutf_mempool *pool,
va_end(args);
if (len < 0) {
- pr_err("kutf_dsprintf: Bad format dsprintf format %s\n", fmt);
+ pr_err("%s: Bad format dsprintf format %s\n", __func__, fmt);
goto fail_format;
}
if (len >= sizeof(tmp_buffer)) {
- pr_warn("kutf_dsprintf: Truncated dsprintf message %s\n", fmt);
+ pr_warn("%s: Truncated dsprintf message %s\n", __func__, fmt);
size = sizeof(tmp_buffer);
} else {
size = len + 1;