Skip to content

Commit d3be5e0

Browse files
Ding Pixelgregkh
authored andcommitted
drm/amdgpu: check ring being ready before using
[ Upstream commit c5f21c9f878b8dcd54d0b9739c025ca73cb4c091 ] Return success when the ring is properly initialized, otherwise return failure. Tonga SRIOV VF doesn't have UVD and VCE engines, the initialization of these IPs is bypassed. The system crashes if application submit IB to their rings which are not ready to use. It could be a common issue if IP having ring buffer is disabled for some reason on specific ASIC, so it should check the ring being ready to use. Bug: amdgpu_test crashes system on Tonga VF. Signed-off-by: Ding Pixel <Pixel.Ding@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 58a766c commit d3be5e0

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,13 @@ int amdgpu_cs_get_ring(struct amdgpu_device *adev, u32 ip_type,
124124
}
125125
break;
126126
}
127+
128+
if (!(*out_ring && (*out_ring)->adev)) {
129+
DRM_ERROR("Ring %d is not initialized on IP %d\n",
130+
ring, ip_type);
131+
return -EINVAL;
132+
}
133+
127134
return 0;
128135
}
129136

0 commit comments

Comments
 (0)