Skip to content

Commit

Permalink
drm/i915: Swap ret and status returned from skl_pcode_request
Browse files Browse the repository at this point in the history
If ret isn't zero, it is almost for sure ETIMEDOUT, because
we use it in wait_for macro which does continuous retries
until timeout is reached. If we still ran out of time and
retries, we most likely would be interested in getting status,
to understand what was the actual error propagated from PCode,
rather than to find out that we had a time out, which is anyway
quite obvious, if the function fails.

v2: Make it status ? status : ret(thanks Vinod for the hint)

Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
Reviewed-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220411081343.18099-1-stanislav.lisovskiy@intel.com
  • Loading branch information
StanFox1984 committed Apr 11, 2022
1 parent 9e0a1c3 commit 40a5695
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/intel_pcode.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ int skl_pcode_request(struct drm_i915_private *i915, u32 mbox, u32 request,

out:
mutex_unlock(&i915->sb_lock);
return ret ? ret : status;
return status ? status : ret;
#undef COND
}

Expand Down

0 comments on commit 40a5695

Please sign in to comment.