Skip to contentSkip to conversation

Adding throttle reasons sysfs attributes

PATCH In review Sujaritha Sundaresan 5 participants 9 messages May 30, 2023 – Jul 14, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Adding throttle reasons sysfs attributes

Exposing various throttle reasons attributes as part of sysfs. These attributes can point to various reasons for performance limitations, include power limits, temperature etc.

Sujaritha Sundaresan (1):
[RFC]drm/xe: Adding throttle reasons sysfs attributes

 drivers/gpu/drm/xe/regs/xe_gt_regs.h | 12 +++++
 drivers/gpu/drm/xe/xe_guc_pc.c       | 67 ++++++++++++++++++++++++++++
 2 files changed, 79 insertions(+)
Signature · 1 line
2.25.1
#1 lore raw

RFC PATCH 1/1 drm/xe: Adding throttle reasons sysfs attributes

Adding throttle reasons sysfs attributes.

---
 drivers/gpu/drm/xe/regs/xe_gt_regs.h | 12 +++++
 drivers/gpu/drm/xe/xe_guc_pc.c       | 67 ++++++++++++++++++++++++++++
 2 files changed, 79 insertions(+)
drivers/gpu/drm/xe/regs/xe_gt_regs.h +12 -0
index e64e5c0733d6..e7fe8a3e348e 100644
@@ -374,4 +374,16 @@
 #define XEHPC_BCS5_BCS6_INTR_MASK		XE_REG(0x190118)
 #define XEHPC_BCS7_BCS8_INTR_MASK		XE_REG(0x19011c)
 
+#define GT0_PERF_LIMIT_REASONS			XE_REG(0x1381a8)
+#define   GT0_PERF_LIMIT_REASONS_MASK		0xde3
+#define   PROCHOT_MASK				REG_BIT(0)
+#define   THERMAL_LIMIT_MASK			REG_BIT(1)
+#define   RATL_MASK				REG_BIT(5)
+#define   VR_THERMALERT_MASK			REG_BIT(6)
+#define   VR_TDC_MASK				REG_BIT(7)
+#define   POWER_LIMIT_4_MASK			REG_BIT(8)
+#define   POWER_LIMIT_1_MASK			REG_BIT(10)
+#define   POWER_LIMIT_2_MASK			REG_BIT(11)
+#define MTL_MEDIA_PERF_LIMIT_REASONS		XE_REG(0x138030)
+
 #endif
drivers/gpu/drm/xe/xe_guc_pc.c +67 -0

73 lines not on this page · raw message

Signature · 1 line
2.25.1
#2 lore raw

Re: [Intel-xe] [PATCH 1/1] [RFC]drm/xe: Adding throttle reasons sysfs attributes

Hi,

Some style comments:

Quoted 1 line · Sujaritha Sundaresan

Adding throttle reasons sysfs attributes.

Please use imperative language as per the linux patch submission guidelines: "Add throttle..."

Also please add a message explaining why / for what these sysfs attributes are needed.

Quoted 17 lines
---
  drivers/gpu/drm/xe/regs/xe_gt_regs.h | 12 +++++
  drivers/gpu/drm/xe/xe_guc_pc.c       | 67 ++++++++++++++++++++++++++++
  2 files changed, 79 insertions(+)
drivers/gpu/drm/xe/regs/xe_gt_regs.h +2 -0
index e64e5c0733d6..e7fe8a3e348e 100644
@@ -374,4 +374,16 @@
  #define XEHPC_BCS5_BCS6_INTR_MASK		XE_REG(0x190118)
  #define XEHPC_BCS7_BCS8_INTR_MASK		XE_REG(0x19011c)
 
+#define GT0_PERF_LIMIT_REASONS			XE_REG(0x1381a8)
+#define   GT0_PERF_LIMIT_REASONS_MASK		0xde3

drivers/gpu/drm/xe/regs/xe_gt_regs.h line 388

Quoted 10 lines
drivers/gpu/drm/xe/regs/xe_gt_regs.h +10 -0
+#define   PROCHOT_MASK				REG_BIT(0)
+#define   THERMAL_LIMIT_MASK			REG_BIT(1)
+#define   RATL_MASK				REG_BIT(5)
+#define   VR_THERMALERT_MASK			REG_BIT(6)
+#define   VR_TDC_MASK				REG_BIT(7)
+#define   POWER_LIMIT_4_MASK			REG_BIT(8)
+#define   POWER_LIMIT_1_MASK			REG_BIT(10)
+#define   POWER_LIMIT_2_MASK			REG_BIT(11)
+#define MTL_MEDIA_PERF_LIMIT_REASONS		XE_REG(0x138030)
+

Documentation, please.

Quoted 8 lines
drivers/gpu/drm/xe/regs/xe_gt_regs.h +0 -0
  #endif
drivers/gpu/drm/xe/xe_guc_pc.c +0 -0
index e799faa1c6b8..363332881e4d 100644
@@ -638,6 +638,73 @@ static const struct attribute *pc_attrs[] = {
  	NULL
  };

