From c564ecebd1ea4acf8463b2cc9e8bddea98cfdc26 Mon Sep 17 00:00:00 2001 From: Jiyu Yang Date: Fri, 5 Jul 2019 19:41:58 +0800 Subject: [PATCH] gpu: security patch for midgard [2/2] PD#SWPL-10710 Problem: same as PD#SWPL-10285 Solution: applied PD#SWPL-10285 patch Verify: q201 Change-Id: Ib45a2b31dfa5ff3d0fd17d1bc0d1a271efac146d Signed-off-by: Jiyu Yang --- .../gpu/arm/midgard/backend/gpu/mali_kbase_jm_rb.c | 8 ++++++-- .../kernel/drivers/gpu/arm/midgard/mali_kbase_sync_file.c | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/t83x/kernel/drivers/gpu/arm/midgard/backend/gpu/mali_kbase_jm_rb.c b/t83x/kernel/drivers/gpu/arm/midgard/backend/gpu/mali_kbase_jm_rb.c index c714582..747de93 100644 --- a/t83x/kernel/drivers/gpu/arm/midgard/backend/gpu/mali_kbase_jm_rb.c +++ b/t83x/kernel/drivers/gpu/arm/midgard/backend/gpu/mali_kbase_jm_rb.c @@ -344,14 +344,18 @@ static void kbase_gpu_release_atom(struct kbase_device *kbdev, (katom->protected_state.enter != KBASE_ATOM_ENTER_PROTECTED_CHECK) && (katom->protected_state.enter != - KBASE_ATOM_ENTER_PROTECTED_HWCNT)) + KBASE_ATOM_ENTER_PROTECTED_HWCNT)) { kbase_pm_protected_override_disable(kbdev); + kbase_pm_update_cores_state_nolock(kbdev); + } if (!kbase_jd_katom_is_protected(katom) && (katom->protected_state.exit != KBASE_ATOM_EXIT_PROTECTED_CHECK) && (katom->protected_state.exit != - KBASE_ATOM_EXIT_PROTECTED_RESET_WAIT)) + KBASE_ATOM_EXIT_PROTECTED_RESET_WAIT)) { kbase_pm_protected_override_disable(kbdev); + kbase_pm_update_cores_state_nolock(kbdev); + } if (katom->protected_state.enter != KBASE_ATOM_ENTER_PROTECTED_CHECK || diff --git a/t83x/kernel/drivers/gpu/arm/midgard/mali_kbase_sync_file.c b/t83x/kernel/drivers/gpu/arm/midgard/mali_kbase_sync_file.c index 2312399..3daeb93 100644 --- a/t83x/kernel/drivers/gpu/arm/midgard/mali_kbase_sync_file.c +++ b/t83x/kernel/drivers/gpu/arm/midgard/mali_kbase_sync_file.c @@ -85,7 +85,9 @@ int kbase_sync_fence_out_create(struct kbase_jd_atom *katom, int stream_fd) /* create a sync_file fd representing the fence */ sync_file = sync_file_create(fence); if (!sync_file) { +#if (KERNEL_VERSION(4, 9, 67) >= LINUX_VERSION_CODE) dma_fence_put(fence); +#endif kbase_fence_out_remove(katom); return -ENOMEM; } -- 2.20.1