[Intel-gfx] [PATCH 2/2] drm/i915: Swap ret and status returned from skl_pcode_request
Govindapillai, Vinod
vinod.govindapillai at intel.com
Mon Apr 11 08:35:10 UTC 2022
Thanks!
Reviewed-by: Vinod Govindapillai <vinod.govindapillai at intel.com>
> -----Original Message-----
> From: Lisovskiy, Stanislav <stanislav.lisovskiy at intel.com>
> Sent: 11 April 2022 11:14
> To: intel-gfx at lists.freedesktop.org
> Cc: Lisovskiy, Stanislav <stanislav.lisovskiy at intel.com>; Govindapillai, Vinod
> <vinod.govindapillai at intel.com>; Saarinen, Jani <jani.saarinen at intel.com>
> Subject: [PATCH 2/2] drm/i915: Swap ret and status returned from
> skl_pcode_request
>
> 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 at intel.com>
> ---
> drivers/gpu/drm/i915/intel_pcode.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_pcode.c
> b/drivers/gpu/drm/i915/intel_pcode.c
> index fb6c43e8a02f..ac727546868e 100644
> --- a/drivers/gpu/drm/i915/intel_pcode.c
> +++ b/drivers/gpu/drm/i915/intel_pcode.c
> @@ -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
> }
>
> --
> 2.24.1.485.gad05a3d8e5
More information about the Intel-gfx
mailing list