From 04a45bbc0900199e0e86c094dfb984abb697a3d2 Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Thu, 24 Sep 2026 13:29:52 -0400 Subject: [PATCH] drm/amdgpu: use pm_runtime_resume_and_get amdgpu_gem_create_ioctl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This ioctl might trigger GPU work through ttm so make sure the GPU is awake. Signed-off-by: Pierre-Eric Pelloux-Prayer Co-developed-by: Shahyan Soltani Signed-off-by: Shahyan Soltani Reviewed-by: Christian König Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c index 56eaf05899a8..bcbee2a11419 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -442,6 +443,12 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data, uint32_t handle, initial_domain; int r; + PM_RUNTIME_ACQUIRE_IF_ENABLED_AUTOSUSPEND(dev->dev, lock); + + r = PM_RUNTIME_ACQUIRE_ERR(&lock); + if (r) + return r; + /* reject invalid gem flags */ if (flags & ~AMDGPU_GEM_CREATE_SETTABLE_MASK) return -EINVAL;