Skip to content

Commit b79ec33

Browse files
hghimirarodrigovivi
authored andcommitted
drm/xe/huc: Update handling of xe_force_wake_get return
xe_force_wake_get() now returns the reference count-incremented domain mask. If it fails for individual domains, the return value will always be 0. However, for XE_FORCEWAKE_ALL, it may return a non-zero value even in the event of failure. Update the return handling of xe_force_wake_get() to reflect this behavior, and ensure that the return value is passed as input to xe_force_wake_put(). v3 - return xe_wakeref_t instead of int in xe_force_wake_get() v5 - return unsigned int from xe_force_wake_get() v7 - Fix commit message Cc: Daniele Ceraolo Spurio <[email protected]> Cc: Rodrigo Vivi <[email protected]> Cc: Lucas De Marchi <[email protected]> Signed-off-by: Himal Prasad Ghimiray <[email protected]> Reviewed-by: Nirmoy Das <[email protected]> Reviewed-by: Badal Nilawar <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Rodrigo Vivi <[email protected]>
1 parent 31a5dce commit b79ec33

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/gpu/drm/xe/xe_huc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -296,19 +296,19 @@ void xe_huc_sanitize(struct xe_huc *huc)
296296
void xe_huc_print_info(struct xe_huc *huc, struct drm_printer *p)
297297
{
298298
struct xe_gt *gt = huc_to_gt(huc);
299-
int err;
299+
unsigned int fw_ref;
300300

301301
xe_uc_fw_print(&huc->fw, p);
302302

303303
if (!xe_uc_fw_is_enabled(&huc->fw))
304304
return;
305305

306-
err = xe_force_wake_get(gt_to_fw(gt), XE_FW_GT);
307-
if (err)
306+
fw_ref = xe_force_wake_get(gt_to_fw(gt), XE_FW_GT);
307+
if (!fw_ref)
308308
return;
309309

310310
drm_printf(p, "\nHuC status: 0x%08x\n",
311311
xe_mmio_read32(&gt->mmio, HUC_KERNEL_LOAD_INFO));
312312

313-
xe_force_wake_put(gt_to_fw(gt), XE_FW_GT);
313+
xe_force_wake_put(gt_to_fw(gt), fw_ref);
314314
}

0 commit comments

Comments
 (0)