Skip to content

Commit 301efe9

Browse files
mwajdeczickle
authored andcommitted
drm/i915/uc: Don't fail on HuC firmware failure
HuC is usually not a critical component, so we can safely ignore firmware load or authentication failures unless HuC was explicitly requested by the user. v2: add convenient way to disable loading (Chris) Signed-off-by: Michal Wajdeczko <[email protected]> Cc: Daniele Ceraolo Spurio <[email protected]> Cc: Chris Wilson <[email protected]> Cc: Joonas Lahtinen <[email protected]> Reviewed-by: Chris Wilson <[email protected]> #v1 Signed-off-by: Chris Wilson <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent ed32f8d commit 301efe9

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

drivers/gpu/drm/i915/gt/uc/intel_uc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ int intel_uc_init_hw(struct intel_uc *uc)
422422

423423
if (intel_uc_is_using_huc(uc)) {
424424
ret = intel_huc_fw_upload(huc);
425-
if (ret)
425+
if (ret && intel_uc_fw_is_overridden(&huc->fw))
426426
goto err_out;
427427
}
428428

@@ -444,9 +444,9 @@ int intel_uc_init_hw(struct intel_uc *uc)
444444
if (ret)
445445
goto err_log_capture;
446446

447-
if (intel_uc_is_using_huc(uc)) {
447+
if (intel_uc_fw_is_loaded(&huc->fw)) {
448448
ret = intel_huc_auth(huc);
449-
if (ret)
449+
if (ret && intel_uc_fw_is_overridden(&huc->fw))
450450
goto err_communication;
451451
}
452452

@@ -465,7 +465,7 @@ int intel_uc_init_hw(struct intel_uc *uc)
465465
dev_info(i915->drm.dev, "GuC submission %s\n",
466466
enableddisabled(intel_uc_is_using_guc_submission(uc)));
467467
dev_info(i915->drm.dev, "HuC %s\n",
468-
enableddisabled(intel_uc_is_using_huc(uc)));
468+
enableddisabled(intel_huc_is_authenticated(huc)));
469469

470470
return 0;
471471

drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ __uc_fw_override(struct intel_uc_fw *uc_fw)
146146
break;
147147
}
148148

149-
return uc_fw->path;
149+
uc_fw->user_overridden = uc_fw->path;
150+
return uc_fw->user_overridden;
150151
}
151152

152153
/**
@@ -176,7 +177,7 @@ void intel_uc_fw_init_early(struct intel_uc_fw *uc_fw,
176177
__uc_fw_auto_select(uc_fw, INTEL_INFO(i915)->platform,
177178
INTEL_REVID(i915));
178179

179-
if (uc_fw->path)
180+
if (uc_fw->path && *uc_fw->path)
180181
uc_fw->status = INTEL_UC_FIRMWARE_SELECTED;
181182
else
182183
uc_fw->status = INTEL_UC_FIRMWARE_NOT_SUPPORTED;

drivers/gpu/drm/i915/gt/uc/intel_uc_fw.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ struct intel_uc_fw {
6161
enum intel_uc_fw_type type;
6262
enum intel_uc_fw_status status;
6363
const char *path;
64+
bool user_overridden;
6465
size_t size;
6566
struct drm_i915_gem_object *obj;
6667

@@ -141,6 +142,11 @@ static inline bool intel_uc_fw_supported(struct intel_uc_fw *uc_fw)
141142
return __intel_uc_fw_status(uc_fw) != INTEL_UC_FIRMWARE_NOT_SUPPORTED;
142143
}
143144

145+
static inline bool intel_uc_fw_is_overridden(const struct intel_uc_fw *uc_fw)
146+
{
147+
return uc_fw->user_overridden;
148+
}
149+
144150
static inline void intel_uc_fw_sanitize(struct intel_uc_fw *uc_fw)
145151
{
146152
if (intel_uc_fw_is_loaded(uc_fw))

0 commit comments

Comments
 (0)