Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/xe/hwmon: Remove unwanted write permission for currN_label

Change umode of currN_label from 0644 to 0444 as write permission
not needed for label.

Signed-off-by: Karthik Poosa <karthik.poosa@intel.com>
Reviewed-by: Riana Tauro <riana.tauro@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240419125945.4085629-1-karthik.poosa@intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

authored by

Karthik Poosa and committed by
Rodrigo Vivi
515f0897 205e5c4b

+7 -2
+7 -2
drivers/gpu/drm/xe/xe_hwmon.c
··· 550 550 { 551 551 u32 uval; 552 552 553 + /* hwmon sysfs attribute of current available only for package */ 554 + if (channel != CHANNEL_PKG) 555 + return 0; 556 + 553 557 switch (attr) { 554 558 case hwmon_curr_crit: 555 - case hwmon_curr_label: 556 - if (channel == CHANNEL_PKG) 557 559 return (xe_hwmon_pcode_read_i1(hwmon->gt, &uval) || 558 560 (uval & POWER_SETUP_I1_WATTS)) ? 0 : 0644; 561 + case hwmon_curr_label: 562 + return (xe_hwmon_pcode_read_i1(hwmon->gt, &uval) || 563 + (uval & POWER_SETUP_I1_WATTS)) ? 0 : 0444; 559 564 break; 560 565 default: 561 566 return 0;