Skip to contentSkip to conversation

drm/amdgpu: don't read registers if gfxoff is enabled

PATCH New Alex Deucher 1 participant 1 message Nov 12, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: don't read registers if gfxoff is enabled

When gfxoff is enabled, accessing gfx registers via MMIO can lead to a hang.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +3 -0
index c975ca92e8fa..08c4cda3a569 100644
@@ -665,6 +665,9 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file
 		if (info->read_mmr_reg.count > 128)
 			return -EINVAL;
 
+		if (adev->pm.pp_feature & PP_GFXOFF_MASK)
+			return -EINVAL;
+
 		regs = kmalloc_array(info->read_mmr_reg.count, sizeof(*regs), GFP_KERNEL);
 		if (!regs)
 			return -ENOMEM;
Signature · 6 lines
2.23.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx