From 2226bae46b7a606e97a9ced0e91d7209cd04758c Mon Sep 17 00:00:00 2001 From: Kevin Park Date: Fri, 8 Dec 2023 17:01:50 +0000 Subject: Fix deadlock BTW user thread and page fault worker MIDCET-4882,GPUCORE-40989 Break deadlock BTW user thread and page fault worker This commit adds a RW semaphore 1> to prevent MMU operations during P.Mode entrance and 2> to break the deadlock on 'kctx reg_lock' between user thread and page-fault worker thread. Bug: 301064831 Signed-off-by: Renato Grottesi Test: manual run of the use case from the ticket Provenance: https://code.ipdelivery.arm.com/c/GPU/mali-ddk/+/6221 Change-Id: I692f8fafc558a6a45b5ca4210aa3f66c2617553f --- mali_kbase/mali_kbase_gwt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'mali_kbase/mali_kbase_gwt.c') diff --git a/mali_kbase/mali_kbase_gwt.c b/mali_kbase/mali_kbase_gwt.c index 32c9241..4914e24 100644 --- a/mali_kbase/mali_kbase_gwt.c +++ b/mali_kbase/mali_kbase_gwt.c @@ -61,9 +61,9 @@ static void kbase_gpu_gwt_setup_pages(struct kbase_context *kctx, int kbase_gpu_gwt_start(struct kbase_context *kctx) { - kbase_gpu_vm_lock(kctx); + kbase_gpu_vm_lock_with_pmode_sync(kctx); if (kctx->gwt_enabled) { - kbase_gpu_vm_unlock(kctx); + kbase_gpu_vm_unlock_with_pmode_sync(kctx); return -EBUSY; } @@ -90,7 +90,7 @@ int kbase_gpu_gwt_start(struct kbase_context *kctx) kbase_gpu_gwt_setup_pages(kctx, ~KBASE_REG_GPU_WR); - kbase_gpu_vm_unlock(kctx); + kbase_gpu_vm_unlock_with_pmode_sync(kctx); return 0; } -- cgit v1.2.3