diff options
author | Mattias Simonsson <mattiass@google.com> | 2023-05-22 14:07:20 +0000 |
---|---|---|
committer | Mattias Simonsson <mattiass@google.com> | 2023-05-24 09:46:21 +0000 |
commit | 37584753704e12d68043af1abd7e9c33c919c29b (patch) | |
tree | 41e744a7bf1dd3bd5c49afef9159f335bb9dc920 /mali_kbase/context/backend | |
parent | c91dc341da12a38da522ed3e9b0a091ae6272fdc (diff) | |
download | gpu-37584753704e12d68043af1abd7e9c33c919c29b.tar.gz |
Make sure jobs are flushed before kbasep_platform_context_term
If kbase_release is called while jobs are in progress, the driver
will start by calling kbasep_platform_context_term before waiting
for jobs to finish in kbase_context_flush_jobs. When the jobs do
finish, the driver will call kbasep_platform_event_work_end, which
leads to issues since the platform callback has already cleaned
up resources for the kbase_context.
Make sure kbase_context_flush_jobs is called before
kbasep_platform_context_term.
Test: start/stop processes over and over
Bug: 278366794
Change-Id: Iee0297f4b64a3f6b59a5df0c26e46d446257a652
Diffstat (limited to 'mali_kbase/context/backend')
-rw-r--r-- | mali_kbase/context/backend/mali_kbase_context_csf.c | 4 | ||||
-rw-r--r-- | mali_kbase/context/backend/mali_kbase_context_jm.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/mali_kbase/context/backend/mali_kbase_context_csf.c b/mali_kbase/context/backend/mali_kbase_context_csf.c index 201349c..ef0b973 100644 --- a/mali_kbase/context/backend/mali_kbase_context_csf.c +++ b/mali_kbase/context/backend/mali_kbase_context_csf.c @@ -99,12 +99,12 @@ static const struct kbase_context_init context_init[] = { { kbase_sticky_resource_init, kbase_context_sticky_resource_term, "Sticky resource initialization failed" }, { kbase_jit_init, kbase_jit_term, "JIT initialization failed" }, + { kbasep_platform_context_init, kbasep_platform_context_term, + "Platform callback for kctx initialization failed" }, { kbase_csf_ctx_init, kbase_csf_ctx_term, "CSF context initialization failed" }, { kbase_context_add_to_dev_list, kbase_context_remove_from_dev_list, "Adding kctx to device failed" }, - { kbasep_platform_context_init, kbasep_platform_context_term, - "Platform callback for kctx initialization failed" }, }; static void kbase_context_term_partial( diff --git a/mali_kbase/context/backend/mali_kbase_context_jm.c b/mali_kbase/context/backend/mali_kbase_context_jm.c index 4091fb7..4e58ed6 100644 --- a/mali_kbase/context/backend/mali_kbase_context_jm.c +++ b/mali_kbase/context/backend/mali_kbase_context_jm.c @@ -159,11 +159,11 @@ static const struct kbase_context_init context_init[] = { kbase_debug_job_fault_context_term, "Job fault context initialization failed" }, #endif + { kbasep_platform_context_init, kbasep_platform_context_term, + "Platform callback for kctx initialization failed" }, { NULL, kbase_context_flush_jobs, NULL }, { kbase_context_add_to_dev_list, kbase_context_remove_from_dev_list, "Adding kctx to device failed" }, - { kbasep_platform_context_init, kbasep_platform_context_term, - "Platform callback for kctx initialization failed" }, }; static void kbase_context_term_partial( |