diff options
author | Jörg Wagner <jorwag@google.com> | 2023-08-31 19:15:13 +0000 |
---|---|---|
committer | Jörg Wagner <jorwag@google.com> | 2023-09-01 09:13:55 +0000 |
commit | b6fd708b3a4da86a196a61592ea3585f1aca7313 (patch) | |
tree | 1cbe3029a45bf9869c17a5b6954e5ae074b44ac8 /mali_kbase/context/backend | |
parent | 46edf1b5965d872c5f8a09c6dc3dcbff58f78a92 (diff) | |
parent | e61eb93296e9f940b32d4ad4b0c3a5557cbeaf17 (diff) | |
download | gpu-b6fd708b3a4da86a196a61592ea3585f1aca7313.tar.gz |
Merge r44p1-00dev3 from partner/upstream into android13-gs-pixel-5.10-udc-qpr1
Bug: 290882327
Change-Id: I90723cbaa3f294431087587fd8025f0688e51bf2
Diffstat (limited to 'mali_kbase/context/backend')
-rw-r--r-- | mali_kbase/context/backend/mali_kbase_context_csf.c | 18 | ||||
-rw-r--r-- | mali_kbase/context/backend/mali_kbase_context_jm.c | 17 |
2 files changed, 29 insertions, 6 deletions
diff --git a/mali_kbase/context/backend/mali_kbase_context_csf.c b/mali_kbase/context/backend/mali_kbase_context_csf.c index 9aa661a..45a5a6c 100644 --- a/mali_kbase/context/backend/mali_kbase_context_csf.c +++ b/mali_kbase/context/backend/mali_kbase_context_csf.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note /* * - * (C) COPYRIGHT 2019-2022 ARM Limited. All rights reserved. + * (C) COPYRIGHT 2019-2023 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 @@ -124,7 +124,7 @@ struct kbase_context *kbase_create_context(struct kbase_device *kbdev, bool is_compat, base_context_create_flags const flags, unsigned long const api_version, - struct file *const filp) + struct kbase_file *const kfile) { struct kbase_context *kctx; unsigned int i = 0; @@ -143,9 +143,11 @@ struct kbase_context *kbase_create_context(struct kbase_device *kbdev, kctx->kbdev = kbdev; kctx->api_version = api_version; - kctx->filp = filp; + kctx->kfile = kfile; kctx->create_flags = flags; + memcpy(kctx->comm, current->comm, sizeof(current->comm)); + if (is_compat) kbase_ctx_flag_set(kctx, KCTX_COMPAT); #if defined(CONFIG_64BIT) @@ -213,6 +215,16 @@ void kbase_destroy_context(struct kbase_context *kctx) kctx->tgid, kctx->id); } + /* Have synchronized against the System suspend and incremented the + * pm.active_count. So any subsequent invocation of System suspend + * callback would get blocked. + * If System suspend callback was already in progress then the above loop + * would have waited till the System resume callback has begun. + * So wait for the System resume callback to also complete as we want to + * avoid context termination during System resume also. + */ + wait_event(kbdev->pm.resume_wait, !kbase_pm_is_resuming(kbdev)); + kbase_mem_pool_group_mark_dying(&kctx->mem_pools); kbase_context_term_partial(kctx, ARRAY_SIZE(context_init)); diff --git a/mali_kbase/context/backend/mali_kbase_context_jm.c b/mali_kbase/context/backend/mali_kbase_context_jm.c index 7acb3f6..39595d9 100644 --- a/mali_kbase/context/backend/mali_kbase_context_jm.c +++ b/mali_kbase/context/backend/mali_kbase_context_jm.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note /* * - * (C) COPYRIGHT 2019-2022 ARM Limited. All rights reserved. + * (C) COPYRIGHT 2019-2023 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 @@ -179,7 +179,7 @@ struct kbase_context *kbase_create_context(struct kbase_device *kbdev, bool is_compat, base_context_create_flags const flags, unsigned long const api_version, - struct file *const filp) + struct kbase_file *const kfile) { struct kbase_context *kctx; unsigned int i = 0; @@ -198,7 +198,7 @@ struct kbase_context *kbase_create_context(struct kbase_device *kbdev, kctx->kbdev = kbdev; kctx->api_version = api_version; - kctx->filp = filp; + kctx->kfile = kfile; kctx->create_flags = flags; if (is_compat) @@ -258,6 +258,17 @@ void kbase_destroy_context(struct kbase_context *kctx) wait_event(kbdev->pm.resume_wait, !kbase_pm_is_suspending(kbdev)); } + + /* Have synchronized against the System suspend and incremented the + * pm.active_count. So any subsequent invocation of System suspend + * callback would get blocked. + * If System suspend callback was already in progress then the above loop + * would have waited till the System resume callback has begun. + * So wait for the System resume callback to also complete as we want to + * avoid context termination during System resume also. + */ + wait_event(kbdev->pm.resume_wait, !kbase_pm_is_resuming(kbdev)); + #ifdef CONFIG_MALI_ARBITER_SUPPORT atomic_dec(&kbdev->pm.gpu_users_waiting); #endif /* CONFIG_MALI_ARBITER_SUPPORT */ |