drivers/gpu/drm/xe/xe_guc_pc.c static const struct attribute *pc_attrs[] = { · line 649

Quoted 10 lines
drivers/gpu/drm/xe/xe_guc_pc.c +9 -0
 
+static inline
+xe_reg_t xe_gt_perf_limit_reasons_reg(struct xe_gt *gt)
+{
+        if (xe_gt_is_media_type(gt))
+                return MTL_MEDIA_PERF_LIMIT_REASONS;
+
+        return GT0_PERF_LIMIT_REASONS;
+}
+

Only use "static inline" in headers. Otherwise let the compiler decide what to inline.

drivers/gpu/drm/xe/xe_guc_pc.c static const struct attribute *pc_attrs[] = { · line 657

Quoted 8 lines
drivers/gpu/drm/xe/xe_guc_pc.c +8 -0
+struct xe_gt_bool_throttle_attr {
+	struct attribute attr;
+	ssize_t (*show)(struct device *dev, struct device_attribute *attr,
+			char *buf);
+	xe_reg_t (*reg32)(struct xe_gt *gt);
+	u32 mask;
+};
+

Struct needs kerneldoc.

drivers/gpu/drm/xe/xe_guc_pc.c static const struct attribute *pc_attrs[] = { · line 663

Quoted 6 lines
drivers/gpu/drm/xe/xe_guc_pc.c +6 -0
+bool xe_mmio_mask_read(struct xe_gt *gt,
+			xe_reg_t reg32, u32 mask)
+{
+	return xe_mmio_read32(gt, reg32) & mask;
+}
+

Extern function needs kerneldoc, but does it need to be extern?

Quoted 47 lines
drivers/gpu/drm/xe/xe_guc_pc.c +44 -0
+static ssize_t throttle_reason_bool_show(struct device *dev,
+					 struct device_attribute *attr,
+					 char *buff)
+{
+	struct kobject *kobj = &dev->kobj;
+	struct xe_gt *gt = kobj_to_gt(kobj);
+	struct xe_gt_bool_throttle_attr *t_attr =
+			(struct xe_gt_bool_throttle_attr *) attr;
+	bool val = xe_mmio_mask_read(&gt->rps, t_attr->reg32(gt), t_attr->mask);
+
+	return sysfs_emit(buff, "%u\n", val);
+}
+
+#define XE_GT_BOOL_ATTR_RO(sysfs_func__, mask__) \
+struct xe_gt_bool_throttle_attr attr_##sysfs_func__ = { \
+	.attr = { .name = __stringify(sysfs_func__), .mode = 0444 }, \
+	.show = throttle_reason_bool_show, \
+	.reg32 = xe_gt_perf_limit_reasons_reg, \
+	.mask = mask__, \
+}
+
+static XE_GT_BOOL_ATTR_RO(throttle_reason_status, GT0_PERF_LIMIT_REASONS_MASK);
+static XE_GT_BOOL_ATTR_RO(throttle_reason_pl1, POWER_LIMIT_1_MASK);
+static XE_GT_BOOL_ATTR_RO(throttle_reason_pl2, POWER_LIMIT_2_MASK);
+static XE_GT_BOOL_ATTR_RO(throttle_reason_pl4, POWER_LIMIT_4_MASK);
+static XE_GT_BOOL_ATTR_RO(throttle_reason_thermal, THERMAL_LIMIT_MASK);
+static XE_GT_BOOL_ATTR_RO(throttle_reason_prochot, PROCHOT_MASK);
+static XE_GT_BOOL_ATTR_RO(throttle_reason_ratl, RATL_MASK);
+static XE_GT_BOOL_ATTR_RO(throttle_reason_vr_thermalert, VR_THERMALERT_MASK);
+static XE_GT_BOOL_ATTR_RO(throttle_reason_vr_tdc, VR_TDC_MASK);
+
+static const struct attribute *throttle_reason_attrs[] = {
+	&dev_attr_throttle_reason_status.attr,
+	&dev_attr_throttle_reason_pl1.attr,
+	&dev_attr_throttle_reason_pl2.attr,
+	&dev_attr_throttle_reason_pl4.attr,
+	&dev_attr_throttle_reason_thermal.attr,
+	&dev_attr_throttle_reason_prochot.attr,
+	&dev_attr_throttle_reason_ratl.attr,
+	&dev_attr_throttle_reason_vr_thermalert.attr,
+	&dev_attr_throttle_reason_vr_tdc.attr,
+	NULL
+};
+
  static void mtl_init_fused_rp_values(struct xe_guc_pc *pc)
  {
  	struct xe_gt *gt = pc_to_gt(pc);
#3 lore raw

Re: [Intel-xe] [PATCH 1/1] [RFC]drm/xe: Adding throttle reasons sysfs attributes

In reply to Sujaritha Sundaresan
Quoted 1 line · Sujaritha Sundaresan

Hi Suja,

Quoted 1 line

Adding throttle reasons sysfs attributes.

I am not sure about the location for these sysfs files. And whether or not these are being exposed using hwmon or not in xe. I believe the patch will have to wait for someone like Rodrigo to look at (unless another xe developer knows) but we can fix other things meanwhile.

Also one more comment: didn't we want to expose the upper 16 bits too (the log bits) or only the lower 16 bits (status bits)? Though the log bits can be a separate patch too.

Quoted 33 lines
---
 drivers/gpu/drm/xe/regs/xe_gt_regs.h | 12 +++++
 drivers/gpu/drm/xe/xe_guc_pc.c       | 67 ++++++++++++++++++++++++++++
 2 files changed, 79 insertions(+)
drivers/gpu/drm/xe/regs/xe_gt_regs.h +12 -0
index e64e5c0733d6..e7fe8a3e348e 100644
@@ -374,4 +374,16 @@
 #define XEHPC_BCS5_BCS6_INTR_MASK		XE_REG(0x190118)
 #define XEHPC_BCS7_BCS8_INTR_MASK		XE_REG(0x19011c)
 
+#define GT0_PERF_LIMIT_REASONS			XE_REG(0x1381a8)
+#define   GT0_PERF_LIMIT_REASONS_MASK		0xde3
+#define   PROCHOT_MASK				REG_BIT(0)
+#define   THERMAL_LIMIT_MASK			REG_BIT(1)
+#define   RATL_MASK				REG_BIT(5)
+#define   VR_THERMALERT_MASK			REG_BIT(6)
+#define   VR_TDC_MASK				REG_BIT(7)
+#define   POWER_LIMIT_4_MASK			REG_BIT(8)
+#define   POWER_LIMIT_1_MASK			REG_BIT(10)
+#define   POWER_LIMIT_2_MASK			REG_BIT(11)
+#define MTL_MEDIA_PERF_LIMIT_REASONS		XE_REG(0x138030)
+
 #endif
drivers/gpu/drm/xe/xe_guc_pc.c +0 -0
index e799faa1c6b8..363332881e4d 100644

drivers/gpu/drm/xe/xe_guc_pc.c static const struct attribute *pc_attrs[] = { · line 642

Quoted 5 lines
drivers/gpu/drm/xe/xe_guc_pc.c +2 -0
@@ -638,6 +638,73 @@ static const struct attribute *pc_attrs[] = {
 	NULL
 };
 
+static inline
+xe_reg_t xe_gt_perf_limit_reasons_reg(struct xe_gt *gt)

I don't see xe_reg_t being typedef'd anywhere, only 'struct xe_reg'?

Quoted 54 lines
drivers/gpu/drm/xe/xe_guc_pc.c +54 -0
+{
+        if (xe_gt_is_media_type(gt))
+                return MTL_MEDIA_PERF_LIMIT_REASONS;
+
+        return GT0_PERF_LIMIT_REASONS;
+}
+
+struct xe_gt_bool_throttle_attr {
+	struct attribute attr;
+	ssize_t (*show)(struct device *dev, struct device_attribute *attr,
+			char *buf);
+	xe_reg_t (*reg32)(struct xe_gt *gt);
+	u32 mask;
+};
+
+bool xe_mmio_mask_read(struct xe_gt *gt,
+			xe_reg_t reg32, u32 mask)
+{
+	return xe_mmio_read32(gt, reg32) & mask;
+}
+
+static ssize_t throttle_reason_bool_show(struct device *dev,
+					 struct device_attribute *attr,
+					 char *buff)
+{
+	struct kobject *kobj = &dev->kobj;
+	struct xe_gt *gt = kobj_to_gt(kobj);
+	struct xe_gt_bool_throttle_attr *t_attr =
+			(struct xe_gt_bool_throttle_attr *) attr;
+	bool val = xe_mmio_mask_read(&gt->rps, t_attr->reg32(gt), t_attr->mask);
+
+	return sysfs_emit(buff, "%u\n", val);
+}
+
+#define XE_GT_BOOL_ATTR_RO(sysfs_func__, mask__) \
+struct xe_gt_bool_throttle_attr attr_##sysfs_func__ = { \
+	.attr = { .name = __stringify(sysfs_func__), .mode = 0444 }, \
+	.show = throttle_reason_bool_show, \
+	.reg32 = xe_gt_perf_limit_reasons_reg, \
+	.mask = mask__, \
+}
+
+static XE_GT_BOOL_ATTR_RO(throttle_reason_status, GT0_PERF_LIMIT_REASONS_MASK);
+static XE_GT_BOOL_ATTR_RO(throttle_reason_pl1, POWER_LIMIT_1_MASK);
+static XE_GT_BOOL_ATTR_RO(throttle_reason_pl2, POWER_LIMIT_2_MASK);
+static XE_GT_BOOL_ATTR_RO(throttle_reason_pl4, POWER_LIMIT_4_MASK);
+static XE_GT_BOOL_ATTR_RO(throttle_reason_thermal, THERMAL_LIMIT_MASK);
+static XE_GT_BOOL_ATTR_RO(throttle_reason_prochot, PROCHOT_MASK);
+static XE_GT_BOOL_ATTR_RO(throttle_reason_ratl, RATL_MASK);
+static XE_GT_BOOL_ATTR_RO(throttle_reason_vr_thermalert, VR_THERMALERT_MASK);
+static XE_GT_BOOL_ATTR_RO(throttle_reason_vr_tdc, VR_TDC_MASK);
+
+static const struct attribute *throttle_reason_attrs[] = {
+	&dev_attr_throttle_reason_status.attr,

drivers/gpu/drm/xe/xe_guc_pc.c static const struct attribute *pc_attrs[] = { · line 706

Quoted 10 lines
drivers/gpu/drm/xe/xe_guc_pc.c +10 -0
+	&dev_attr_throttle_reason_pl1.attr,
+	&dev_attr_throttle_reason_pl2.attr,
+	&dev_attr_throttle_reason_pl4.attr,
+	&dev_attr_throttle_reason_thermal.attr,
+	&dev_attr_throttle_reason_prochot.attr,
+	&dev_attr_throttle_reason_ratl.attr,
+	&dev_attr_throttle_reason_vr_thermalert.attr,
+	&dev_attr_throttle_reason_vr_tdc.attr,
+	NULL
+};

Also don't see these attributes actually being created, using sysfs_create_files etc. So has this patch been compiled/tested?

Quoted 7 lines
drivers/gpu/drm/xe/xe_guc_pc.c +1 -1
+
 static void mtl_init_fused_rp_values(struct xe_guc_pc *pc)
 {
 	struct xe_gt *gt = pc_to_gt(pc);
--

2.25.1

Thanks.
--
Ashutosh

#4 lore raw

Re: [Intel-xe] [PATCH 1/1] [RFC]drm/xe: Adding throttle reasons sysfs attributes

Quoted 126 lines · Ashutosh

On Tue, 30 May 2023 03:34:21 -0700, Sujaritha Sundaresan wrote:
Hi Suja,

Quoted 1 line

Adding throttle reasons sysfs attributes.

I am not sure about the location for these sysfs files. And whether or not these are being exposed using hwmon or not in xe. I believe the patch will have to wait for someone like Rodrigo to look at (unless another xe developer knows) but we can fix other things meanwhile.

Also one more comment: didn't we want to expose the upper 16 bits too (the log bits) or only the lower 16 bits (status bits)? Though the log bits can be a separate patch too.

Quoted 32 lines
---
  drivers/gpu/drm/xe/regs/xe_gt_regs.h | 12 +++++
  drivers/gpu/drm/xe/xe_guc_pc.c       | 67 ++++++++++++++++++++++++++++
  2 files changed, 79 insertions(+)
drivers/gpu/drm/xe/regs/xe_gt_regs.h +12 -0
index e64e5c0733d6..e7fe8a3e348e 100644
@@ -374,4 +374,16 @@
  #define XEHPC_BCS5_BCS6_INTR_MASK		XE_REG(0x190118)
  #define XEHPC_BCS7_BCS8_INTR_MASK		XE_REG(0x19011c)
 
+#define GT0_PERF_LIMIT_REASONS			XE_REG(0x1381a8)
+#define   GT0_PERF_LIMIT_REASONS_MASK		0xde3
+#define   PROCHOT_MASK				REG_BIT(0)
+#define   THERMAL_LIMIT_MASK			REG_BIT(1)
+#define   RATL_MASK				REG_BIT(5)
+#define   VR_THERMALERT_MASK			REG_BIT(6)
+#define   VR_TDC_MASK				REG_BIT(7)
+#define   POWER_LIMIT_4_MASK			REG_BIT(8)
+#define   POWER_LIMIT_1_MASK			REG_BIT(10)
+#define   POWER_LIMIT_2_MASK			REG_BIT(11)
+#define MTL_MEDIA_PERF_LIMIT_REASONS		XE_REG(0x138030)
+
  #endif
drivers/gpu/drm/xe/xe_guc_pc.c +0 -0
index e799faa1c6b8..363332881e4d 100644

drivers/gpu/drm/xe/xe_guc_pc.c static const struct attribute *pc_attrs[] = { · line 642

Quoted 5 lines
drivers/gpu/drm/xe/xe_guc_pc.c +2 -0
@@ -638,6 +638,73 @@ static const struct attribute *pc_attrs[] = {
 	NULL
  };
 
+static inline
+xe_reg_t xe_gt_perf_limit_reasons_reg(struct xe_gt *gt)

I don't see xe_reg_t being typedef'd anywhere, only 'struct xe_reg'?

Quoted 54 lines
drivers/gpu/drm/xe/xe_guc_pc.c +54 -0
+{
+        if (xe_gt_is_media_type(gt))
+                return MTL_MEDIA_PERF_LIMIT_REASONS;
+
+        return GT0_PERF_LIMIT_REASONS;
+}
+
+struct xe_gt_bool_throttle_attr {
+	struct attribute attr;
+	ssize_t (*show)(struct device *dev, struct device_attribute *attr,
+			char *buf);
+	xe_reg_t (*reg32)(struct xe_gt *gt);
+	u32 mask;
+};
+
+bool xe_mmio_mask_read(struct xe_gt *gt,
+			xe_reg_t reg32, u32 mask)
+{
+	return xe_mmio_read32(gt, reg32) & mask;
+}
+
+static ssize_t throttle_reason_bool_show(struct device *dev,
+					 struct device_attribute *attr,
+					 char *buff)
+{
+	struct kobject *kobj = &dev->kobj;
+	struct xe_gt *gt = kobj_to_gt(kobj);
+	struct xe_gt_bool_throttle_attr *t_attr =
+			(struct xe_gt_bool_throttle_attr *) attr;
+	bool val = xe_mmio_mask_read(&gt->rps, t_attr->reg32(gt), t_attr->mask);
+
+	return sysfs_emit(buff, "%u\n", val);
+}
+
+#define XE_GT_BOOL_ATTR_RO(sysfs_func__, mask__) \
+struct xe_gt_bool_throttle_attr attr_##sysfs_func__ = { \
+	.attr = { .name = __stringify(sysfs_func__), .mode = 0444 }, \
+	.show = throttle_reason_bool_show, \
+	.reg32 = xe_gt_perf_limit_reasons_reg, \
+	.mask = mask__, \
+}
+
+static XE_GT_BOOL_ATTR_RO(throttle_reason_status, GT0_PERF_LIMIT_REASONS_MASK);
+static XE_GT_BOOL_ATTR_RO(throttle_reason_pl1, POWER_LIMIT_1_MASK);
+static XE_GT_BOOL_ATTR_RO(throttle_reason_pl2, POWER_LIMIT_2_MASK);
+static XE_GT_BOOL_ATTR_RO(throttle_reason_pl4, POWER_LIMIT_4_MASK);
+static XE_GT_BOOL_ATTR_RO(throttle_reason_thermal, THERMAL_LIMIT_MASK);
+static XE_GT_BOOL_ATTR_RO(throttle_reason_prochot, PROCHOT_MASK);
+static XE_GT_BOOL_ATTR_RO(throttle_reason_ratl, RATL_MASK);
+static XE_GT_BOOL_ATTR_RO(throttle_reason_vr_thermalert, VR_THERMALERT_MASK);
+static XE_GT_BOOL_ATTR_RO(throttle_reason_vr_tdc, VR_TDC_MASK);
+
+static const struct attribute *throttle_reason_attrs[] = {
+	&dev_attr_throttle_reason_status.attr,

drivers/gpu/drm/xe/xe_guc_pc.c static const struct attribute *pc_attrs[] = { · line 706

Quoted 10 lines
drivers/gpu/drm/xe/xe_guc_pc.c +10 -0
+	&dev_attr_throttle_reason_pl1.attr,
+	&dev_attr_throttle_reason_pl2.attr,
+	&dev_attr_throttle_reason_pl4.attr,
+	&dev_attr_throttle_reason_thermal.attr,
+	&dev_attr_throttle_reason_prochot.attr,
+	&dev_attr_throttle_reason_ratl.attr,
+	&dev_attr_throttle_reason_vr_thermalert.attr,
+	&dev_attr_throttle_reason_vr_tdc.attr,
+	NULL
+};

Also don't see these attributes actually being created, using sysfs_create_files etc. So has this patch been compiled/tested?

Quoted 7 lines
drivers/gpu/drm/xe/xe_guc_pc.c +1 -1
+
  static void mtl_init_fused_rp_values(struct xe_guc_pc *pc)
  {
 	struct xe_gt *gt = pc_to_gt(pc);
--

2.25.1

Quoted 3 lines

Thanks.
--
Ashutosh

Hi Ashutosh,

This was just a very basic non functional RFC patch meant to clarify the path/location of these sysfs attributes.

It's not a usable patch.

Rodrigo, could you help clarify whether we are intending to expose throttle reasons via hwmon in Xe ?

Regards,

Suja

#5 lore raw

Re: [Intel-xe] [PATCH 1/1] [RFC]drm/xe: Adding throttle reasons sysfs attributes

Quoted 135 lines · Sujaritha
Quoted 126 lines · Ashutosh

On Tue, 30 May 2023 03:34:21 -0700, Sujaritha Sundaresan wrote:
Hi Suja,

Quoted 1 line

Adding throttle reasons sysfs attributes.

I am not sure about the location for these sysfs files. And whether or not these are being exposed using hwmon or not in xe. I believe the patch will have to wait for someone like Rodrigo to look at (unless another xe developer knows) but we can fix other things meanwhile.

Also one more comment: didn't we want to expose the upper 16 bits too (the log bits) or only the lower 16 bits (status bits)? Though the log bits can be a separate patch too.

Quoted 32 lines
---
  drivers/gpu/drm/xe/regs/xe_gt_regs.h | 12 +++++
  drivers/gpu/drm/xe/xe_guc_pc.c       | 67 ++++++++++++++++++++++++++++
  2 files changed, 79 insertions(+)
drivers/gpu/drm/xe/regs/xe_gt_regs.h +12 -0
index e64e5c0733d6..e7fe8a3e348e 100644
@@ -374,4 +374,16 @@
  #define XEHPC_BCS5_BCS6_INTR_MASK		XE_REG(0x190118)
  #define XEHPC_BCS7_BCS8_INTR_MASK		XE_REG(0x19011c)
 
+#define GT0_PERF_LIMIT_REASONS			XE_REG(0x1381a8)
+#define   GT0_PERF_LIMIT_REASONS_MASK		0xde3
+#define   PROCHOT_MASK				REG_BIT(0)
+#define   THERMAL_LIMIT_MASK			REG_BIT(1)
+#define   RATL_MASK				REG_BIT(5)
+#define   VR_THERMALERT_MASK			REG_BIT(6)
+#define   VR_TDC_MASK				REG_BIT(7)
+#define   POWER_LIMIT_4_MASK			REG_BIT(8)
+#define   POWER_LIMIT_1_MASK			REG_BIT(10)
+#define   POWER_LIMIT_2_MASK			REG_BIT(11)
+#define MTL_MEDIA_PERF_LIMIT_REASONS		XE_REG(0x138030)
+
  #endif
drivers/gpu/drm/xe/xe_guc_pc.c +0 -0
index e799faa1c6b8..363332881e4d 100644

drivers/gpu/drm/xe/xe_guc_pc.c static const struct attribute *pc_attrs[] = { · line 642

Quoted 5 lines
drivers/gpu/drm/xe/xe_guc_pc.c +2 -0
@@ -638,6 +638,73 @@ static const struct attribute *pc_attrs[] = {
 	NULL
  };
 
+static inline
+xe_reg_t xe_gt_perf_limit_reasons_reg(struct xe_gt *gt)

I don't see xe_reg_t being typedef'd anywhere, only 'struct xe_reg'?

Quoted 54 lines
drivers/gpu/drm/xe/xe_guc_pc.c +54 -0
+{
+        if (xe_gt_is_media_type(gt))
+                return MTL_MEDIA_PERF_LIMIT_REASONS;
+
+        return GT0_PERF_LIMIT_REASONS;
+}
+
+struct xe_gt_bool_throttle_attr {
+	struct attribute attr;
+	ssize_t (*show)(struct device *dev, struct device_attribute *attr,
+			char *buf);
+	xe_reg_t (*reg32)(struct xe_gt *gt);
+	u32 mask;
+};
+
+bool xe_mmio_mask_read(struct xe_gt *gt,
+			xe_reg_t reg32, u32 mask)
+{
+	return xe_mmio_read32(gt, reg32) & mask;
+}
+
+static ssize_t throttle_reason_bool_show(struct device *dev,
+					 struct device_attribute *attr,
+					 char *buff)
+{
+	struct kobject *kobj = &dev->kobj;
+	struct xe_gt *gt = kobj_to_gt(kobj);
+	struct xe_gt_bool_throttle_attr *t_attr =
+			(struct xe_gt_bool_throttle_attr *) attr;
+	bool val = xe_mmio_mask_read(&gt->rps, t_attr->reg32(gt), t_attr->mask);
+
+	return sysfs_emit(buff, "%u\n", val);
+}
+
+#define XE_GT_BOOL_ATTR_RO(sysfs_func__, mask__) \
+struct xe_gt_bool_throttle_attr attr_##sysfs_func__ = { \
+	.attr = { .name = __stringify(sysfs_func__), .mode = 0444 }, \
+	.show = throttle_reason_bool_show, \
+	.reg32 = xe_gt_perf_limit_reasons_reg, \
+	.mask = mask__, \
+}
+
+static XE_GT_BOOL_ATTR_RO(throttle_reason_status, GT0_PERF_LIMIT_REASONS_MASK);
+static XE_GT_BOOL_ATTR_RO(throttle_reason_pl1, POWER_LIMIT_1_MASK);
+static XE_GT_BOOL_ATTR_RO(throttle_reason_pl2, POWER_LIMIT_2_MASK);
+static XE_GT_BOOL_ATTR_RO(throttle_reason_pl4, POWER_LIMIT_4_MASK);
+static XE_GT_BOOL_ATTR_RO(throttle_reason_thermal, THERMAL_LIMIT_MASK);
+static XE_GT_BOOL_ATTR_RO(throttle_reason_prochot, PROCHOT_MASK);
+static XE_GT_BOOL_ATTR_RO(throttle_reason_ratl, RATL_MASK);
+static XE_GT_BOOL_ATTR_RO(throttle_reason_vr_thermalert, VR_THERMALERT_MASK);
+static XE_GT_BOOL_ATTR_RO(throttle_reason_vr_tdc, VR_TDC_MASK);
+
+static const struct attribute *throttle_reason_attrs[] = {
+	&dev_attr_throttle_reason_status.attr,

drivers/gpu/drm/xe/xe_guc_pc.c static const struct attribute *pc_attrs[] = { · line 706

Quoted 10 lines
drivers/gpu/drm/xe/xe_guc_pc.c +10 -0
+	&dev_attr_throttle_reason_pl1.attr,
+	&dev_attr_throttle_reason_pl2.attr,
+	&dev_attr_throttle_reason_pl4.attr,
+	&dev_attr_throttle_reason_thermal.attr,
+	&dev_attr_throttle_reason_prochot.attr,
+	&dev_attr_throttle_reason_ratl.attr,
+	&dev_attr_throttle_reason_vr_thermalert.attr,
+	&dev_attr_throttle_reason_vr_tdc.attr,
+	NULL
+};

Also don't see these attributes actually being created, using sysfs_create_files etc. So has this patch been compiled/tested?

Quoted 7 lines
drivers/gpu/drm/xe/xe_guc_pc.c +1 -1
+
  static void mtl_init_fused_rp_values(struct xe_guc_pc *pc)
  {
 	struct xe_gt *gt = pc_to_gt(pc);
--

2.25.1

Quoted 3 lines

Thanks.
--
Ashutosh

Hi Ashutosh,

Quoted 7 lines

This was just a very basic non functional RFC patch meant to clarify the path/location of these sysfs attributes.

It's not a usable patch.

Rodrigo, could you help clarify whether we are intending to expose throttle reasons via hwmon in Xe ?

The current trend is to not use hwmon for frequency like we are not using for i915. So the throttle wouldn't make sense there.

For now let's move ahead with throttle near our freq setting sysfs. Then, if we end up moving freq towards hwmon (or something else) then we move throttle along.

Sorry for the delay in responding here.

Thanks,
Rodrigo.

Quoted 5 lines

Regards,

Suja

#6 lore raw

[Intel-xe] ✓ CI.Patch_applied: success for Adding throttle reasons sysfs attributes

In reply to Sujaritha Sundaresan
== Series Details ==

== Series Details ==

Series: Adding throttle reasons sysfs attributes
URL : https://patchwork.freedesktop.org/series/118559/
State : success

== Summary ==

=== Applying kernel patches on branch 'drm-xe-next' with base: === Base commit: d57bb4c83 fixup! drm/xe: Introduce a new DRM driver for Intel GPUs === git am output follows ===
Applying: drm/xe: Adding throttle reasons sysfs attributes

#7 lore raw

[Intel-xe] ✗ CI.KUnit: failure for Adding throttle reasons sysfs attributes

In reply to Sujaritha Sundaresan
== Series Details ==

== Series Details ==

Series: Adding throttle reasons sysfs attributes
URL : https://patchwork.freedesktop.org/series/118559/
State : failure

== Summary ==

+ trap cleanup EXIT
+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/drm/xe/.kunitconfig ERROR:root:../drivers/gpu/drm/xe/xe_guc_pc.c:642:1: error: unknown type name ‘xe_reg_t’ 642 | xe_reg_t xe_gt_perf_limit_reasons_reg(struct xe_gt *gt)

      | ^~~~~~~~
In file included from ../drivers/gpu/drm/xe/regs/xe_gt_regs.h:9,
                 from ../drivers/gpu/drm/xe/xe_guc_pc.c:12:
../drivers/gpu/drm/xe/xe_guc_pc.c: In function ‘xe_gt_perf_limit_reasons_reg’:
../drivers/gpu/drm/xe/regs/xe_reg_defs.h:85:26: error: incompatible types when returning type ‘const struct xe_reg’ but ‘int’ was expected
   85 | #define XE_REG(r_, ...)  ((const struct xe_reg)XE_REG_INITIALIZER(r_, ##__VA_ARGS__))
      |                          ^
../drivers/gpu/drm/xe/regs/xe_gt_regs.h:387:39: note: in expansion of macro ‘XE_REG’
  387 | #define MTL_MEDIA_PERF_LIMIT_REASONS  XE_REG(0x138030)
      |                                       ^~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:645:24: note: in expansion of macro ‘MTL_MEDIA_PERF_LIMIT_REASONS’
  645 |                 return MTL_MEDIA_PERF_LIMIT_REASONS;
      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/regs/xe_reg_defs.h:85:26: error: incompatible types when returning type ‘const struct xe_reg’ but ‘int’ was expected
   85 | #define XE_REG(r_, ...)  ((const struct xe_reg)XE_REG_INITIALIZER(r_, ##__VA_ARGS__))
      |                          ^
../drivers/gpu/drm/xe/regs/xe_gt_regs.h:377:34: note: in expansion of macro ‘XE_REG’
  377 | #define GT0_PERF_LIMIT_REASONS   XE_REG(0x1381a8)
      |                                  ^~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:647:16: note: in expansion of macro ‘GT0_PERF_LIMIT_REASONS’
  647 |         return GT0_PERF_LIMIT_REASONS;
      |                ^~~~~~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c: At top level:
../drivers/gpu/drm/xe/xe_guc_pc.c:654:2: error: expected specifier-qualifier-list before ‘xe_reg_t’
  654 |  xe_reg_t (*reg32)(struct xe_gt *gt);
      |  ^~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:659:4: error: unknown type name ‘xe_reg_t’
  659 |    xe_reg_t reg32, u32 mask)
      |    ^~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c: In function ‘throttle_reason_bool_show’:
../drivers/gpu/drm/xe/xe_guc_pc.c:672:13: error: implicit declaration of function ‘xe_mmio_mask_read’; did you mean ‘xe_mmio_read8’? [-Werror=implicit-function-declaration]
  672 |  bool val = xe_mmio_mask_read(&gt->rps, t_attr->reg32(gt), t_attr->mask);
      |             ^~~~~~~~~~~~~~~~~
      |             xe_mmio_read8

../drivers/gpu/drm/xe/xe_guc_pc.c:672:34: error: ‘struct xe_gt’ has no member named ‘rps’
672 | bool val = xe_mmio_mask_read(&gt->rps, t_attr->reg32(gt), t_attr->mask);
| ^~
../drivers/gpu/drm/xe/xe_guc_pc.c:672:47: error: ‘struct xe_gt_bool_throttle_attr’ has no member named ‘reg32’
672 | bool val = xe_mmio_mask_read(&gt->rps, t_attr->reg32(gt), t_attr->mask);
| ^~
../drivers/gpu/drm/xe/xe_guc_pc.c:672:66: error: ‘struct xe_gt_bool_throttle_attr’ has no member named ‘mask’
672 | bool val = xe_mmio_mask_read(&gt->rps, t_attr->reg32(gt), t_attr->mask);
| ^~
../drivers/gpu/drm/xe/xe_guc_pc.c: At top level:
../drivers/gpu/drm/xe/xe_guc_pc.c:681:3: error: ‘struct xe_gt_bool_throttle_attr’ has no member named ‘reg32’

  681 |  .reg32 = xe_gt_perf_limit_reasons_reg, \
      |   ^~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:685:8: note: in expansion of macro ‘XE_GT_BOOL_ATTR_RO’
  685 | static XE_GT_BOOL_ATTR_RO(throttle_reason_status, GT0_PERF_LIMIT_REASONS_MASK);
      |        ^~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:681:11: warning: excess elements in struct initializer
  681 |  .reg32 = xe_gt_perf_limit_reasons_reg, \
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:685:8: note: in expansion of macro ‘XE_GT_BOOL_ATTR_RO’
  685 | static XE_GT_BOOL_ATTR_RO(throttle_reason_status, GT0_PERF_LIMIT_REASONS_MASK);
      |        ^~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:681:11: note: (near initialization for ‘attr_throttle_reason_status’)
  681 |  .reg32 = xe_gt_perf_limit_reasons_reg, \
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:685:8: note: in expansion of macro ‘XE_GT_BOOL_ATTR_RO’
  685 | static XE_GT_BOOL_ATTR_RO(throttle_reason_status, GT0_PERF_LIMIT_REASONS_MASK);
      |        ^~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:682:3: error: ‘struct xe_gt_bool_throttle_attr’ has no member named ‘mask’
  682 |  .mask = mask__, \
      |   ^~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:685:8: note: in expansion of macro ‘XE_GT_BOOL_ATTR_RO’
  685 | static XE_GT_BOOL_ATTR_RO(throttle_reason_status, GT0_PERF_LIMIT_REASONS_MASK);
      |        ^~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/regs/xe_gt_regs.h:378:40: warning: excess elements in struct initializer
  378 | #define   GT0_PERF_LIMIT_REASONS_MASK  0xde3
      |                                        ^~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:682:10: note: in definition of macro ‘XE_GT_BOOL_ATTR_RO’
  682 |  .mask = mask__, \
      |          ^~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:685:51: note: in expansion of macro ‘GT0_PERF_LIMIT_REASONS_MASK’
  685 | static XE_GT_BOOL_ATTR_RO(throttle_reason_status, GT0_PERF_LIMIT_REASONS_MASK);
      |                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/regs/xe_gt_regs.h:378:40: note: (near initialization for ‘attr_throttle_reason_status’)
  378 | #define   GT0_PERF_LIMIT_REASONS_MASK  0xde3
      |                                        ^~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:682:10: note: in definition of macro ‘XE_GT_BOOL_ATTR_RO’
  682 |  .mask = mask__, \
      |          ^~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:685:51: note: in expansion of macro ‘GT0_PERF_LIMIT_REASONS_MASK’
  685 | static XE_GT_BOOL_ATTR_RO(throttle_reason_status, GT0_PERF_LIMIT_REASONS_MASK);
      |                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:681:3: error: ‘struct xe_gt_bool_throttle_attr’ has no member named ‘reg32’
  681 |  .reg32 = xe_gt_perf_limit_reasons_reg, \
      |   ^~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:686:8: note: in expansion of macro ‘XE_GT_BOOL_ATTR_RO’
  686 | static XE_GT_BOOL_ATTR_RO(throttle_reason_pl1, POWER_LIMIT_1_MASK);
      |        ^~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:681:11: warning: excess elements in struct initializer
  681 |  .reg32 = xe_gt_perf_limit_reasons_reg, \
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:686:8: note: in expansion of macro ‘XE_GT_BOOL_ATTR_RO’
  686 | static XE_GT_BOOL_ATTR_RO(throttle_reason_pl1, POWER_LIMIT_1_MASK);
      |        ^~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:681:11: note: (near initialization for ‘attr_throttle_reason_pl1’)
  681 |  .reg32 = xe_gt_perf_limit_reasons_reg, \
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:686:8: note: in expansion of macro ‘XE_GT_BOOL_ATTR_RO’
  686 | static XE_GT_BOOL_ATTR_RO(throttle_reason_pl1, POWER_LIMIT_1_MASK);
      |        ^~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:682:3: error: ‘struct xe_gt_bool_throttle_attr’ has no member named ‘mask’
  682 |  .mask = mask__, \
      |   ^~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:686:8: note: in expansion of macro ‘XE_GT_BOOL_ATTR_RO’
  686 | static XE_GT_BOOL_ATTR_RO(throttle_reason_pl1, POWER_LIMIT_1_MASK);
      |        ^~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/compat-i915-headers/../../i915/i915_reg_defs.h:21:2: warning: excess elements in struct initializer
   21 |  ((u32)(BIT(__n) +      \
      |  ^
../drivers/gpu/drm/xe/xe_guc_pc.c:682:10: note: in definition of macro ‘XE_GT_BOOL_ATTR_RO’
  682 |  .mask = mask__, \
      |          ^~~~~~
../drivers/gpu/drm/xe/regs/xe_gt_regs.h:385:32: note: in expansion of macro ‘REG_BIT’
  385 | #define   POWER_LIMIT_1_MASK   REG_BIT(10)
      |                                ^~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:686:48: note: in expansion of macro ‘POWER_LIMIT_1_MASK’
  686 | static XE_GT_BOOL_ATTR_RO(throttle_reason_pl1, POWER_LIMIT_1_MASK);
      |                                                ^~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/compat-i915-headers/../../i915/i915_reg_defs.h:21:2: note: (near initialization for ‘attr_throttle_reason_pl1’)
   21 |  ((u32)(BIT(__n) +      \
      |  ^
../drivers/gpu/drm/xe/xe_guc_pc.c:682:10: note: in definition of macro ‘XE_GT_BOOL_ATTR_RO’
  682 |  .mask = mask__, \
      |          ^~~~~~
../drivers/gpu/drm/xe/regs/xe_gt_regs.h:385:32: note: in expansion of macro ‘REG_BIT’
  385 | #define   POWER_LIMIT_1_MASK   REG_BIT(10)
      |                                ^~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:686:48: note: in expansion of macro ‘POWER_LIMIT_1_MASK’
  686 | static XE_GT_BOOL_ATTR_RO(throttle_reason_pl1, POWER_LIMIT_1_MASK);
      |                                                ^~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:681:3: error: ‘struct xe_gt_bool_throttle_attr’ has no member named ‘reg32’
  681 |  .reg32 = xe_gt_perf_limit_reasons_reg, \
      |   ^~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:687:8: note: in expansion of macro ‘XE_GT_BOOL_ATTR_RO’
  687 | static XE_GT_BOOL_ATTR_RO(throttle_reason_pl2, POWER_LIMIT_2_MASK);
      |        ^~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:681:11: warning: excess elements in struct initializer
  681 |  .reg32 = xe_gt_perf_limit_reasons_reg, \
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:687:8: note: in expansion of macro ‘XE_GT_BOOL_ATTR_RO’
  687 | static XE_GT_BOOL_ATTR_RO(throttle_reason_pl2, POWER_LIMIT_2_MASK);
      |        ^~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:681:11: note: (near initialization for ‘attr_throttle_reason_pl2’)
  681 |  .reg32 = xe_gt_perf_limit_reasons_reg, \
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:687:8: note: in expansion of macro ‘XE_GT_BOOL_ATTR_RO’
  687 | static XE_GT_BOOL_ATTR_RO(throttle_reason_pl2, POWER_LIMIT_2_MASK);
      |        ^~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:682:3: error: ‘struct xe_gt_bool_throttle_attr’ has no member named ‘mask’
  682 |  .mask = mask__, \
      |   ^~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:687:8: note: in expansion of macro ‘XE_GT_BOOL_ATTR_RO’
  687 | static XE_GT_BOOL_ATTR_RO(throttle_reason_pl2, POWER_LIMIT_2_MASK);
      |        ^~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/compat-i915-headers/../../i915/i915_reg_defs.h:21:2: warning: excess elements in struct initializer
   21 |  ((u32)(BIT(__n) +      \
      |  ^
../drivers/gpu/drm/xe/xe_guc_pc.c:682:10: note: in definition of macro ‘XE_GT_BOOL_ATTR_RO’
  682 |  .mask = mask__, \
      |          ^~~~~~
../drivers/gpu/drm/xe/regs/xe_gt_regs.h:386:32: note: in expansion of macro ‘REG_BIT’
  386 | #define   POWER_LIMIT_2_MASK   REG_BIT(11)
      |                                ^~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:687:48: note: in expansion of macro ‘POWER_LIMIT_2_MASK’
  687 | static XE_GT_BOOL_ATTR_RO(throttle_reason_pl2, POWER_LIMIT_2_MASK);
      |                                                ^~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/compat-i915-headers/../../i915/i915_reg_defs.h:21:2: note: (near initialization for ‘attr_throttle_reason_pl2’)
   21 |  ((u32)(BIT(__n) +      \
      |  ^
../drivers/gpu/drm/xe/xe_guc_pc.c:682:10: note: in definition of macro ‘XE_GT_BOOL_ATTR_RO’
  682 |  .mask = mask__, \
      |          ^~~~~~
../drivers/gpu/drm/xe/regs/xe_gt_regs.h:386:32: note: in expansion of macro ‘REG_BIT’
  386 | #define   POWER_LIMIT_2_MASK   REG_BIT(11)
      |                                ^~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:687:48: note: in expansion of macro ‘POWER_LIMIT_2_MASK’
  687 | static XE_GT_BOOL_ATTR_RO(throttle_reason_pl2, POWER_LIMIT_2_MASK);
      |                                                ^~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:681:3: error: ‘struct xe_gt_bool_throttle_attr’ has no member named ‘reg32’
  681 |  .reg32 = xe_gt_perf_limit_reasons_reg, \
      |   ^~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:688:8: note: in expansion of macro ‘XE_GT_BOOL_ATTR_RO’
  688 | static XE_GT_BOOL_ATTR_RO(throttle_reason_pl4, POWER_LIMIT_4_MASK);
      |        ^~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:681:11: warning: excess elements in struct initializer
  681 |  .reg32 = xe_gt_perf_limit_reasons_reg, \
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:688:8: note: in expansion of macro ‘XE_GT_BOOL_ATTR_RO’
  688 | static XE_GT_BOOL_ATTR_RO(throttle_reason_pl4, POWER_LIMIT_4_MASK);
      |        ^~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:681:11: note: (near initialization for ‘attr_throttle_reason_pl4’)
  681 |  .reg32 = xe_gt_perf_limit_reasons_reg, \
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:688:8: note: in expansion of macro ‘XE_GT_BOOL_ATTR_RO’
  688 | static XE_GT_BOOL_ATTR_RO(throttle_reason_pl4, POWER_LIMIT_4_MASK);
      |        ^~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:682:3: error: ‘struct xe_gt_bool_throttle_attr’ has no member named ‘mask’
  682 |  .mask = mask__, \
      |   ^~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:688:8: note: in expansion of macro ‘XE_GT_BOOL_ATTR_RO’
  688 | static XE_GT_BOOL_ATTR_RO(throttle_reason_pl4, POWER_LIMIT_4_MASK);
      |        ^~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/compat-i915-headers/../../i915/i915_reg_defs.h:21:2: warning: excess elements in struct initializer
   21 |  ((u32)(BIT(__n) +      \
      |  ^
../drivers/gpu/drm/xe/xe_guc_pc.c:682:10: note: in definition of macro ‘XE_GT_BOOL_ATTR_RO’
  682 |  .mask = mask__, \
      |          ^~~~~~
../drivers/gpu/drm/xe/regs/xe_gt_regs.h:384:32: note: in expansion of macro ‘REG_BIT’
  384 | #define   POWER_LIMIT_4_MASK   REG_BIT(8)
      |                                ^~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:688:48: note: in expansion of macro ‘POWER_LIMIT_4_MASK’
  688 | static XE_GT_BOOL_ATTR_RO(throttle_reason_pl4, POWER_LIMIT_4_MASK);
      |                                                ^~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/compat-i915-headers/../../i915/i915_reg_defs.h:21:2: note: (near initialization for ‘attr_throttle_reason_pl4’)
   21 |  ((u32)(BIT(__n) +      \
      |  ^
../drivers/gpu/drm/xe/xe_guc_pc.c:682:10: note: in definition of macro ‘XE_GT_BOOL_ATTR_RO’
  682 |  .mask = mask__, \
      |          ^~~~~~
../drivers/gpu/drm/xe/regs/xe_gt_regs.h:384:32: note: in expansion of macro ‘REG_BIT’
  384 | #define   POWER_LIMIT_4_MASK   REG_BIT(8)
      |                                ^~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:688:48: note: in expansion of macro ‘POWER_LIMIT_4_MASK’
  688 | static XE_GT_BOOL_ATTR_RO(throttle_reason_pl4, POWER_LIMIT_4_MASK);
      |                                                ^~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:681:3: error: ‘struct xe_gt_bool_throttle_attr’ has no member named ‘reg32’
  681 |  .reg32 = xe_gt_perf_limit_reasons_reg, \
      |   ^~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:689:8: note: in expansion of macro ‘XE_GT_BOOL_ATTR_RO’
  689 | static XE_GT_BOOL_ATTR_RO(throttle_reason_thermal, THERMAL_LIMIT_MASK);
      |        ^~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:681:11: warning: excess elements in struct initializer
  681 |  .reg32 = xe_gt_perf_limit_reasons_reg, \
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:689:8: note: in expansion of macro ‘XE_GT_BOOL_ATTR_RO’
  689 | static XE_GT_BOOL_ATTR_RO(throttle_reason_thermal, THERMAL_LIMIT_MASK);
      |        ^~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:681:11: note: (near initialization for ‘attr_throttle_reason_thermal’)
  681 |  .reg32 = xe_gt_perf_limit_reasons_reg, \
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:689:8: note: in expansion of macro ‘XE_GT_BOOL_ATTR_RO’
  689 | static XE_GT_BOOL_ATTR_RO(throttle_reason_thermal, THERMAL_LIMIT_MASK);
      |        ^~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:682:3: error: ‘struct xe_gt_bool_throttle_attr’ has no member named ‘mask’
  682 |  .mask = mask__, \
      |   ^~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:689:8: note: in expansion of macro ‘XE_GT_BOOL_ATTR_RO’
  689 | static XE_GT_BOOL_ATTR_RO(throttle_reason_thermal, THERMAL_LIMIT_MASK);
      |        ^~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/compat-i915-headers/../../i915/i915_reg_defs.h:21:2: warning: excess elements in struct initializer
   21 |  ((u32)(BIT(__n) +      \
      |  ^
../drivers/gpu/drm/xe/xe_guc_pc.c:682:10: note: in definition of macro ‘XE_GT_BOOL_ATTR_RO’
  682 |  .mask = mask__, \
      |          ^~~~~~
../drivers/gpu/drm/xe/regs/xe_gt_regs.h:380:32: note: in expansion of macro ‘REG_BIT’
  380 | #define   THERMAL_LIMIT_MASK   REG_BIT(1)
      |                                ^~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:689:52: note: in expansion of macro ‘THERMAL_LIMIT_MASK’
  689 | static XE_GT_BOOL_ATTR_RO(throttle_reason_thermal, THERMAL_LIMIT_MASK);
      |                                                    ^~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/compat-i915-headers/../../i915/i915_reg_defs.h:21:2: note: (near initialization for ‘attr_throttle_reason_thermal’)
   21 |  ((u32)(BIT(__n) +      \
      |  ^
../drivers/gpu/drm/xe/xe_guc_pc.c:682:10: note: in definition of macro ‘XE_GT_BOOL_ATTR_RO’
  682 |  .mask = mask__, \
      |          ^~~~~~
../drivers/gpu/drm/xe/regs/xe_gt_regs.h:380:32: note: in expansion of macro ‘REG_BIT’
  380 | #define   THERMAL_LIMIT_MASK   REG_BIT(1)
      |                                ^~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:689:52: note: in expansion of macro ‘THERMAL_LIMIT_MASK’
  689 | static XE_GT_BOOL_ATTR_RO(throttle_reason_thermal, THERMAL_LIMIT_MASK);
      |                                                    ^~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:681:3: error: ‘struct xe_gt_bool_throttle_attr’ has no member named ‘reg32’
  681 |  .reg32 = xe_gt_perf_limit_reasons_reg, \
      |   ^~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:690:8: note: in expansion of macro ‘XE_GT_BOOL_ATTR_RO’
  690 | static XE_GT_BOOL_ATTR_RO(throttle_reason_prochot, PROCHOT_MASK);
      |        ^~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:681:11: warning: excess elements in struct initializer
  681 |  .reg32 = xe_gt_perf_limit_reasons_reg, \
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:690:8: note: in expansion of macro ‘XE_GT_BOOL_ATTR_RO’
  690 | static XE_GT_BOOL_ATTR_RO(throttle_reason_prochot, PROCHOT_MASK);
      |        ^~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:681:11: note: (near initialization for ‘attr_throttle_reason_prochot’)
  681 |  .reg32 = xe_gt_perf_limit_reasons_reg, \
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:690:8: note: in expansion of macro ‘XE_GT_BOOL_ATTR_RO’
  690 | static XE_GT_BOOL_ATTR_RO(throttle_reason_prochot, PROCHOT_MASK);
      |        ^~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:682:3: error: ‘struct xe_gt_bool_throttle_attr’ has no member named ‘mask’
  682 |  .mask = mask__, \
      |   ^~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:690:8: note: in expansion of macro ‘XE_GT_BOOL_ATTR_RO’
  690 | static XE_GT_BOOL_ATTR_RO(throttle_reason_prochot, PROCHOT_MASK);
      |        ^~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/compat-i915-headers/../../i915/i915_reg_defs.h:21:2: warning: excess elements in struct initializer
   21 |  ((u32)(BIT(__n) +      \
      |  ^
../drivers/gpu/drm/xe/xe_guc_pc.c:682:10: note: in definition of macro ‘XE_GT_BOOL_ATTR_RO’
  682 |  .mask = mask__, \
      |          ^~~~~~
../drivers/gpu/drm/xe/regs/xe_gt_regs.h:379:27: note: in expansion of macro ‘REG_BIT’
  379 | #define   PROCHOT_MASK    REG_BIT(0)
      |                           ^~~~~~~

../drivers/gpu/drm/xe/xe_guc_pc.c:690:52: note: in expansion of macro ‘PROCHOT_MASK’
690 | static XE_GT_BOOL_ATTR_RO(throttle_reason_prochot, PROCHOT_MASK);
| ^~~~~~~~~~~~
../drivers/gpu/drm/xe/compat-i915-headers/../../i915/i915_reg_defs.h:21:2: note: (near initialization for ‘attr_throttle_reason_prochot’)

   21 |  ((u32)(BIT(__n) +      \
      |  ^
../drivers/gpu/drm/xe/xe_guc_pc.c:682:10: note: in definition of macro ‘XE_GT_BOOL_ATTR_RO’
  682 |  .mask = mask__, \
      |          ^~~~~~
../drivers/gpu/drm/xe/regs/xe_gt_regs.h:379:27: note: in expansion of macro ‘REG_BIT’
  379 | #define   PROCHOT_MASK    REG_BIT(0)
      |                           ^~~~~~~

../drivers/gpu/drm/xe/xe_guc_pc.c:690:52: note: in expansion of macro ‘PROCHOT_MASK’
690 | static XE_GT_BOOL_ATTR_RO(throttle_reason_prochot, PROCHOT_MASK);
| ^~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:681:3: error: ‘struct xe_gt_bool_throttle_attr’ has no member named ‘reg32’

  681 |  .reg32 = xe_gt_perf_limit_reasons_reg, \
      |   ^~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:691:8: note: in expansion of macro ‘XE_GT_BOOL_ATTR_RO’
  691 | static XE_GT_BOOL_ATTR_RO(throttle_reason_ratl, RATL_MASK);
      |        ^~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:681:11: warning: excess elements in struct initializer
  681 |  .reg32 = xe_gt_perf_limit_reasons_reg, \
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:691:8: note: in expansion of macro ‘XE_GT_BOOL_ATTR_RO’
  691 | static XE_GT_BOOL_ATTR_RO(throttle_reason_ratl, RATL_MASK);
      |        ^~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:681:11: note: (near initialization for ‘attr_throttle_reason_ratl’)
  681 |  .reg32 = xe_gt_perf_limit_reasons_reg, \
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:691:8: note: in expansion of macro ‘XE_GT_BOOL_ATTR_RO’
  691 | static XE_GT_BOOL_ATTR_RO(throttle_reason_ratl, RATL_MASK);
      |        ^~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:682:3: error: ‘struct xe_gt_bool_throttle_attr’ has no member named ‘mask’
  682 |  .mask = mask__, \
      |   ^~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:691:8: note: in expansion of macro ‘XE_GT_BOOL_ATTR_RO’
  691 | static XE_GT_BOOL_ATTR_RO(throttle_reason_ratl, RATL_MASK);
      |        ^~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/compat-i915-headers/../../i915/i915_reg_defs.h:21:2: warning: excess elements in struct initializer
   21 |  ((u32)(BIT(__n) +      \
      |  ^
../drivers/gpu/drm/xe/xe_guc_pc.c:682:10: note: in definition of macro ‘XE_GT_BOOL_ATTR_RO’
  682 |  .mask = mask__, \
      |          ^~~~~~
../drivers/gpu/drm/xe/regs/xe_gt_regs.h:381:24: note: in expansion of macro ‘REG_BIT’
  381 | #define   RATL_MASK    REG_BIT(5)
      |                        ^~~~~~~

../drivers/gpu/drm/xe/xe_guc_pc.c:691:49: note: in expansion of macro ‘RATL_MASK’
691 | static XE_GT_BOOL_ATTR_RO(throttle_reason_ratl, RATL_MASK);
| ^~~~~~~~~
../drivers/gpu/drm/xe/compat-i915-headers/../../i915/i915_reg_defs.h:21:2: note: (near initialization for ‘attr_throttle_reason_ratl’)

   21 |  ((u32)(BIT(__n) +      \
      |  ^
../drivers/gpu/drm/xe/xe_guc_pc.c:682:10: note: in definition of macro ‘XE_GT_BOOL_ATTR_RO’
  682 |  .mask = mask__, \
      |          ^~~~~~
../drivers/gpu/drm/xe/regs/xe_gt_regs.h:381:24: note: in expansion of macro ‘REG_BIT’
  381 | #define   RATL_MASK    REG_BIT(5)
      |                        ^~~~~~~

../drivers/gpu/drm/xe/xe_guc_pc.c:691:49: note: in expansion of macro ‘RATL_MASK’
691 | static XE_GT_BOOL_ATTR_RO(throttle_reason_ratl, RATL_MASK);
| ^~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:681:3: error: ‘struct xe_gt_bool_throttle_attr’ has no member named ‘reg32’

  681 |  .reg32 = xe_gt_perf_limit_reasons_reg, \
      |   ^~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:692:8: note: in expansion of macro ‘XE_GT_BOOL_ATTR_RO’
  692 | static XE_GT_BOOL_ATTR_RO(throttle_reason_vr_thermalert, VR_THERMALERT_MASK);
      |        ^~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:681:11: warning: excess elements in struct initializer
  681 |  .reg32 = xe_gt_perf_limit_reasons_reg, \
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:692:8: note: in expansion of macro ‘XE_GT_BOOL_ATTR_RO’
  692 | static XE_GT_BOOL_ATTR_RO(throttle_reason_vr_thermalert, VR_THERMALERT_MASK);
      |        ^~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:681:11: note: (near initialization for ‘attr_throttle_reason_vr_thermalert’)
  681 |  .reg32 = xe_gt_perf_limit_reasons_reg, \
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:692:8: note: in expansion of macro ‘XE_GT_BOOL_ATTR_RO’
  692 | static XE_GT_BOOL_ATTR_RO(throttle_reason_vr_thermalert, VR_THERMALERT_MASK);
      |        ^~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:682:3: error: ‘struct xe_gt_bool_throttle_attr’ has no member named ‘mask’
  682 |  .mask = mask__, \
      |   ^~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:692:8: note: in expansion of macro ‘XE_GT_BOOL_ATTR_RO’
  692 | static XE_GT_BOOL_ATTR_RO(throttle_reason_vr_thermalert, VR_THERMALERT_MASK);
      |        ^~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/compat-i915-headers/../../i915/i915_reg_defs.h:21:2: warning: excess elements in struct initializer
   21 |  ((u32)(BIT(__n) +      \
      |  ^
../drivers/gpu/drm/xe/xe_guc_pc.c:682:10: note: in definition of macro ‘XE_GT_BOOL_ATTR_RO’
  682 |  .mask = mask__, \
      |          ^~~~~~
../drivers/gpu/drm/xe/regs/xe_gt_regs.h:382:32: note: in expansion of macro ‘REG_BIT’
  382 | #define   VR_THERMALERT_MASK   REG_BIT(6)
      |                                ^~~~~~~

../drivers/gpu/drm/xe/xe_guc_pc.c:692:58: note: in expansion of macro ‘VR_THERMALERT_MASK’
692 | static XE_GT_BOOL_ATTR_RO(throttle_reason_vr_thermalert, VR_THERMALERT_MASK);
| ^~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/compat-i915-headers/../../i915/i915_reg_defs.h:21:2: note: (near initialization for ‘attr_throttle_reason_vr_thermalert’)

   21 |  ((u32)(BIT(__n) +      \
      |  ^
../drivers/gpu/drm/xe/xe_guc_pc.c:682:10: note: in definition of macro ‘XE_GT_BOOL_ATTR_RO’
  682 |  .mask = mask__, \
      |          ^~~~~~
../drivers/gpu/drm/xe/regs/xe_gt_regs.h:382:32: note: in expansion of macro ‘REG_BIT’
  382 | #define   VR_THERMALERT_MASK   REG_BIT(6)
      |                                ^~~~~~~

../drivers/gpu/drm/xe/xe_guc_pc.c:692:58: note: in expansion of macro ‘VR_THERMALERT_MASK’
692 | static XE_GT_BOOL_ATTR_RO(throttle_reason_vr_thermalert, VR_THERMALERT_MASK);
| ^~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:681:3: error: ‘struct xe_gt_bool_throttle_attr’ has no member named ‘reg32’

  681 |  .reg32 = xe_gt_perf_limit_reasons_reg, \
      |   ^~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:693:8: note: in expansion of macro ‘XE_GT_BOOL_ATTR_RO’
  693 | static XE_GT_BOOL_ATTR_RO(throttle_reason_vr_tdc, VR_TDC_MASK);
      |        ^~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:681:11: warning: excess elements in struct initializer
  681 |  .reg32 = xe_gt_perf_limit_reasons_reg, \
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:693:8: note: in expansion of macro ‘XE_GT_BOOL_ATTR_RO’
  693 | static XE_GT_BOOL_ATTR_RO(throttle_reason_vr_tdc, VR_TDC_MASK);
      |        ^~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:681:11: note: (near initialization for ‘attr_throttle_reason_vr_tdc’)
  681 |  .reg32 = xe_gt_perf_limit_reasons_reg, \
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:693:8: note: in expansion of macro ‘XE_GT_BOOL_ATTR_RO’
  693 | static XE_GT_BOOL_ATTR_RO(throttle_reason_vr_tdc, VR_TDC_MASK);
      |        ^~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:682:3: error: ‘struct xe_gt_bool_throttle_attr’ has no member named ‘mask’
  682 |  .mask = mask__, \
      |   ^~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:693:8: note: in expansion of macro ‘XE_GT_BOOL_ATTR_RO’
  693 | static XE_GT_BOOL_ATTR_RO(throttle_reason_vr_tdc, VR_TDC_MASK);
      |        ^~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/compat-i915-headers/../../i915/i915_reg_defs.h:21:2: warning: excess elements in struct initializer
   21 |  ((u32)(BIT(__n) +      \
      |  ^
../drivers/gpu/drm/xe/xe_guc_pc.c:682:10: note: in definition of macro ‘XE_GT_BOOL_ATTR_RO’
  682 |  .mask = mask__, \
      |          ^~~~~~
../drivers/gpu/drm/xe/regs/xe_gt_regs.h:383:26: note: in expansion of macro ‘REG_BIT’
  383 | #define   VR_TDC_MASK    REG_BIT(7)
      |                          ^~~~~~~

../drivers/gpu/drm/xe/xe_guc_pc.c:693:51: note: in expansion of macro ‘VR_TDC_MASK’
693 | static XE_GT_BOOL_ATTR_RO(throttle_reason_vr_tdc, VR_TDC_MASK);
| ^~~~~~~~~~~
../drivers/gpu/drm/xe/compat-i915-headers/../../i915/i915_reg_defs.h:21:2: note: (near initialization for ‘attr_throttle_reason_vr_tdc’)

   21 |  ((u32)(BIT(__n) +      \
      |  ^
../drivers/gpu/drm/xe/xe_guc_pc.c:682:10: note: in definition of macro ‘XE_GT_BOOL_ATTR_RO’
  682 |  .mask = mask__, \
      |          ^~~~~~
../drivers/gpu/drm/xe/regs/xe_gt_regs.h:383:26: note: in expansion of macro ‘REG_BIT’
  383 | #define   VR_TDC_MASK    REG_BIT(7)
      |                          ^~~~~~~

../drivers/gpu/drm/xe/xe_guc_pc.c:693:51: note: in expansion of macro ‘VR_TDC_MASK’
693 | static XE_GT_BOOL_ATTR_RO(throttle_reason_vr_tdc, VR_TDC_MASK);
| ^~~~~~~~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:696:3: error: ‘dev_attr_throttle_reason_status’ undeclared here (not in a function); did you mean ‘attr_throttle_reason_status’?

  696 |  &dev_attr_throttle_reason_status.attr,
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |   attr_throttle_reason_status
../drivers/gpu/drm/xe/xe_guc_pc.c:697:3: error: ‘dev_attr_throttle_reason_pl1’ undeclared here (not in a function); did you mean ‘attr_throttle_reason_pl1’?
  697 |  &dev_attr_throttle_reason_pl1.attr,
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |   attr_throttle_reason_pl1
../drivers/gpu/drm/xe/xe_guc_pc.c:698:3: error: ‘dev_attr_throttle_reason_pl2’ undeclared here (not in a function); did you mean ‘attr_throttle_reason_pl2’?
  698 |  &dev_attr_throttle_reason_pl2.attr,
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |   attr_throttle_reason_pl2
../drivers/gpu/drm/xe/xe_guc_pc.c:699:3: error: ‘dev_attr_throttle_reason_pl4’ undeclared here (not in a function); did you mean ‘attr_throttle_reason_pl4’?
  699 |  &dev_attr_throttle_reason_pl4.attr,
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |   attr_throttle_reason_pl4
../drivers/gpu/drm/xe/xe_guc_pc.c:700:3: error: ‘dev_attr_throttle_reason_thermal’ undeclared here (not in a function); did you mean ‘attr_throttle_reason_thermal’?
  700 |  &dev_attr_throttle_reason_thermal.attr,
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |   attr_throttle_reason_thermal
../drivers/gpu/drm/xe/xe_guc_pc.c:701:3: error: ‘dev_attr_throttle_reason_prochot’ undeclared here (not in a function); did you mean ‘attr_throttle_reason_prochot’?
  701 |  &dev_attr_throttle_reason_prochot.attr,
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |   attr_throttle_reason_prochot
../drivers/gpu/drm/xe/xe_guc_pc.c:702:3: error: ‘dev_attr_throttle_reason_ratl’ undeclared here (not in a function); did you mean ‘attr_throttle_reason_ratl’?
  702 |  &dev_attr_throttle_reason_ratl.attr,
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |   attr_throttle_reason_ratl
../drivers/gpu/drm/xe/xe_guc_pc.c:703:3: error: ‘dev_attr_throttle_reason_vr_thermalert’ undeclared here (not in a function); did you mean ‘attr_throttle_reason_vr_thermalert’?
  703 |  &dev_attr_throttle_reason_vr_thermalert.attr,
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |   attr_throttle_reason_vr_thermalert
../drivers/gpu/drm/xe/xe_guc_pc.c:704:3: error: ‘dev_attr_throttle_reason_vr_tdc’ undeclared here (not in a function); did you mean ‘attr_throttle_reason_vr_tdc’?
  704 |  &dev_attr_throttle_reason_vr_tdc.attr,
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |   attr_throttle_reason_vr_tdc
../drivers/gpu/drm/xe/xe_guc_pc.c:695:32: warning: ‘throttle_reason_attrs’ defined but not used [-Wunused-variable]
  695 | static const struct attribute *throttle_reason_attrs[] = {
      |                                ^~~~~~~~~~~~~~~~~~~~~

../drivers/gpu/drm/xe/xe_guc_pc.c:678:33: warning: ‘attr_throttle_reason_vr_tdc’ defined but not used [-Wunused-variable]
678 | struct xe_gt_bool_throttle_attr attr_##sysfs_func__ = { \
| ^~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:693:8: note: in expansion of macro ‘XE_GT_BOOL_ATTR_RO’

  693 | static XE_GT_BOOL_ATTR_RO(throttle_reason_vr_tdc, VR_TDC_MASK);
      |        ^~~~~~~~~~~~~~~~~~

../drivers/gpu/drm/xe/xe_guc_pc.c:678:33: warning: ‘attr_throttle_reason_vr_thermalert’ defined but not used [-Wunused-variable]
678 | struct xe_gt_bool_throttle_attr attr_##sysfs_func__ = { \
| ^~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:692:8: note: in expansion of macro ‘XE_GT_BOOL_ATTR_RO’

  692 | static XE_GT_BOOL_ATTR_RO(throttle_reason_vr_thermalert, VR_THERMALERT_MASK);
      |        ^~~~~~~~~~~~~~~~~~

../drivers/gpu/drm/xe/xe_guc_pc.c:678:33: warning: ‘attr_throttle_reason_ratl’ defined but not used [-Wunused-variable]
678 | struct xe_gt_bool_throttle_attr attr_##sysfs_func__ = { \
| ^~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:691:8: note: in expansion of macro ‘XE_GT_BOOL_ATTR_RO’

  691 | static XE_GT_BOOL_ATTR_RO(throttle_reason_ratl, RATL_MASK);
      |        ^~~~~~~~~~~~~~~~~~

../drivers/gpu/drm/xe/xe_guc_pc.c:678:33: warning: ‘attr_throttle_reason_prochot’ defined but not used [-Wunused-variable]
678 | struct xe_gt_bool_throttle_attr attr_##sysfs_func__ = { \
| ^~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:690:8: note: in expansion of macro ‘XE_GT_BOOL_ATTR_RO’

  690 | static XE_GT_BOOL_ATTR_RO(throttle_reason_prochot, PROCHOT_MASK);
      |        ^~~~~~~~~~~~~~~~~~

../drivers/gpu/drm/xe/xe_guc_pc.c:678:33: warning: ‘attr_throttle_reason_thermal’ defined but not used [-Wunused-variable]
678 | struct xe_gt_bool_throttle_attr attr_##sysfs_func__ = { \
| ^~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:689:8: note: in expansion of macro ‘XE_GT_BOOL_ATTR_RO’

  689 | static XE_GT_BOOL_ATTR_RO(throttle_reason_thermal, THERMAL_LIMIT_MASK);
      |        ^~~~~~~~~~~~~~~~~~

../drivers/gpu/drm/xe/xe_guc_pc.c:678:33: warning: ‘attr_throttle_reason_pl4’ defined but not used [-Wunused-variable]
678 | struct xe_gt_bool_throttle_attr attr_##sysfs_func__ = { \
| ^~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:688:8: note: in expansion of macro ‘XE_GT_BOOL_ATTR_RO’

  688 | static XE_GT_BOOL_ATTR_RO(throttle_reason_pl4, POWER_LIMIT_4_MASK);
      |        ^~~~~~~~~~~~~~~~~~

../drivers/gpu/drm/xe/xe_guc_pc.c:678:33: warning: ‘attr_throttle_reason_pl2’ defined but not used [-Wunused-variable]
678 | struct xe_gt_bool_throttle_attr attr_##sysfs_func__ = { \
| ^~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:687:8: note: in expansion of macro ‘XE_GT_BOOL_ATTR_RO’

  687 | static XE_GT_BOOL_ATTR_RO(throttle_reason_pl2, POWER_LIMIT_2_MASK);
      |        ^~~~~~~~~~~~~~~~~~

../drivers/gpu/drm/xe/xe_guc_pc.c:678:33: warning: ‘attr_throttle_reason_pl1’ defined but not used [-Wunused-variable]
678 | struct xe_gt_bool_throttle_attr attr_##sysfs_func__ = { \
| ^~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:686:8: note: in expansion of macro ‘XE_GT_BOOL_ATTR_RO’

  686 | static XE_GT_BOOL_ATTR_RO(throttle_reason_pl1, POWER_LIMIT_1_MASK);
      |        ^~~~~~~~~~~~~~~~~~

../drivers/gpu/drm/xe/xe_guc_pc.c:678:33: warning: ‘attr_throttle_reason_status’ defined but not used [-Wunused-variable]
678 | struct xe_gt_bool_throttle_attr attr_##sysfs_func__ = { \
| ^~~~~
../drivers/gpu/drm/xe/xe_guc_pc.c:685:8: note: in expansion of macro ‘XE_GT_BOOL_ATTR_RO’

  685 | static XE_GT_BOOL_ATTR_RO(throttle_reason_status, GT0_PERF_LIMIT_REASONS_MASK);
      |        ^~~~~~~~~~~~~~~~~~

cc1: some warnings being treated as errors
make[6]: *** [../scripts/Makefile.build:252: drivers/gpu/drm/xe/xe_guc_pc.o] Error 1 make[6]: *** Waiting for unfinished jobs....
make[5]: *** [../scripts/Makefile.build:494: drivers/gpu/drm/xe] Error 2 make[5]: *** Waiting for unfinished jobs....
make[4]: *** [../scripts/Makefile.build:494: drivers/gpu/drm] Error 2 make[3]: *** [../scripts/Makefile.build:494: drivers/gpu] Error 2 make[2]: *** [../scripts/Makefile.build:494: drivers] Error 2
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [/kernel/Makefile:2025: .] Error 2
make: *** [Makefile:226: __sub-make] Error 2

[10:29:00] Configuring KUnit Kernel ...
Generating .config ...
Populating config with:

$ make ARCH=um O=.kunit olddefconfig
[10:29:04] Building KUnit Kernel ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
Building with:
$ make ARCH=um O=.kunit --jobs=48
+ cleanup
++ stat -c %u:%g /kernel
+ chown -R 1003:1003 /kernel
#8 lore raw
In reply to Sujaritha Sundaresan

Hi,

Quoted 3 lines · Sujaritha Sundaresan

Exposing various throttle reasons attributes as part of sysfs. These attributes can point to various reasons for performance limitations, include power limits, temperature etc.

No need for cover letter for a single patch. Could just fold the above description into the patch commit message.

Thanks,

Thomas

Quoted 8 lines

Sujaritha Sundaresan (1):
[RFC]drm/xe: Adding throttle reasons sysfs attributes

  drivers/gpu/drm/xe/regs/xe_gt_regs.h | 12 +++++
  drivers/gpu/drm/xe/xe_guc_pc.c       | 67 ++++++++++++++++++++++++++++
  2 files changed, 79 insertions(+)