Commit 03af26c9 authored by Matthew Auld's avatar Matthew Auld Committed by Rodrigo Vivi

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: default avatarMatthew Auld <matthew.auld@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: default avatarMatthew Brost <matthew.brost@intel.com>
Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent 7da1d76f
...@@ -535,8 +535,8 @@ static int gt_reset(struct xe_gt *gt) ...@@ -535,8 +535,8 @@ static int gt_reset(struct xe_gt *gt)
if (err) if (err)
goto err_out; goto err_out;
xe_device_mem_access_put(gt_to_xe(gt));
err = xe_force_wake_put(gt_to_fw(gt), XE_FORCEWAKE_ALL); 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_WARN_ON(err);
xe_gt_info(gt, "reset done\n"); xe_gt_info(gt, "reset done\n");
...@@ -579,8 +579,8 @@ void xe_gt_suspend_prepare(struct xe_gt *gt) ...@@ -579,8 +579,8 @@ void xe_gt_suspend_prepare(struct xe_gt *gt)
xe_uc_stop_prepare(&gt->uc); 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_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) int xe_gt_suspend(struct xe_gt *gt)
...@@ -602,8 +602,8 @@ int xe_gt_suspend(struct xe_gt *gt) ...@@ -602,8 +602,8 @@ int xe_gt_suspend(struct xe_gt *gt)
if (err) if (err)
goto err_force_wake; 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_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"); xe_gt_info(gt, "suspended\n");
return 0; return 0;
...@@ -630,8 +630,8 @@ int xe_gt_resume(struct xe_gt *gt) ...@@ -630,8 +630,8 @@ int xe_gt_resume(struct xe_gt *gt)
if (err) if (err)
goto err_force_wake; 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_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"); xe_gt_info(gt, "resumed\n");
return 0; return 0;
......
...@@ -45,8 +45,8 @@ static int hw_engines(struct seq_file *m, void *data) ...@@ -45,8 +45,8 @@ static int hw_engines(struct seq_file *m, void *data)
for_each_hw_engine(hwe, gt, id) for_each_hw_engine(hwe, gt, id)
xe_hw_engine_print(hwe, &p); xe_hw_engine_print(hwe, &p);
xe_device_mem_access_put(xe);
err = xe_force_wake_put(gt_to_fw(gt), XE_FORCEWAKE_ALL); err = xe_force_wake_put(gt_to_fw(gt), XE_FORCEWAKE_ALL);
xe_device_mem_access_put(xe);
if (err) if (err)
return err; return err;
......
...@@ -848,8 +848,8 @@ int xe_guc_pc_start(struct xe_guc_pc *pc) ...@@ -848,8 +848,8 @@ int xe_guc_pc_start(struct xe_guc_pc *pc)
ret = pc_action_setup_gucrc(pc, XE_GUCRC_FIRMWARE_CONTROL); ret = pc_action_setup_gucrc(pc, XE_GUCRC_FIRMWARE_CONTROL);
out: 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_WARN_ON(xe_force_wake_put(gt_to_fw(gt), XE_FORCEWAKE_ALL));
xe_device_mem_access_put(pc_to_xe(pc));
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment