summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/xe
diff options
context:
space:
mode:
authorMatthew Auld <matthew.auld@intel.com>2023-07-19 11:38:08 +0300
committerRodrigo Vivi <rodrigo.vivi@intel.com>2023-12-21 19:37:36 +0300
commit03af26c9c9767b096cf4b69544f0140898530531 (patch)
tree7ef327a02d432f7f82fd4ecdfc755e9fa6ac22c0 /drivers/gpu/drm/xe
parent7da1d76ff647cc08d9400562a75a92e41ba6d7bc (diff)
downloadlinux-03af26c9c9767b096cf4b69544f0140898530531.tar.xz
drm/xe: ensure correct access_put ordering
Only call access_put after dropping the forcewake. In theory the device could suspend, but really we want to start asserting that we have a mem_access.ref when touching mmio. Signed-off-by: Matthew Auld <matthew.auld@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'drivers/gpu/drm/xe')
-rw-r--r--drivers/gpu/drm/xe/xe_gt.c8
-rw-r--r--drivers/gpu/drm/xe/xe_gt_debugfs.c2
-rw-r--r--drivers/gpu/drm/xe/xe_guc_pc.c2
3 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/drm/xe/xe_gt.c b/drivers/gpu/drm/xe/xe_gt.c
index b31ef2a8ff17..3e32d38aeeea 100644
--- a/drivers/gpu/drm/xe/xe_gt.c
+++ b/drivers/gpu/drm/xe/xe_gt.c
@@ -535,8 +535,8 @@ static int gt_reset(struct xe_gt *gt)
if (err)
goto err_out;
- xe_device_mem_access_put(gt_to_xe(gt));
err = xe_force_wake_put(gt_to_fw(gt), XE_FORCEWAKE_ALL);
+ xe_device_mem_access_put(gt_to_xe(gt));
XE_WARN_ON(err);
xe_gt_info(gt, "reset done\n");
@@ -579,8 +579,8 @@ void xe_gt_suspend_prepare(struct xe_gt *gt)
xe_uc_stop_prepare(&gt->uc);
- xe_device_mem_access_put(gt_to_xe(gt));
XE_WARN_ON(xe_force_wake_put(gt_to_fw(gt), XE_FORCEWAKE_ALL));
+ xe_device_mem_access_put(gt_to_xe(gt));
}
int xe_gt_suspend(struct xe_gt *gt)
@@ -602,8 +602,8 @@ int xe_gt_suspend(struct xe_gt *gt)
if (err)
goto err_force_wake;
- xe_device_mem_access_put(gt_to_xe(gt));
XE_WARN_ON(xe_force_wake_put(gt_to_fw(gt), XE_FORCEWAKE_ALL));
+ xe_device_mem_access_put(gt_to_xe(gt));
xe_gt_info(gt, "suspended\n");
return 0;
@@ -630,8 +630,8 @@ int xe_gt_resume(struct xe_gt *gt)
if (err)
goto err_force_wake;
- xe_device_mem_access_put(gt_to_xe(gt));
XE_WARN_ON(xe_force_wake_put(gt_to_fw(gt), XE_FORCEWAKE_ALL));
+ xe_device_mem_access_put(gt_to_xe(gt));
xe_gt_info(gt, "resumed\n");
return 0;
diff --git a/drivers/gpu/drm/xe/xe_gt_debugfs.c b/drivers/gpu/drm/xe/xe_gt_debugfs.c
index d0092d714ffe..f9f653243f20 100644
--- a/drivers/gpu/drm/xe/xe_gt_debugfs.c
+++ b/drivers/gpu/drm/xe/xe_gt_debugfs.c
@@ -45,8 +45,8 @@ static int hw_engines(struct seq_file *m, void *data)
for_each_hw_engine(hwe, gt, id)
xe_hw_engine_print(hwe, &p);
- xe_device_mem_access_put(xe);
err = xe_force_wake_put(gt_to_fw(gt), XE_FORCEWAKE_ALL);
+ xe_device_mem_access_put(xe);
if (err)
return err;
diff --git a/drivers/gpu/drm/xe/xe_guc_pc.c b/drivers/gpu/drm/xe/xe_guc_pc.c
index 0927cb669603..91a3967fd799 100644
--- a/drivers/gpu/drm/xe/xe_guc_pc.c
+++ b/drivers/gpu/drm/xe/xe_guc_pc.c
@@ -848,8 +848,8 @@ int xe_guc_pc_start(struct xe_guc_pc *pc)
ret = pc_action_setup_gucrc(pc, XE_GUCRC_FIRMWARE_CONTROL);
out:
- xe_device_mem_access_put(pc_to_xe(pc));
XE_WARN_ON(xe_force_wake_put(gt_to_fw(gt), XE_FORCEWAKE_ALL));
+ xe_device_mem_access_put(pc_to_xe(pc));
return ret;
}