drm/i915/huc: Cancel HuC delayed load timer on reset.

In the rare case where we do a full GT reset after starting the HuC
load and before it completes (which basically boils down to i915 hanging
during init), we need to cancel the delayed load fence, as it will be
re-initialized in the post-reset recovery.

Fixes: 27536e03 ("drm/i915/huc: track delayed HuC load with a fence")
Signed-off-by: default avatarDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Alan Previn <alan.previn.teres.alexis@intel.com>
Reviewed-by: default avatarAlan Previn <alan.previn.teres.alexis@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230313205556.1174503-1-daniele.ceraolospurio@intel.com
parent fdd9b7dc
...@@ -241,6 +241,13 @@ static void delayed_huc_load_fini(struct intel_huc *huc) ...@@ -241,6 +241,13 @@ static void delayed_huc_load_fini(struct intel_huc *huc)
i915_sw_fence_fini(&huc->delayed_load.fence); i915_sw_fence_fini(&huc->delayed_load.fence);
} }
int intel_huc_sanitize(struct intel_huc *huc)
{
delayed_huc_load_complete(huc);
intel_uc_fw_sanitize(&huc->fw);
return 0;
}
static bool vcs_supported(struct intel_gt *gt) static bool vcs_supported(struct intel_gt *gt)
{ {
intel_engine_mask_t mask = gt->info.engine_mask; intel_engine_mask_t mask = gt->info.engine_mask;
......
...@@ -41,6 +41,7 @@ struct intel_huc { ...@@ -41,6 +41,7 @@ struct intel_huc {
} delayed_load; } delayed_load;
}; };
int intel_huc_sanitize(struct intel_huc *huc);
void intel_huc_init_early(struct intel_huc *huc); void intel_huc_init_early(struct intel_huc *huc);
int intel_huc_init(struct intel_huc *huc); int intel_huc_init(struct intel_huc *huc);
void intel_huc_fini(struct intel_huc *huc); void intel_huc_fini(struct intel_huc *huc);
...@@ -54,12 +55,6 @@ bool intel_huc_is_authenticated(struct intel_huc *huc); ...@@ -54,12 +55,6 @@ bool intel_huc_is_authenticated(struct intel_huc *huc);
void intel_huc_register_gsc_notifier(struct intel_huc *huc, struct bus_type *bus); void intel_huc_register_gsc_notifier(struct intel_huc *huc, struct bus_type *bus);
void intel_huc_unregister_gsc_notifier(struct intel_huc *huc, struct bus_type *bus); void intel_huc_unregister_gsc_notifier(struct intel_huc *huc, struct bus_type *bus);
static inline int intel_huc_sanitize(struct intel_huc *huc)
{
intel_uc_fw_sanitize(&huc->fw);
return 0;
}
static inline bool intel_huc_is_supported(struct intel_huc *huc) static inline bool intel_huc_is_supported(struct intel_huc *huc)
{ {
return intel_uc_fw_is_supported(&huc->fw); return intel_uc_fw_is_supported(&huc->fw);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment