Skip to content

Commit 17d52ab

Browse files
raagjadavThomas Hellström
authored andcommitted
drm/xe/throttle: Skip reason prefix while emitting array
The newly introduced "reasons" attribute already signifies possible reasons for throttling and makes the prefix in individual attribute names redundant while emitting them as an array. Skip the prefix. Fixes: 83ccde6 ("drm/xe/gt_throttle: Avoid TOCTOU when monitoring reasons") Signed-off-by: Raag Jadav <raag.jadav@intel.com> Reviewed-by: Sk Anirban <sk.anirban@intel.com> Link: https://patch.msgid.link/20251203123355.571606-1-raag.jadav@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> (cherry picked from commit b64a143) Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
1 parent 9acc329 commit 17d52ab

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/gpu/drm/xe/xe_gt_throttle.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ static ssize_t reasons_show(struct kobject *kobj,
140140
struct throttle_attribute *other_ta = kobj_attribute_to_throttle(kattr);
141141

142142
if (other_ta->mask != U32_MAX && reasons & other_ta->mask)
143-
ret += sysfs_emit_at(buff, ret, "%s ", (*pother)->name);
143+
ret += sysfs_emit_at(buff, ret, "%s ", (*pother)->name + strlen("reason_"));
144144
}
145145

146146
if (drm_WARN_ONCE(&xe->drm, !ret, "Unknown reason: %#x\n", reasons))

0 commit comments

Comments
 (0)