Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/xe/query: Use scope-based forcewake

Use scope-based forcewake handling for consistency with other parts of
the driver.

Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com>
Link: https://patch.msgid.link/20251118164338.3572146-47-matthew.d.roper@intel.com
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>

+6 -10
+6 -10
drivers/gpu/drm/xe/xe_query.c
··· 122 122 __ktime_func_t cpu_clock; 123 123 struct xe_hw_engine *hwe; 124 124 struct xe_gt *gt; 125 - unsigned int fw_ref; 126 125 127 126 if (IS_SRIOV_VF(xe)) 128 127 return -EOPNOTSUPP; ··· 157 158 if (!hwe) 158 159 return -EINVAL; 159 160 160 - fw_ref = xe_force_wake_get(gt_to_fw(gt), XE_FORCEWAKE_ALL); 161 - if (!xe_force_wake_ref_has_domain(fw_ref, XE_FORCEWAKE_ALL)) { 162 - xe_force_wake_put(gt_to_fw(gt), fw_ref); 163 - return -EIO; 161 + xe_with_force_wake(fw_ref, gt_to_fw(gt), XE_FORCEWAKE_ALL) { 162 + if (!xe_force_wake_ref_has_domain(fw_ref.domains, XE_FORCEWAKE_ALL)) 163 + return -EIO; 164 + 165 + hwe_read_timestamp(hwe, &resp.engine_cycles, &resp.cpu_timestamp, 166 + &resp.cpu_delta, cpu_clock); 164 167 } 165 - 166 - hwe_read_timestamp(hwe, &resp.engine_cycles, &resp.cpu_timestamp, 167 - &resp.cpu_delta, cpu_clock); 168 - 169 - xe_force_wake_put(gt_to_fw(gt), fw_ref); 170 168 171 169 if (GRAPHICS_VER(xe) >= 20) 172 170 resp.width = 64;