summaryrefslogtreecommitdiff
path: root/mali_kbase/csf/mali_kbase_csf_event.c
diff options
context:
space:
mode:
Diffstat (limited to 'mali_kbase/csf/mali_kbase_csf_event.c')
-rw-r--r--mali_kbase/csf/mali_kbase_csf_event.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/mali_kbase/csf/mali_kbase_csf_event.c b/mali_kbase/csf/mali_kbase_csf_event.c
index 5c86688..63e6c15 100644
--- a/mali_kbase/csf/mali_kbase_csf_event.c
+++ b/mali_kbase/csf/mali_kbase_csf_event.c
@@ -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-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
@@ -102,7 +102,7 @@ static void sync_update_notify_gpu(struct kbase_context *kctx)
if (can_notify_gpu) {
kbase_csf_ring_doorbell(kctx->kbdev, CSF_KERNEL_DOORBELL_NR);
- KBASE_KTRACE_ADD(kctx->kbdev, SYNC_UPDATE_EVENT_NOTIFY_GPU, kctx, 0u);
+ KBASE_KTRACE_ADD(kctx->kbdev, CSF_SYNC_UPDATE_NOTIFY_GPU_EVENT, kctx, 0u);
}
spin_unlock_irqrestore(&kctx->kbdev->hwaccess_lock, flags);
@@ -120,7 +120,7 @@ void kbase_csf_event_signal(struct kbase_context *kctx, bool notify_gpu)
/* First increment the signal count and wake up event thread.
*/
atomic_set(&kctx->event_count, 1);
- kbase_event_wakeup(kctx);
+ kbase_event_wakeup_nosync(kctx);
/* Signal the CSF firmware. This is to ensure that pending command
* stream synch object wait operations are re-evaluated.
@@ -169,7 +169,8 @@ void kbase_csf_event_term(struct kbase_context *kctx)
kfree(event_cb);
}
- WARN_ON(!list_empty(&kctx->csf.event.error_list));
+ WARN(!list_empty(&kctx->csf.event.error_list),
+ "Error list not empty for ctx %d_%d\n", kctx->tgid, kctx->id);
spin_unlock_irqrestore(&kctx->csf.event.lock, flags);
}
@@ -226,12 +227,15 @@ void kbase_csf_event_add_error(struct kbase_context *const kctx,
return;
spin_lock_irqsave(&kctx->csf.event.lock, flags);
- if (!WARN_ON(!list_empty(&error->link))) {
+ if (list_empty(&error->link)) {
error->data = *data;
list_add_tail(&error->link, &kctx->csf.event.error_list);
dev_dbg(kctx->kbdev->dev,
"Added error %pK of type %d in context %pK\n",
(void *)error, data->type, (void *)kctx);
+ } else {
+ dev_dbg(kctx->kbdev->dev, "Error %pK of type %d already pending in context %pK",
+ (void *)error, error->data.type, (void *)kctx);
}
spin_unlock_irqrestore(&kctx->csf.event.lock, flags);
}
@@ -241,6 +245,14 @@ bool kbase_csf_event_error_pending(struct kbase_context *kctx)
bool error_pending = false;
unsigned long flags;
+ /* Withhold the error event if the dump on fault is ongoing.
+ * This would prevent the Userspace from taking error recovery actions
+ * (which can potentially affect the state that is being dumped).
+ * Event handling thread would eventually notice the error event.
+ */
+ if (unlikely(!kbase_debug_csf_fault_dump_complete(kctx->kbdev)))
+ return false;
+
spin_lock_irqsave(&kctx->csf.event.lock, flags);
error_pending = !list_empty(&kctx->csf.event.error_list);