summaryrefslogtreecommitdiff
path: root/mali_kbase/mmu
diff options
context:
space:
mode:
authorJack Diver <diverj@google.com>2022-03-08 15:56:35 +0000
committerJack Diver <diverj@google.com>2022-04-20 16:51:10 +0000
commitc3f1f97be8e39e3c84d5e0b1c42cc6a35966f3ee (patch)
treeb662b436bd2c8a506deb5d40d320e6a561cb12e2 /mali_kbase/mmu
parent989034959f4344c17a6cdfe0a6b5b430e9f5fae6 (diff)
downloadgpu-c3f1f97be8e39e3c84d5e0b1c42cc6a35966f3ee.tar.gz
mali_kbase: Remove mali_kbase_mmu_do_operation_locked
The locked variant of this function is not required and simply increases lock contention. All locations where the locking aims to synchronize with PM code are already guaranteed not to race, because a PM reference is held. Removing the locked variant reduces our diff with upstream. Test: Boot to home Test: Suspend/resume stress test Signed-off-by: Jack Diver <diverj@google.com> Change-Id: If51d4cd45bac8afbd68dc9f92ebbaf421c28d800
Diffstat (limited to 'mali_kbase/mmu')
-rw-r--r--mali_kbase/mmu/mali_kbase_mmu.c6
-rw-r--r--mali_kbase/mmu/mali_kbase_mmu_hw.h16
-rw-r--r--mali_kbase/mmu/mali_kbase_mmu_hw_direct.c15
3 files changed, 3 insertions, 34 deletions
diff --git a/mali_kbase/mmu/mali_kbase_mmu.c b/mali_kbase/mmu/mali_kbase_mmu.c
index 3e001ee..90af861 100644
--- a/mali_kbase/mmu/mali_kbase_mmu.c
+++ b/mali_kbase/mmu/mali_kbase_mmu.c
@@ -152,7 +152,7 @@ mmu_flush_invalidate_on_gpu_ctrl(struct kbase_device *kbdev,
/* 1. Issue MMU_AS_CONTROL.COMMAND.LOCK operation. */
op_param->op = KBASE_MMU_OP_LOCK;
- ret = kbase_mmu_hw_do_operation_locked(kbdev, as, op_param);
+ ret = kbase_mmu_hw_do_operation(kbdev, as, op_param);
if (ret)
return ret;
@@ -161,7 +161,7 @@ mmu_flush_invalidate_on_gpu_ctrl(struct kbase_device *kbdev,
/* 3. Issue MMU_AS_CONTROL.COMMAND.UNLOCK operation. */
op_param->op = KBASE_MMU_OP_UNLOCK;
- ret2 = kbase_mmu_hw_do_operation_locked(kbdev, as, op_param);
+ ret2 = kbase_mmu_hw_do_operation(kbdev, as, op_param);
return ret ?: ret2;
}
@@ -1845,7 +1845,7 @@ static void kbase_mmu_flush_invalidate_noretain(struct kbase_context *kctx,
err = mmu_flush_invalidate_on_gpu_ctrl(
kbdev, &kbdev->as[kctx->as_nr], &op_param);
} else {
- err = kbase_mmu_hw_do_operation_locked(kbdev, &kbdev->as[kctx->as_nr],
+ err = kbase_mmu_hw_do_operation(kbdev, &kbdev->as[kctx->as_nr],
&op_param);
}
diff --git a/mali_kbase/mmu/mali_kbase_mmu_hw.h b/mali_kbase/mmu/mali_kbase_mmu_hw.h
index 68b73b7..ff4c932 100644
--- a/mali_kbase/mmu/mali_kbase_mmu_hw.h
+++ b/mali_kbase/mmu/mali_kbase_mmu_hw.h
@@ -102,22 +102,6 @@ void kbase_mmu_hw_configure(struct kbase_device *kbdev,
struct kbase_as *as);
/**
- * kbase_mmu_hw_do_operation_locked - Issue an operation to the MMU.
- * @kbdev: kbase device to issue the MMU operation on.
- * @as: address space to issue the MMU operation on.
- * @op_param: parameters for the operation.
- *
- * Issue an operation (MMU invalidate, MMU flush, etc) on the address space that
- * is associated with the provided kbase_context over the specified range
- *
- * Context: Expects the caller to hold the hwaccess_lock and the mmu_hw_mutex
- *
- * Return: Zero if the operation was successful, non-zero otherwise.
- */
-int kbase_mmu_hw_do_operation_locked(struct kbase_device *kbdev, struct kbase_as *as,
- struct kbase_mmu_hw_op_param *op_param);
-
-/**
* kbase_mmu_hw_do_operation - Issue an operation to the MMU.
* @kbdev: kbase device to issue the MMU operation on.
* @as: address space to issue the MMU operation on.
diff --git a/mali_kbase/mmu/mali_kbase_mmu_hw_direct.c b/mali_kbase/mmu/mali_kbase_mmu_hw_direct.c
index 9073969..93f16ba 100644
--- a/mali_kbase/mmu/mali_kbase_mmu_hw_direct.c
+++ b/mali_kbase/mmu/mali_kbase_mmu_hw_direct.c
@@ -226,21 +226,6 @@ int kbase_mmu_hw_do_operation(struct kbase_device *kbdev, struct kbase_as *as,
struct kbase_mmu_hw_op_param *op_param)
{
int ret;
- unsigned long flags;
-
- lockdep_assert_held(&kbdev->mmu_hw_mutex);
-
- spin_lock_irqsave(&kbdev->hwaccess_lock, flags);
- ret = kbase_mmu_hw_do_operation_locked(kbdev, as, op_param);
- spin_unlock_irqrestore(&kbdev->hwaccess_lock, flags);
-
- return ret;
-}
-
-int kbase_mmu_hw_do_operation_locked(struct kbase_device *kbdev, struct kbase_as *as,
- struct kbase_mmu_hw_op_param *op_param)
-{
- int ret;
u64 lock_addr = 0x0;
if (WARN_ON(kbdev == NULL) ||