[PATCH v2 2/2] drm/xe: Use GT oriented log messages in xe_gt.c
Michal Wajdeczko
michal.wajdeczko at intel.com
Mon Mar 13 22:12:34 UTC 2023
Replace generic log messages with ones dedicated for the GT.
Signed-off-by: Michal Wajdeczko <michal.wajdeczko at intel.com>
---
drivers/gpu/drm/xe/xe_gt.c | 29 ++++++++++++-----------------
1 file changed, 12 insertions(+), 17 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_gt.c b/drivers/gpu/drm/xe/xe_gt.c
index daa433d0f2f5..a46399c24eb8 100644
--- a/drivers/gpu/drm/xe/xe_gt.c
+++ b/drivers/gpu/drm/xe/xe_gt.c
@@ -20,6 +20,7 @@
#include "xe_gt_clock.h"
#include "xe_gt_mcr.h"
#include "xe_gt_pagefault.h"
+#include "xe_gt_printk.h"
#include "xe_gt_sysfs.h"
#include "xe_gt_tlb_invalidation.h"
#include "xe_gt_topology.h"
@@ -612,15 +613,14 @@ int xe_gt_init(struct xe_gt *gt)
static int do_gt_reset(struct xe_gt *gt)
{
- struct xe_device *xe = gt_to_xe(gt);
int err;
xe_mmio_write32(gt, GEN6_GDRST.reg, GEN11_GRDOM_FULL);
err = xe_mmio_wait32(gt, GEN6_GDRST.reg, 0, GEN11_GRDOM_FULL, 5000,
NULL, false);
if (err)
- drm_err(&xe->drm,
- "GT reset failed to clear GEN11_GRDOM_FULL\n");
+ xe_gt_err(gt, "failed to clear GEN11_GRDOM_FULL (%pe)\n",
+ ERR_PTR(err));
return err;
}
@@ -663,14 +663,13 @@ static int do_gt_restart(struct xe_gt *gt)
static int gt_reset(struct xe_gt *gt)
{
- struct xe_device *xe = gt_to_xe(gt);
int err;
/* We only support GT resets with GuC submission */
if (!xe_device_guc_submission_enabled(gt_to_xe(gt)))
return -ENODEV;
- drm_info(&xe->drm, "GT reset started\n");
+ xe_gt_info(gt, "reset started\n");
xe_gt_sanitize(gt);
@@ -699,7 +698,7 @@ static int gt_reset(struct xe_gt *gt)
err = xe_force_wake_put(gt_to_fw(gt), XE_FORCEWAKE_ALL);
XE_WARN_ON(err);
- drm_info(&xe->drm, "GT reset done\n");
+ xe_gt_info(gt, "reset done\n");
return 0;
@@ -708,7 +707,7 @@ static int gt_reset(struct xe_gt *gt)
err_msg:
XE_WARN_ON(xe_uc_start(>->uc));
xe_device_mem_access_put(gt_to_xe(gt));
- drm_err(&xe->drm, "GT reset failed, err=%d\n", err);
+ xe_gt_err(gt, "reset failed (%pe)\n", ERR_PTR(err));
return err;
}
@@ -722,15 +721,13 @@ static void gt_reset_worker(struct work_struct *w)
void xe_gt_reset_async(struct xe_gt *gt)
{
- struct xe_device *xe = gt_to_xe(gt);
-
- drm_info(&xe->drm, "Try GT reset\n");
+ xe_gt_info(gt, "trying reset\n");
/* Don't do a reset while one is already in flight */
if (xe_uc_reset_prepare(>->uc))
return;
- drm_info(&xe->drm, "Doing GT reset\n");
+ xe_gt_info(gt, "reset queued\n");
queue_work(gt->ordered_wq, >->reset.worker);
}
@@ -747,7 +744,6 @@ void xe_gt_suspend_prepare(struct xe_gt *gt)
int xe_gt_suspend(struct xe_gt *gt)
{
- struct xe_device *xe = gt_to_xe(gt);
int err;
/* For now suspend/resume is only allowed with GuC */
@@ -767,7 +763,7 @@ int xe_gt_suspend(struct xe_gt *gt)
xe_device_mem_access_put(gt_to_xe(gt));
XE_WARN_ON(xe_force_wake_put(gt_to_fw(gt), XE_FORCEWAKE_ALL));
- drm_info(&xe->drm, "GT suspended\n");
+ xe_gt_info(gt, "suspended\n");
return 0;
@@ -775,14 +771,13 @@ int xe_gt_suspend(struct xe_gt *gt)
XE_WARN_ON(xe_force_wake_put(gt_to_fw(gt), XE_FORCEWAKE_ALL));
err_msg:
xe_device_mem_access_put(gt_to_xe(gt));
- drm_err(&xe->drm, "GT suspend failed: %d\n", err);
+ xe_gt_err(gt, "suspend failed (%pe)\n", ERR_PTR(err));
return err;
}
int xe_gt_resume(struct xe_gt *gt)
{
- struct xe_device *xe = gt_to_xe(gt);
int err;
xe_device_mem_access_get(gt_to_xe(gt));
@@ -796,7 +791,7 @@ int xe_gt_resume(struct xe_gt *gt)
xe_device_mem_access_put(gt_to_xe(gt));
XE_WARN_ON(xe_force_wake_put(gt_to_fw(gt), XE_FORCEWAKE_ALL));
- drm_info(&xe->drm, "GT resumed\n");
+ xe_gt_info(gt, "resumed\n");
return 0;
@@ -804,7 +799,7 @@ int xe_gt_resume(struct xe_gt *gt)
XE_WARN_ON(xe_force_wake_put(gt_to_fw(gt), XE_FORCEWAKE_ALL));
err_msg:
xe_device_mem_access_put(gt_to_xe(gt));
- drm_err(&xe->drm, "GT resume failed: %d\n", err);
+ xe_gt_err(gt, "resume failed (%pe)\n", ERR_PTR(err));
return err;
}
--
2.25.1
More information about the dri-devel
mailing list