drm/xe/mmio: grab mem_access in xe_mmio_ioctl
authorMatthew Auld <matthew.auld@intel.com>
Wed, 19 Jul 2023 08:38:07 +0000 (09:38 +0100)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Thu, 21 Dec 2023 16:37:36 +0000 (11:37 -0500)
Any kind of device memory access should first ensure the device is not
suspended, mmio included.

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>
drivers/gpu/drm/xe/xe_mmio.c

index 448b874c7a3c73379a094710ddc567a82ed1ecc1..8d0f07261bfd8976277f4b0ad726fa38ebd8d0ae 100644 (file)
@@ -483,6 +483,7 @@ int xe_mmio_ioctl(struct drm_device *dev, void *data,
         */
        reg = XE_REG(args->addr);
 
+       xe_device_mem_access_get(xe);
        xe_force_wake_get(gt_to_fw(gt), XE_FORCEWAKE_ALL);
 
        if (args->flags & DRM_XE_MMIO_WRITE) {
@@ -526,6 +527,7 @@ int xe_mmio_ioctl(struct drm_device *dev, void *data,
 
 exit:
        xe_force_wake_put(gt_to_fw(gt), XE_FORCEWAKE_ALL);
+       xe_device_mem_access_put(xe);
 
        return ret;
 }