]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/xe/uc: Use GT-oriented firmware messages
authorMichal Wajdeczko <michal.wajdeczko@intel.com>
Fri, 6 Jun 2025 20:43:11 +0000 (22:43 +0200)
committerMichal Wajdeczko <michal.wajdeczko@intel.com>
Mon, 9 Jun 2025 14:01:52 +0000 (16:01 +0200)
We are already prepared to define firmwares per-GT type, so we
should also prepare our messages to be GT-oriented.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: John Harrison <John.C.Harrison@Intel.com>
Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://lore.kernel.org/r/20250606204311.813-1-michal.wajdeczko@intel.com
drivers/gpu/drm/xe/xe_uc_fw.c

index e572563b8c75e3314a2b37fe21fe29b5e0e2159a..6d08695186521be0155881348e975f4df4feba3a 100644 (file)
@@ -693,8 +693,9 @@ static void uc_fw_vf_override(struct xe_uc_fw *uc_fw)
 static int uc_fw_request(struct xe_uc_fw *uc_fw, const struct firmware **firmware_p)
 {
        struct xe_device *xe = uc_fw_to_xe(uc_fw);
+       struct xe_gt *gt = uc_fw_to_gt(uc_fw);
+       struct drm_printer p = xe_gt_info_printer(gt);
        struct device *dev = xe->drm.dev;
-       struct drm_printer p = drm_info_printer(dev);
        const struct firmware *fw = NULL;
        int err;
 
@@ -703,8 +704,8 @@ static int uc_fw_request(struct xe_uc_fw *uc_fw, const struct firmware **firmwar
         * before we're looked at the HW caps to see if we have uc support
         */
        BUILD_BUG_ON(XE_UC_FIRMWARE_UNINITIALIZED);
-       xe_assert(xe, !uc_fw->status);
-       xe_assert(xe, !uc_fw->path);
+       xe_gt_assert(gt, !uc_fw->status);
+       xe_gt_assert(gt, !uc_fw->path);
 
        uc_fw_auto_select(xe, uc_fw);
 
@@ -721,7 +722,7 @@ static int uc_fw_request(struct xe_uc_fw *uc_fw, const struct firmware **firmwar
 
        if (!xe_uc_fw_is_supported(uc_fw)) {
                if (uc_fw->type == XE_UC_FW_TYPE_GUC) {
-                       drm_err(&xe->drm, "No GuC firmware defined for platform\n");
+                       xe_gt_err(gt, "No GuC firmware defined for platform\n");
                        return -ENOENT;
                }
                return 0;
@@ -730,7 +731,7 @@ static int uc_fw_request(struct xe_uc_fw *uc_fw, const struct firmware **firmwar
        /* an empty path means the firmware is disabled */
        if (!xe_device_uc_enabled(xe) || !(*uc_fw->path)) {
                xe_uc_fw_change_status(uc_fw, XE_UC_FIRMWARE_DISABLED);
-               drm_dbg(&xe->drm, "%s disabled", xe_uc_fw_type_repr(uc_fw->type));
+               xe_gt_dbg(gt, "%s disabled\n", xe_uc_fw_type_repr(uc_fw->type));
                return 0;
        }
 
@@ -763,10 +764,10 @@ fail:
                               XE_UC_FIRMWARE_MISSING :
                               XE_UC_FIRMWARE_ERROR);
 
-       drm_notice(&xe->drm, "%s firmware %s: fetch failed with error %d\n",
-                  xe_uc_fw_type_repr(uc_fw->type), uc_fw->path, err);
-       drm_info(&xe->drm, "%s firmware(s) can be downloaded from %s\n",
-                xe_uc_fw_type_repr(uc_fw->type), XE_UC_FIRMWARE_URL);
+       xe_gt_notice(gt, "%s firmware %s: fetch failed with error %pe\n",
+                    xe_uc_fw_type_repr(uc_fw->type), uc_fw->path, ERR_PTR(err));
+       xe_gt_info(gt, "%s firmware(s) can be downloaded from %s\n",
+                  xe_uc_fw_type_repr(uc_fw->type), XE_UC_FIRMWARE_URL);
 
        release_firmware(fw);           /* OK even if fw is NULL */