Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/xe/hwmon: Remove unwanted write permission for currN_label
@ 2024-04-19 12:59 Karthik Poosa
  2024-04-19 13:25 ` ✓ CI.Patch_applied: success for " Patchwork
                   ` (24 more replies)
  0 siblings, 25 replies; 27+ messages in thread
From: Karthik Poosa @ 2024-04-19 12:59 UTC (permalink / raw)
  To: intel-xe
  Cc: anshuman.gupta, badal.nilawar, rodrigo.vivi, lucas.demarchi,
	Karthik Poosa

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>
---
 drivers/gpu/drm/xe/xe_hwmon.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_hwmon.c b/drivers/gpu/drm/xe/xe_hwmon.c
index 453e601ddd5e..dca275117232 100644
--- a/drivers/gpu/drm/xe/xe_hwmon.c
+++ b/drivers/gpu/drm/xe/xe_hwmon.c
@@ -550,12 +550,17 @@ xe_hwmon_curr_is_visible(const struct xe_hwmon *hwmon, u32 attr, int channel)
 {
 	u32 uval;
 
+	/* hwmon sysfs attribute of current available only for package */
+	if (channel != CHANNEL_PKG)
+		return 0;
+
 	switch (attr) {
 	case hwmon_curr_crit:
-	case hwmon_curr_label:
-		if (channel == CHANNEL_PKG)
 			return (xe_hwmon_pcode_read_i1(hwmon->gt, &uval) ||
 				(uval & POWER_SETUP_I1_WATTS)) ? 0 : 0644;
+	case hwmon_curr_label:
+			return (xe_hwmon_pcode_read_i1(hwmon->gt, &uval) ||
+				(uval & POWER_SETUP_I1_WATTS)) ? 0 : 0444;
 		break;
 	default:
 		return 0;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2024-04-23 20:49 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-19 12:59 [PATCH] drm/xe/hwmon: Remove unwanted write permission for currN_label Karthik Poosa
2024-04-19 13:25 ` ✓ CI.Patch_applied: success for " Patchwork
2024-04-19 13:26 ` ✓ CI.checkpatch: " Patchwork
2024-04-19 13:27 ` ✓ CI.KUnit: " Patchwork
2024-04-19 13:44 ` ✓ CI.Build: " Patchwork
2024-04-19 13:46 ` ✓ CI.Hooks: " Patchwork
2024-04-19 13:48 ` ✓ CI.checksparse: " Patchwork
2024-04-19 14:25 ` [PATCH] " Riana Tauro
2024-04-22 19:28   ` Rodrigo Vivi
2024-04-19 14:46 ` ✗ CI.BAT: failure for " Patchwork
2024-04-19 21:27 ` ✓ CI.Patch_applied: success for drm/xe/hwmon: Remove unwanted write permission for currN_label (rev2) Patchwork
2024-04-19 21:30 ` ✓ CI.checkpatch: " Patchwork
2024-04-19 21:34 ` ✓ CI.KUnit: " Patchwork
2024-04-19 21:47 ` ✓ CI.Build: " Patchwork
2024-04-19 21:52 ` ✓ CI.Hooks: " Patchwork
2024-04-19 21:56 ` ✓ CI.checksparse: " Patchwork
2024-04-19 22:41 ` ✗ CI.BAT: failure " Patchwork
2024-04-21  5:13 ` ✗ CI.FULL: failure for drm/xe/hwmon: Remove unwanted write permission for currN_label Patchwork
2024-04-21 15:28 ` ✗ CI.FULL: failure for drm/xe/hwmon: Remove unwanted write permission for currN_label (rev2) Patchwork
2024-04-23 12:59 ` ✓ CI.Patch_applied: success for drm/xe/hwmon: Remove unwanted write permission for currN_label (rev3) Patchwork
2024-04-23 13:00 ` ✓ CI.checkpatch: " Patchwork
2024-04-23 13:01 ` ✓ CI.KUnit: " Patchwork
2024-04-23 13:13 ` ✓ CI.Build: " Patchwork
2024-04-23 13:15 ` ✓ CI.Hooks: " Patchwork
2024-04-23 13:17 ` ✓ CI.checksparse: " Patchwork
2024-04-23 13:41 ` ✓ CI.BAT: " Patchwork
2024-04-23 20:49 ` ✗ CI.FULL: failure " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox