From 5e2c0c5c96d68aed9f6e2de857d49a61990ae55f Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Wed, 30 Aug 2017 13:34:07 -0700 Subject: gpu: nvgpu: Use error code in xve clock change Use the error code generated when the XVE clock change times out. Before this the error code was being set and the while loop that was polling the clock change status was broken out of. But the error code was only used later on in the while loop. Now just set the error code and only break from the loop later on when that error code is actually checked. Coverity ID: 2624553 Bug 200291879 Change-Id: If8f6046efcc9c4ad0eb13715735a57870be26110 Signed-off-by: Alex Waterman Reviewed-on: https://git-master.nvidia.com/r/1548711 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svc-mobile-coverity Reviewed-by: svccoveritychecker Reviewed-by: Deepak Nibade GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gp106/xve_gp106.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers/gpu') diff --git a/drivers/gpu/nvgpu/gp106/xve_gp106.c b/drivers/gpu/nvgpu/gp106/xve_gp106.c index 89b6b873..a3514fc0 100644 --- a/drivers/gpu/nvgpu/gp106/xve_gp106.c +++ b/drivers/gpu/nvgpu/gp106/xve_gp106.c @@ -355,7 +355,6 @@ static int __do_xve_set_speed_gp106(struct gk20a *g, u32 next_link_speed) err_status = -ETIMEDOUT; xv_sc_dbg(EXEC_CHANGE, " timeout; pl_link_config = 0x%x", pl_link_config); - break; } xv_sc_dbg(EXEC_CHANGE, " Change done... Checking status"); @@ -376,8 +375,10 @@ static int __do_xve_set_speed_gp106(struct gk20a *g, u32 next_link_speed) link_speed_setting, xve_link_control_status_link_speed_v(link_control_status)); - if (err_status == -ETIMEDOUT) + if (err_status == -ETIMEDOUT) { xv_sc_dbg(EXEC_CHANGE, " Oops timed out?"); + break; + } } while (attempts-- > 0 && link_speed_setting != xve_link_control_status_link_speed_v(link_control_status)); -- cgit v1.2.2