aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Auld <[email protected]>2023-07-12 17:28:39 +0100
committerRodrigo Vivi <[email protected]>2023-12-21 11:37:36 -0500
commit6a0612aeabcce6c951788384b94d503b99eefaca (patch)
treed597a6ff25bf99ec9beade7d737f122d7ace7ced
parente3d2309250d49e4558b0abe95924b18f74995607 (diff)
drm/xe/selftests: hold rpm for evict_test_run_device()
We are calling fairly low level things like xe_bo_restore_kernel() which expect caller to be holding mem_access.ref. Since we are doing stuff like evict_all we likely don't want to race with rpm suspend, since that potentially wants to do the same thing, so just wrap the whole test. Signed-off-by: Matthew Auld <[email protected]> Cc: Matthew Brost <[email protected]> Reviewed-by: Nirmoy Das <[email protected]> Signed-off-by: Rodrigo Vivi <[email protected]>
-rw-r--r--drivers/gpu/drm/xe/tests/xe_bo.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/xe/tests/xe_bo.c b/drivers/gpu/drm/xe/tests/xe_bo.c
index 5309204d8d1b..a63f7a447ca4 100644
--- a/drivers/gpu/drm/xe/tests/xe_bo.c
+++ b/drivers/gpu/drm/xe/tests/xe_bo.c
@@ -12,6 +12,7 @@
#include "xe_bo_evict.h"
#include "xe_pci.h"
+#include "xe_pm.h"
static int ccs_test_migrate(struct xe_gt *gt, struct xe_bo *bo,
bool clear, u64 get_val, u64 assign_val,
@@ -295,9 +296,13 @@ static int evict_test_run_device(struct xe_device *xe)
return 0;
}
+ xe_device_mem_access_get(xe);
+
for_each_gt(gt, xe, id)
evict_test_run_gt(xe, gt, test);
+ xe_device_mem_access_put(xe);
+
return 0;
}