]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/xe: Add locks in gtidle code
authorVinay Belgaumkar <vinay.belgaumkar@intel.com>
Fri, 10 Jan 2025 17:33:09 +0000 (09:33 -0800)
committerLucas De Marchi <lucas.demarchi@intel.com>
Tue, 14 Jan 2025 15:02:49 +0000 (07:02 -0800)
commitd160dc6f53914d729be7fcb7afbd0e9e6a3725b2
treeb3acd458fe46202a3d34fe7e30591d0bfaef094b
parentc26f22dac3449d8a687237cdfc59a6445eb8f75a
drm/xe: Add locks in gtidle code

The update of the residency values needs to be protected by a lock to
avoid multiple entrypoints, for example when multiple userspace clients
read the sysfs file. Other in-kernel clients are going to be added to
sample these values, making the problem worse. Protect those updates
with a raw_spinlock so it can be called by future integration with perf
pmu.

Suggested-by: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250110173308.2412232-2-lucas.demarchi@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
drivers/gpu/drm/xe/xe_gt_idle.c
drivers/gpu/drm/xe/xe_gt_idle.h
drivers/gpu/drm/xe/xe_gt_idle_types.h