drm/xe/huc: Don't re-auth HuC if it's already authenticated
authorDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Wed, 25 Oct 2023 17:57:44 +0000 (10:57 -0700)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Thu, 21 Dec 2023 16:43:23 +0000 (11:43 -0500)
On newer platforms the HuC survives reset and stays authenticated, so no
need to re-authenticate it.

Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Alan Previn <alan.previn.teres.alexis@intel.com>
Cc: John Harrison <John.C.Harrison@Intel.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/xe_huc.c

index 386efa180c1c305fa8b5e9a103382890e84fbd07..2f176badab261230aa779f175b6d18bf66b3d610 100644 (file)
@@ -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;