summaryrefslogtreecommitdiff
path: root/tools/perf/scripts
diff options
context:
space:
mode:
authorYang Wang <kevinyang.wang@amd.com>2026-07-23 23:18:33 +0800
committerAlex Deucher <alexander.deucher@amd.com>2026-07-28 20:00:06 -0400
commit048f4541b71fb19645fb79d6e62e6e4da23a4035 (patch)
tree471f4ddce41b736afcc17730daff5f4b3cf0074f /tools/perf/scripts
parentbb493058c35c8676e48269ab6732688ea733d23c (diff)
drm/amd/pm: fix torn gpu metrics reads
amdgpu_dpm_get_gpu_metrics() returns a pointer to the shared metrics cache after dropping adev->pm.mutex. The sysfs path then copies from that pointer. Another reader can refresh the cache in place during the copy and return a snapshot containing data from two generations. Pass caller-provided storage through the DPM interface and copy the metrics while the mutex is held. This keeps the cache pointer private and makes each sysfs read observe one complete sample. Fixes: 25c933b1c4fc ("drm/amd/powerplay: add new sysfs interface for retrieving gpu metrics(V2)") Signed-off-by: Yang Wang <kevinyang.wang@amd.com> Reviewed-by: Kenneth Feng <kenneth.feng@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit 862333bb48693ecafcae25af0c9d9ec31015ac77) Cc: stable@vger.kernel.org
Diffstat (limited to 'tools/perf/scripts')
0 files changed, 0 insertions, 0 deletions