[PATCH v2 2/2] drm/xe: Use new force-wake guard class in xe_mocs.c
Michal Wajdeczko
michal.wajdeczko at intel.com
Mon Nov 18 18:45:11 UTC 2024
Start using new xe_fw class to minimize risk of leaking force-wake
references.
Signed-off-by: Michal Wajdeczko <michal.wajdeczko at intel.com>
---
v2: rebased
---
drivers/gpu/drm/xe/xe_mocs.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_mocs.c b/drivers/gpu/drm/xe/xe_mocs.c
index 54d199b5cfb2..f18aaa6595c7 100644
--- a/drivers/gpu/drm/xe/xe_mocs.c
+++ b/drivers/gpu/drm/xe/xe_mocs.c
@@ -776,19 +776,15 @@ void xe_mocs_dump(struct xe_gt *gt, struct drm_printer *p)
{
struct xe_device *xe = gt_to_xe(gt);
struct xe_mocs_info table;
- unsigned int fw_ref, flags;
+ unsigned int flags;
flags = get_mocs_settings(xe, &table);
xe_pm_runtime_get_noresume(xe);
- fw_ref = xe_force_wake_get(gt_to_fw(gt), XE_FW_GT);
- if (!fw_ref)
- goto err_fw;
- table.ops->dump(&table, flags, gt, p);
+ scoped_guard(xe_fw, gt_to_fw(gt), XE_FW_GT)
+ table.ops->dump(&table, flags, gt, p);
- xe_force_wake_put(gt_to_fw(gt), fw_ref);
-err_fw:
xe_pm_runtime_put(xe);
}
--
2.43.0
More information about the Intel-xe
mailing list