Commit 0d2ca8fd authored by Michal Wajdeczko's avatar Michal Wajdeczko

drm/xe/uc: Fix and start using xe_uc_fw_sanitize()

Helper xe_uc_fw_sanitize() was defined but never used. First fix
it by properly exiting also from the LOAD_FAIL state, then use it
in GuC and HuC sanitize code.
Signed-off-by: default avatarMichal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: default avatarHimal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240613153424.2120-1-michal.wajdeczko@intel.com
parent 97fedf01
...@@ -1094,7 +1094,7 @@ void xe_guc_irq_handler(struct xe_guc *guc, const u16 iir) ...@@ -1094,7 +1094,7 @@ void xe_guc_irq_handler(struct xe_guc *guc, const u16 iir)
void xe_guc_sanitize(struct xe_guc *guc) void xe_guc_sanitize(struct xe_guc *guc)
{ {
xe_uc_fw_change_status(&guc->fw, XE_UC_FIRMWARE_LOADABLE); xe_uc_fw_sanitize(&guc->fw);
xe_guc_ct_disable(&guc->ct); xe_guc_ct_disable(&guc->ct);
guc->submission_state.enabled = false; guc->submission_state.enabled = false;
} }
......
...@@ -295,9 +295,7 @@ int xe_huc_auth(struct xe_huc *huc, enum xe_huc_auth_types type) ...@@ -295,9 +295,7 @@ int xe_huc_auth(struct xe_huc *huc, enum xe_huc_auth_types type)
void xe_huc_sanitize(struct xe_huc *huc) void xe_huc_sanitize(struct xe_huc *huc)
{ {
if (!xe_uc_fw_is_loadable(&huc->fw)) xe_uc_fw_sanitize(&huc->fw);
return;
xe_uc_fw_change_status(&huc->fw, XE_UC_FIRMWARE_LOADABLE);
} }
void xe_huc_print_info(struct xe_huc *huc, struct drm_printer *p) void xe_huc_print_info(struct xe_huc *huc, struct drm_printer *p)
......
...@@ -158,7 +158,7 @@ static inline bool xe_uc_fw_is_overridden(const struct xe_uc_fw *uc_fw) ...@@ -158,7 +158,7 @@ static inline bool xe_uc_fw_is_overridden(const struct xe_uc_fw *uc_fw)
static inline void xe_uc_fw_sanitize(struct xe_uc_fw *uc_fw) static inline void xe_uc_fw_sanitize(struct xe_uc_fw *uc_fw)
{ {
if (xe_uc_fw_is_loaded(uc_fw)) if (xe_uc_fw_is_loadable(uc_fw))
xe_uc_fw_change_status(uc_fw, XE_UC_FIRMWARE_LOADABLE); xe_uc_fw_change_status(uc_fw, XE_UC_FIRMWARE_LOADABLE);
} }
......
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