diff options
author | Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> | 2023-09-14 02:28:36 +0300 |
---|---|---|
committer | Rodrigo Vivi <rodrigo.vivi@intel.com> | 2023-12-21 19:41:14 +0300 |
commit | 757308471dbe9aba28cdaf40848936923216a1f2 (patch) | |
tree | 34d00224a60bd9fc76cee6df618dc0d9d502079c /drivers/gpu/drm/xe/xe_uc_fw.c | |
parent | c4991ee01d480c45c789b43eb001a978bf016f58 (diff) | |
download | linux-757308471dbe9aba28cdaf40848936923216a1f2.tar.xz |
drm/xe/uc: Fix uC status tracking
The current uC status tracking has a few issues:
1) the HuC is moved to "disabled" instead of "not supported"
2) the status is left uninitialized instead of "disabled" when the
modparam is used to disable support
3) due to #1, a number of checks are done against "disabled" instead of
the appropriate status.
Address all of those by making sure to follow the appropriate state
transition and checking against the required state.
v2: rebase on s/guc_submission_enabled/uc_enabled/
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: John Harrison <John.C.Harrison@Intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: John Harrison <John.C.Harrison@Intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'drivers/gpu/drm/xe/xe_uc_fw.c')
-rw-r--r-- | drivers/gpu/drm/xe/xe_uc_fw.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/gpu/drm/xe/xe_uc_fw.c b/drivers/gpu/drm/xe/xe_uc_fw.c index efc70836453d..a890ece72f34 100644 --- a/drivers/gpu/drm/xe/xe_uc_fw.c +++ b/drivers/gpu/drm/xe/xe_uc_fw.c @@ -340,17 +340,19 @@ int xe_uc_fw_init(struct xe_uc_fw *uc_fw) xe_assert(xe, !uc_fw->path); uc_fw_auto_select(xe, uc_fw); - xe_uc_fw_change_status(uc_fw, uc_fw->path ? *uc_fw->path ? + xe_uc_fw_change_status(uc_fw, uc_fw->path ? XE_UC_FIRMWARE_SELECTED : - XE_UC_FIRMWARE_DISABLED : XE_UC_FIRMWARE_NOT_SUPPORTED); - /* Transform no huc in the list into firmware disabled */ - if (uc_fw->type == XE_UC_FW_TYPE_HUC && !xe_uc_fw_is_supported(uc_fw)) { + if (!xe_uc_fw_is_supported(uc_fw)) + return 0; + + if (!xe_device_uc_enabled(xe)) { xe_uc_fw_change_status(uc_fw, XE_UC_FIRMWARE_DISABLED); - err = -ENOPKG; - return err; + drm_dbg(&xe->drm, "%s disabled", xe_uc_fw_type_repr(uc_fw->type)); + return 0; } + err = request_firmware(&fw, uc_fw->path, dev); if (err) goto fail; |