summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
diff options
context:
space:
mode:
authorNirmoy Das <nirmoy.das@amd.com>2020-01-09 12:07:22 +0100
committerAlex Deucher <alexander.deucher@amd.com>2020-01-16 13:35:03 -0500
commit55414ad5c983ed708d778ea7b29e80f89750ff73 (patch)
tree5e7934607f98c6de0f630ffbc7eb6730b581d0eb /drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
parent8eee00f615f830c0569923ef3047cf9535f82c39 (diff)
downloadlinux-stable-55414ad5c983ed708d778ea7b29e80f89750ff73.tar.gz
linux-stable-55414ad5c983ed708d778ea7b29e80f89750ff73.tar.bz2
linux-stable-55414ad5c983ed708d778ea7b29e80f89750ff73.zip
drm/amdgpu: error out on entity with no run queue
Disabled HW IP's entity initialized with NULL rq. We should not process any submit request from userspace for a disabled HW IP. Signed-off-by: Nirmoy Das <nirmoy.das@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index 5b330f69194b..7a8772b7caf7 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -909,6 +909,11 @@ static int amdgpu_cs_ib_fill(struct amdgpu_device *adev,
if (parser->entity && parser->entity != entity)
return -EINVAL;
+ /* Return if there is no run queue associated with this entity.
+ * Possibly because of disabled HW IP*/
+ if (entity->rq == NULL)
+ return -EINVAL;
+
parser->entity = entity;
ring = to_amdgpu_ring(entity->rq->sched);