From: Daniele Ceraolo Spurio Date: Wed, 25 Oct 2023 17:57:44 +0000 (-0700) Subject: drm/xe/huc: Don't re-auth HuC if it's already authenticated X-Git-Tag: v6.8-rc1~111^2~7^2~247 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=185f93f3041fe520c6df16a58bea116077d3f848;p=thirdparty%2Fkernel%2Flinux.git drm/xe/huc: Don't re-auth HuC if it's already authenticated On newer platforms the HuC survives reset and stays authenticated, so no need to re-authenticate it. Signed-off-by: Daniele Ceraolo Spurio Cc: Alan Previn Cc: John Harrison Reviewed-by: Lucas De Marchi Signed-off-by: Rodrigo Vivi --- diff --git a/drivers/gpu/drm/xe/xe_huc.c b/drivers/gpu/drm/xe/xe_huc.c index 386efa180c1c3..2f176badab261 100644 --- a/drivers/gpu/drm/xe/xe_huc.c +++ b/drivers/gpu/drm/xe/xe_huc.c @@ -83,6 +83,12 @@ int xe_huc_auth(struct xe_huc *huc) xe_assert(xe, !xe_uc_fw_is_running(&huc->fw)); + /* On newer platforms the HuC survives reset, so no need to re-auth */ + if (xe_mmio_read32(gt, HUC_KERNEL_LOAD_INFO) & HUC_LOAD_SUCCESSFUL) { + xe_uc_fw_change_status(&huc->fw, XE_UC_FIRMWARE_RUNNING); + return 0; + } + if (!xe_uc_fw_is_loaded(&huc->fw)) return -ENOEXEC;