[PATCH 02/10] drm/xe: Add new helpers to log hardware errrors.
Michal Wajdeczko
michal.wajdeczko at intel.com
Wed Jul 30 08:55:11 UTC 2025
On 7/30/2025 7:48 AM, Aravind Iddamsetty wrote:
> From: Himal Prasad Ghimiray <himal.prasad.ghimiray at intel.com>
>
> Introducing xe_gt_log_hw_err and xe_gt_log_hw_err helper to
> report gt specific hardware errors.
>
> v2
> - use _gt and _fmt instead of gt and fmt.
> - Messages should be same.
>
> Cc: Aravind Iddamsetty <aravind.iddamsetty at linux.intel.com>
> Reviewed-by: Aravind Iddamsetty <aravind.iddamsetty at linux.intel.com>
> Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray at intel.com>
> ---
> drivers/gpu/drm/xe/xe_gt_printk.h | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/gpu/drm/xe/xe_gt_printk.h b/drivers/gpu/drm/xe/xe_gt_printk.h
> index 11da0228cea7..2f9baf7d191b 100644
> --- a/drivers/gpu/drm/xe/xe_gt_printk.h
> +++ b/drivers/gpu/drm/xe/xe_gt_printk.h
> @@ -46,6 +46,13 @@
> #define xe_gt_WARN_ON_ONCE(_gt, _condition) \
> xe_gt_WARN_ONCE((_gt), _condition, "%s(%s)", "gt_WARN_ON_ONCE", __stringify(_condition))
>
> +#define xe_gt_log_hw_err(_gt, _fmt, ...) \
> + drm_err_ratelimited(>_to_xe(_gt)->drm, HW_ERR "GT%d reported " _fmt, \
> + (_gt)->info.id, ##__VA_ARGS__)
> +
> +#define xe_gt_log_hw_warn(_gt, _fmt, ...) \
> + drm_warn(>_to_xe(_gt)->drm, HW_ERR "GT%d reported " _fmt, (_gt)->info.id, ##__VA_ARGS__)
> +
hmm, I'm not sure this is right place for such specific helpers
please consider moving them to xe_gt_hw_err.h or at least redef as:
#include "xe_gt_printk.h"
#define xe_gt_hw_err(_gt, _fmt, ...) \
xe_gt_err_ratelimited((_gt), HW_ERR _fmt, ##__VA_ARGS__)
#define xe_gt_hw_warn(_gt, _fmt, ...) \
xe_gt_warn((_gt), HW_ERR _fmt, ##__VA_ARGS__)
as likely the output as below is also acceptable:
[] xe 0000:8c:00.0: [drm] *ERROR* GT1: [Hardware Error]: blah blah
vs yours
[] xe 0000:8c:00.0: [drm] *ERROR* [Hardware Error]: GT1 reported blah blah
> static inline void __xe_gt_printfn_err(struct drm_printer *p, struct va_format *vaf)
> {
> struct xe_gt *gt = p->arg;
More information about the Intel-xe
mailing list