summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarthik Poosa <karthik.poosa@intel.com>2024-08-27 21:23:01 +0530
committerRodrigo Vivi <rodrigo.vivi@intel.com>2024-08-28 14:59:26 -0400
commita7f657097e96d8fa745c74bb1a239ebd5a8c971c (patch)
tree91043efb7519cdf6970b29eb5bd3aed05a2c9cf3
parentaeb4ae66cb50faddf60be9297d0d5d392aacdd3e (diff)
downloadlinux-a7f657097e96d8fa745c74bb1a239ebd5a8c971c.tar.gz
linux-a7f657097e96d8fa745c74bb1a239ebd5a8c971c.tar.bz2
linux-a7f657097e96d8fa745c74bb1a239ebd5a8c971c.zip
drm/xe/hwmon: Fix WRITE_I1 param from u32 to u16
WRITE_I1 sub-command of the POWER_SETUP pcode command accepts a u16 parameter instead of u32. This change prevents potential illegal sub-command errors. v2: Mask uval instead of changing the prototype. (Badal) v3: Rephrase commit message. (Badal) Signed-off-by: Karthik Poosa <karthik.poosa@intel.com> Fixes: 92d44a422d0d ("drm/xe/hwmon: Expose card reactive critical power") Reviewed-by: Badal Nilawar <badal.nilawar@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240827155301.183383-1-karthik.poosa@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
-rw-r--r--drivers/gpu/drm/xe/xe_hwmon.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/xe/xe_hwmon.c b/drivers/gpu/drm/xe/xe_hwmon.c
index 832ea81faeee..1faeca70900e 100644
--- a/drivers/gpu/drm/xe/xe_hwmon.c
+++ b/drivers/gpu/drm/xe/xe_hwmon.c
@@ -450,7 +450,7 @@ static int xe_hwmon_pcode_write_i1(struct xe_gt *gt, u32 uval)
{
return xe_pcode_write(gt, PCODE_MBOX(PCODE_POWER_SETUP,
POWER_SETUP_SUBCOMMAND_WRITE_I1, 0),
- uval);
+ (uval & POWER_SETUP_I1_DATA_MASK));
}
static int xe_hwmon_power_curr_crit_read(struct xe_hwmon *hwmon, int channel,