drm/xe: Remove mem_access from suspend and resume functions
authorRodrigo Vivi <rodrigo.vivi@intel.com>
Thu, 22 Feb 2024 16:39:35 +0000 (11:39 -0500)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Mon, 26 Feb 2024 14:06:45 +0000 (09:06 -0500)
At these points, we are sure that device is awake in D0.
Likely in the middle of the transition, but awake. So,
these extra protections are useless. Let's remove it and
continue with the killing of xe_device_mem_access.

Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240222163937.138342-12-rodrigo.vivi@intel.com
drivers/gpu/drm/xe/xe_gt.c

index b75f0bf..e0c7935 100644 (file)
@@ -711,13 +711,11 @@ void xe_gt_reset_async(struct xe_gt *gt)
 
 void xe_gt_suspend_prepare(struct xe_gt *gt)
 {
-       xe_device_mem_access_get(gt_to_xe(gt));
        XE_WARN_ON(xe_force_wake_get(gt_to_fw(gt), XE_FORCEWAKE_ALL));
 
        xe_uc_stop_prepare(&gt->uc);
 
        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)
@@ -726,7 +724,6 @@ int xe_gt_suspend(struct xe_gt *gt)
 
        xe_gt_sanitize(gt);
 
-       xe_device_mem_access_get(gt_to_xe(gt));
        err = xe_force_wake_get(gt_to_fw(gt), XE_FORCEWAKE_ALL);
        if (err)
                goto err_msg;
@@ -736,7 +733,6 @@ int xe_gt_suspend(struct xe_gt *gt)
                goto err_force_wake;
 
        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;
@@ -744,7 +740,6 @@ int xe_gt_suspend(struct xe_gt *gt)
 err_force_wake:
        XE_WARN_ON(xe_force_wake_put(gt_to_fw(gt), XE_FORCEWAKE_ALL));
 err_msg:
-       xe_device_mem_access_put(gt_to_xe(gt));
        xe_gt_err(gt, "suspend failed (%pe)\n", ERR_PTR(err));
 
        return err;
@@ -754,7 +749,6 @@ int xe_gt_resume(struct xe_gt *gt)
 {
        int err;
 
-       xe_device_mem_access_get(gt_to_xe(gt));
        err = xe_force_wake_get(gt_to_fw(gt), XE_FORCEWAKE_ALL);
        if (err)
                goto err_msg;
@@ -764,7 +758,6 @@ int xe_gt_resume(struct xe_gt *gt)
                goto err_force_wake;
 
        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;
@@ -772,7 +765,6 @@ int xe_gt_resume(struct xe_gt *gt)
 err_force_wake:
        XE_WARN_ON(xe_force_wake_put(gt_to_fw(gt), XE_FORCEWAKE_ALL));
 err_msg:
-       xe_device_mem_access_put(gt_to_xe(gt));
        xe_gt_err(gt, "resume failed (%pe)\n", ERR_PTR(err));
 
        return err;