]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/xe/hwmon: Fix xe_hwmon_power_max_write
authorKarthik Poosa <karthik.poosa@intel.com>
Tue, 17 Jun 2025 12:00:30 +0000 (17:30 +0530)
committerThomas Hellström <thomas.hellstrom@linux.intel.com>
Tue, 24 Jun 2025 18:18:31 +0000 (20:18 +0200)
commit9127a69c7193ad47047ff968a2de9161d5c93d37
tree5b322f383d7e777cbdecac20f3bc45313ecb91cb
parent62207293479e6c03ef498a70f2914c51f4d31d2c
drm/xe/hwmon: Fix xe_hwmon_power_max_write

Prevent other bits of mailbox power limit from being overwritten with 0.
This issue was due to a missing read and modify of current power limit,
before setting a requested mailbox power limit, which is added in this
patch.

v2:
 - Improve commit message. (Anshuman)

v3:
 - Rebase.
 - Rephrase commit message. (Riana)
 - Add read-modify-write variant of xe_hwmon_pcode_write_power_limit()
   i.e. xe_hwmon_pcode_rmw_power_limit(). (Badal)
 - Use xe_hwmon_pcode_rmw_power_limit() to set mailbox power limits.
 - Remove xe_hwmon_pcode_write_power_limit() as all mailbox power limits
   writes use xe_hwmon_pcode_rmw_power_limit() only.

v4:
 - Use PWR_LIM in place of (PWR_LIM_EN | PWR_LIM_VAL) wherever
   applicable. (Riana)

Fixes: 25a2aa779fc3 ("drm/xe/hwmon: Add support to manage power limits though mailbox")
Reviewed-by: Riana Tauro <riana.tauro@intel.com>
Signed-off-by: Karthik Poosa <karthik.poosa@intel.com>
Reviewed-by: Badal Nilawar <badal.nilawar@intel.com>
Link: https://lore.kernel.org/r/20250617120030.612819-1-karthik.poosa@intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
(cherry picked from commit 8aa7306631f088881759398972d503757cf0c901)
Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
drivers/gpu/drm/xe/regs/xe_mchbar_regs.h
drivers/gpu/drm/xe/xe_hwmon.c