diff options
| author | Lucas De Marchi <lucas.demarchi@intel.com> | 2025-01-24 08:04:09 +0300 |
|---|---|---|
| committer | Lucas De Marchi <lucas.demarchi@intel.com> | 2025-01-27 19:55:03 +0300 |
| commit | 4ee64041bcca5289623c287336bfd94a42f42104 (patch) | |
| tree | 68a8148d96f8d6d280ec2284a40184deb0bc7e44 | |
| parent | ef7ce3938621e47c6aa2d517eab6f1d484ad365b (diff) | |
| download | linux-4ee64041bcca5289623c287336bfd94a42f42104.tar.xz | |
drm/xe/pmu: Get/put runtime pm on event init
When the event is created, make sure runtime pm is taken and later put:
in order to read an event counter the GPU needs to remain accessible and
doing a get/put during perf's read is not possible it's holding a
raw_spinlock.
Suggested-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250124050411.2189060-4-lucas.demarchi@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
| -rw-r--r-- | drivers/gpu/drm/xe/xe_pmu.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/xe/xe_pmu.c b/drivers/gpu/drm/xe/xe_pmu.c index 33598272db6a..6678340d6195 100644 --- a/drivers/gpu/drm/xe/xe_pmu.c +++ b/drivers/gpu/drm/xe/xe_pmu.c @@ -7,6 +7,7 @@ #include <linux/device.h> #include "xe_device.h" +#include "xe_pm.h" #include "xe_pmu.h" /** @@ -68,6 +69,7 @@ static void xe_pmu_event_destroy(struct perf_event *event) struct xe_device *xe = container_of(event->pmu, typeof(*xe), pmu.base); drm_WARN_ON(&xe->drm, event->parent); + xe_pm_runtime_put(xe); drm_dev_put(&xe->drm); } @@ -100,6 +102,7 @@ static int xe_pmu_event_init(struct perf_event *event) if (!event->parent) { drm_dev_get(&xe->drm); + xe_pm_runtime_get(xe); event->destroy = xe_pmu_event_destroy; } |
