On 03-08-2023 04:58, Andi Shyti wrote:
Hi Badal,
On Wed, Aug 02, 2023 at 07:22:38PM +0530, Badal Nilawar wrote:
Expose the card reactive critical (I1) power. I1 is exposed as
power1_crit in microwatts (typically for client products) or as
curr1_crit in milliamperes (typically for server).
v2:
- Move PCODE_MBOX macro to pcode file (Riana)
v3:
- %s/hwm_/hwmon_/ (Matt Brost)
- s/IS_DG2/(gt_to_xe(gt)->info.platform == XE_DG2)
Signed-off-by: Badal Nilawar <badal.nilawar@xxxxxxxxx>
---
.../ABI/testing/sysfs-driver-intel-xe-hwmon | 26 +++++
drivers/gpu/drm/xe/xe_hwmon.c | 106 +++++++++++++++++-
drivers/gpu/drm/xe/xe_pcode.h | 5 +
drivers/gpu/drm/xe/xe_pcode_api.h | 7 ++
4 files changed, 143 insertions(+), 1 deletion(-)
diff --git a/Documentation/ABI/testing/sysfs-driver-intel-xe-hwmon b/Documentation/ABI/testing/sysfs-driver-intel-xe-hwmon
index d48d98f903ed..ea60add73743 100644
--- a/Documentation/ABI/testing/sysfs-driver-intel-xe-hwmon
+++ b/Documentation/ABI/testing/sysfs-driver-intel-xe-hwmon
@@ -20,3 +20,29 @@ Description: RO. Card default power limit (default TDP setting).
Only supported for particular Intel xe graphics platforms.
+What: /sys/devices/.../hwmon/hwmon<i>/power1_crit
+Date: August 2023
+KernelVersion: 6.4
+Contact: intel-xe@xxxxxxxxxxxxxxxxxxxxx
+Description: RW. Card reactive critical (I1) power limit in microwatts.
+
+ Card reactive critical (I1) power limit in microwatts is exposed
+ for client products. The power controller will throttle the
+ operating frequency if the power averaged over a window exceeds
+ this limit.
+
+ Only supported for particular Intel xe graphics platforms.
+
+What: /sys/devices/.../hwmon/hwmon<i>/curr1_crit
+Date: August 2023
+KernelVersion: 6.4
+Contact: intel-xe@xxxxxxxxxxxxxxxxxxxxx
+Description: RW. Card reactive critical (I1) power limit in milliamperes.
+
+ Card reactive critical (I1) power limit in milliamperes is
+ exposed for server products. The power controller will throttle
+ the operating frequency if the power averaged over a window
+ exceeds this limit.
+
+ Only supported for particular Intel xe graphics platforms.
+
diff --git a/drivers/gpu/drm/xe/xe_hwmon.c b/drivers/gpu/drm/xe/xe_hwmon.c
index ce8dac2168f6..ceab142f6d42 100644
--- a/drivers/gpu/drm/xe/xe_hwmon.c
+++ b/drivers/gpu/drm/xe/xe_hwmon.c
@@ -12,6 +12,8 @@
#include "xe_hwmon.h"
#include "xe_mmio.h"
#include "xe_gt.h"
+#include "xe_pcode.h"
+#include "xe_pcode_api.h"
enum hwmon_reg_name {
REG_PKG_RAPL_LIMIT,
@@ -28,8 +30,10 @@ enum hwmon_reg_operation {
/*
* SF_* - scale factors for particular quantities according to hwmon spec.
* - power - microwatts
+ * - curr - milliamperes
Ah... it's a table...
*/
#define SF_POWER 1000000
+#define SF_CURR 1000
... you could add it on the side
#define SF_POWER 1000000 /* microwatt */
#define SF_CURR 1000 /* milliamperes */
The rest looks good
Sure, will take this in next revision.
Regards,
Badal
Andi