summaryrefslogtreecommitdiff
path: root/mali_kbase/mali_kbase_vinstr.c
diff options
context:
space:
mode:
authorSidath Senanayake <sidaths@google.com>2017-05-18 14:43:17 +0200
committerSidath Senanayake <sidaths@google.com>2017-05-18 14:43:17 +0200
commit6f5ab3baed824941f168ab133469f997d4450146 (patch)
tree95dcbadaa979f84a8d75c0919af1b85c5afd1924 /mali_kbase/mali_kbase_vinstr.c
parent48f3554a4abf9ce182253fb5415a1a26b0790998 (diff)
downloadgpu-6f5ab3baed824941f168ab133469f997d4450146.tar.gz
Mali Bifrost DDK r6p0 KMD
Provenance: b67d8663a (collaborate/EAC/b_r6p0) BX304L01B-BU-00000-r6p0-01rel0 BX304L06A-BU-00000-r6p0-01rel0 BX304X07X-BU-00000-r6p0-01rel0 Signed-off-by: Sidath Senanayake <sidaths@google.com> Change-Id: I6b19113374d523be9a75a252d672731600e991d6
Diffstat (limited to 'mali_kbase/mali_kbase_vinstr.c')
-rw-r--r--mali_kbase/mali_kbase_vinstr.c35
1 files changed, 33 insertions, 2 deletions
diff --git a/mali_kbase/mali_kbase_vinstr.c b/mali_kbase/mali_kbase_vinstr.c
index 7f7efc8..b2d46ed 100644
--- a/mali_kbase/mali_kbase_vinstr.c
+++ b/mali_kbase/mali_kbase_vinstr.c
@@ -1,6 +1,6 @@
/*
*
- * (C) COPYRIGHT 2011-2016 ARM Limited. All rights reserved.
+ * (C) COPYRIGHT 2011-2017 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
@@ -1160,6 +1160,28 @@ static enum hrtimer_restart kbasep_vinstr_wake_up_callback(
return HRTIMER_NORESTART;
}
+#ifdef CONFIG_DEBUG_OBJECT_TIMERS
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 7, 0))
+/**
+ * kbase_destroy_hrtimer_on_stack - kernel's destroy_hrtimer_on_stack(),
+ * rewritten
+ *
+ * @timer: high resolution timer
+ *
+ * destroy_hrtimer_on_stack() was exported only for 4.7.0 kernel so for
+ * earlier kernel versions it is not possible to call it explicitly.
+ * Since this function must accompany hrtimer_init_on_stack(), which
+ * has to be used for hrtimer initialization if CONFIG_DEBUG_OBJECT_TIMERS
+ * is defined in order to avoid the warning about object on stack not being
+ * annotated, we rewrite it here to be used for earlier kernel versions.
+ */
+static void kbase_destroy_hrtimer_on_stack(struct hrtimer *timer)
+{
+ debug_object_free(timer, &hrtimer_debug_descr);
+}
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 7, 0) */
+#endif /* CONFIG_DEBUG_OBJECT_TIMERS */
+
/**
* kbasep_vinstr_service_task - HWC dumping service thread
*
@@ -1174,7 +1196,8 @@ static int kbasep_vinstr_service_task(void *data)
KBASE_DEBUG_ASSERT(vinstr_ctx);
- hrtimer_init(&timer.hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
+ hrtimer_init_on_stack(&timer.hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
+
timer.hrtimer.function = kbasep_vinstr_wake_up_callback;
timer.vinstr_ctx = vinstr_ctx;
@@ -1277,6 +1300,14 @@ static int kbasep_vinstr_service_task(void *data)
mutex_unlock(&vinstr_ctx->lock);
}
+#ifdef CONFIG_DEBUG_OBJECTS_TIMERS
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 7, 0))
+ kbase_destroy_hrtimer_on_stack(&timer.hrtimer);
+#else
+ destroy_hrtimer_on_stack(&timer.hrtimer);
+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(4, 7, 0)) */
+#endif /* CONFIG_DEBUG_OBJECTS_TIMERS */
+
return 0;
}