From 0726e3dd4b05c21a7b132b4c6cc6be0d64356051 Mon Sep 17 00:00:00 2001 From: jsg Date: Mon, 29 Jan 2024 01:30:49 +0000 Subject: [PATCH] drm/radeon: check return value of radeon_ring_lock() From Nikita Zhandarovich 18bd4d184675fbb2fc4b2f9b80aaebea2e05fca0 in linux-6.6.y/6.6.14 71225e1c930942cb1e042fc08c5cc0c4ef30e95e in mainline linux --- sys/dev/pci/drm/radeon/si.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/dev/pci/drm/radeon/si.c b/sys/dev/pci/drm/radeon/si.c index 46d03be180b..e542f2227d4 100644 --- a/sys/dev/pci/drm/radeon/si.c +++ b/sys/dev/pci/drm/radeon/si.c @@ -3611,6 +3611,10 @@ static int si_cp_start(struct radeon_device *rdev) for (i = RADEON_RING_TYPE_GFX_INDEX; i <= CAYMAN_RING_TYPE_CP2_INDEX; ++i) { ring = &rdev->ring[i]; r = radeon_ring_lock(rdev, ring, 2); + if (r) { + DRM_ERROR("radeon: cp failed to lock ring (%d).\n", r); + return r; + } /* clear the compute context state */ radeon_ring_write(ring, PACKET3_COMPUTE(PACKET3_CLEAR_STATE, 0)); -- 2.20.1