diff options
author | Suzanne Candanedo <suzanne.candanedo@arm.com> | 2022-10-05 16:05:11 +0100 |
---|---|---|
committer | Guus Sliepen <gsliepen@google.com> | 2022-11-11 09:50:09 +0000 |
commit | 6fec92db20c3563da85bc99bde020a18b49f71b6 (patch) | |
tree | 876b36540487efbc15bb60cce72a157961e6ceeb | |
parent | dac5e7b94fdc5c38522463a1efd303ee94072100 (diff) | |
download | gpu-6fec92db20c3563da85bc99bde020a18b49f71b6.tar.gz |
mali_kbase: MIDCET-4220 Patch for GPUSWERRATA-1400
This patch is a fix for SW errata 2696314 fixing race
with kctx->csf.event.error_list.
Bug: 240184939
Provenance: https://code.ipdelivery.arm.com/c/GPU/mali-ddk/+/4604/1
Signed-off-by: Jesse Hall <jessehall@google.com>
Change-Id: I8c7ddaec720ede29720ade20e56363ce010503a8
-rw-r--r-- | mali_kbase/csf/mali_kbase_csf.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/mali_kbase/csf/mali_kbase_csf.c b/mali_kbase/csf/mali_kbase_csf.c index 1a92267..6d4519b 100644 --- a/mali_kbase/csf/mali_kbase_csf.c +++ b/mali_kbase/csf/mali_kbase_csf.c @@ -1591,24 +1591,28 @@ void kbase_csf_queue_group_terminate(struct kbase_context *kctx, group = find_queue_group(kctx, group_handle); if (group) { - remove_pending_group_fatal_error(group); + /* Stop the running of the given group */ term_queue_group(group); kctx->csf.queue_groups[group_handle] = NULL; + rt_mutex_unlock(&kctx->csf.lock); + + /* Cancel any pending event callbacks. If one is in progress + * then this thread waits synchronously for it to complete (which + * is why we must unlock the context first). We already ensured + * that no more callbacks can be enqueued by terminating the group. + */ + cancel_queue_group_events(group); + + rt_mutex_lock(&kctx->csf.lock); + + /* Clean up after the termination */ + remove_pending_group_fatal_error(group); } mutex_unlock(&kctx->csf.lock); if (reset_prevented) kbase_reset_gpu_allow(kbdev); - if (!group) - return; - - /* Cancel any pending event callbacks. If one is in progress - * then this thread waits synchronously for it to complete (which - * is why we must unlock the context first). We already ensured - * that no more callbacks can be enqueued by terminating the group. - */ - cancel_queue_group_events(group); kfree(group); } |