[Intel-gfx] [PATCH 13/15] drm/i915/huc: report HuC as loaded even if load still in progress
Teres Alexis, Alan Previn
alan.previn.teres.alexis at intel.com
Wed Jul 6 04:49:22 UTC 2022
On Thu, 2022-06-09 at 16:19 -0700, Ceraolo Spurio, Daniele wrote:
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_huc.c b/drivers/gpu/drm/i915/gt/uc/intel_huc.c
> index 075ec97b459d..33bfac91fa01 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_huc.c
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_huc.c
> @@ -426,7 +426,10 @@ int intel_huc_check_status(struct intel_huc *huc)
> break;
> }
>
> - return intel_huc_is_authenticated(huc);
> + if (intel_huc_is_authenticated(huc))
> + return 1;
> +
> + return !i915_sw_fence_done(&huc->delayed_load.fence);
>
Are we sure we dont have a race condition here? Perhaps a less cleaner but might tigher check might be:
if (i915_sw_fence_done(..) && intel_huc_is_authenticated(..))
return 1
else if (!i915_sw_fence_done(..))
return 1
return 0;
To speed things up a little, please accept a conditional R-b if you can reply back with why we might not need to worry
about the race condition or if i am just reading this incorrectly.
Reviewed-by: Alan Previn <alan.previn.teres.alexis at intel.com>
> }
>
> static bool huc_has_delayed_load(struct intel_huc *huc)
> --
> 2.25.1
>
More information about the Intel-gfx
mailing list