From: Tom St Denis Date: Mon, 13 Feb 2017 19:11:40 +0000 (-0500) Subject: drm/amd/amdgpu: Fix flow control in uvd_v4_2_stop() X-Git-Tag: v4.11-rc1~83^2~15^2~2 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=e89d5b5c202831648b853be20a5b9f8170d642d5;p=linux.git drm/amd/amdgpu: Fix flow control in uvd_v4_2_stop() Break out of outer loop properly. Signed-off-by: Tom St Denis Reported-by: Dan Carpenter Reviewed-by: Christian König Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c b/drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c index 97af4827f652..b34cefc7ebd5 100644 --- a/drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c +++ b/drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c @@ -401,7 +401,8 @@ static void uvd_v4_2_stop(struct amdgpu_device *adev) break; mdelay(1); } - break; + if (status & 2) + break; } for (i = 0; i < 10; ++i) { @@ -411,7 +412,8 @@ static void uvd_v4_2_stop(struct amdgpu_device *adev) break; mdelay(1); } - break; + if (status & 0xf) + break; } /* Stall UMC and register bus before resetting VCPU */ @@ -424,7 +426,8 @@ static void uvd_v4_2_stop(struct amdgpu_device *adev) break; mdelay(1); } - break; + if (status & 0x240) + break; } WREG32_P(0x3D49, 0, ~(1 << 2));