summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/xe/xe_device_sysfs.c
diff options
context:
space:
mode:
authorRodrigo Vivi <rodrigo.vivi@intel.com>2024-02-22 11:39:28 -0500
committerRodrigo Vivi <rodrigo.vivi@intel.com>2024-02-26 09:06:45 -0500
commit3f0e14651ab0ca340c4b6f77b2ea615605fcf8f8 (patch)
treed9a1dae42093430501420cb4cfa66045d4402bcb /drivers/gpu/drm/xe/xe_device_sysfs.c
parent6a0784e6001f42b87af21ab63b3935ef4d6c6407 (diff)
drm/xe: Runtime PM wake on every sysfs call
Let's ensure our PCI device is awaken on every sysfs call. Let's increase the runtime_pm protection and start moving that to the outer bounds. For now, for the files with small number of attr functions, let's only call the runtime pm functions directly. For the hw_engines entries with many files, let's add the sysfs_ops wrapper. 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-5-rodrigo.vivi@intel.com
Diffstat (limited to 'drivers/gpu/drm/xe/xe_device_sysfs.c')
-rw-r--r--drivers/gpu/drm/xe/xe_device_sysfs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/xe/xe_device_sysfs.c b/drivers/gpu/drm/xe/xe_device_sysfs.c
index 99113a5a2b84..e47c8ad1bb17 100644
--- a/drivers/gpu/drm/xe/xe_device_sysfs.c
+++ b/drivers/gpu/drm/xe/xe_device_sysfs.c
@@ -35,7 +35,9 @@ vram_d3cold_threshold_show(struct device *dev,
if (!xe)
return -EINVAL;
+ xe_pm_runtime_get(xe);
ret = sysfs_emit(buf, "%d\n", xe->d3cold.vram_threshold);
+ xe_pm_runtime_put(xe);
return ret;
}
@@ -58,7 +60,9 @@ vram_d3cold_threshold_store(struct device *dev, struct device_attribute *attr,
drm_dbg(&xe->drm, "vram_d3cold_threshold: %u\n", vram_d3cold_threshold);
+ xe_pm_runtime_get(xe);
ret = xe_pm_set_vram_threshold(xe, vram_d3cold_threshold);
+ xe_pm_runtime_put(xe);
return ret ?: count;
}