aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c
diff options
context:
space:
mode:
authorThomas Zimmermann <[email protected]>2023-10-11 07:50:59 +0000
committerThomas Zimmermann <[email protected]>2023-10-11 07:50:59 +0000
commit57390019b68b83f96eb98f490367b9df1f2d77cb (patch)
treee6d4b6c75efdd2d7fb7d37f980688c491be3ff6a /drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c
parentdrm/panel: ltk050h3146w: add support for Leadtek LTK050H3148W-CTA6 variant (diff)
parentMerge tag 'drm-intel-next-2023-09-29' of git://anongit.freedesktop.org/drm/dr... (diff)
downloadkernel-57390019b68b83f96eb98f490367b9df1f2d77cb.tar.gz
kernel-57390019b68b83f96eb98f490367b9df1f2d77cb.zip
Merge drm/drm-next into drm-misc-next
Updating drm-misc-next to the state of Linux v6.6-rc2. Signed-off-by: Thomas Zimmermann <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c
index 71ee361d0972..6e91ea1de5aa 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c
@@ -276,9 +276,8 @@ static void amdgpu_perf_read(struct perf_event *event)
(!pe->adev->df.funcs->pmc_get_count))
return;
+ prev = local64_read(&hwc->prev_count);
do {
- prev = local64_read(&hwc->prev_count);
-
switch (hwc->config_base) {
case AMDGPU_PMU_EVENT_CONFIG_TYPE_DF:
case AMDGPU_PMU_EVENT_CONFIG_TYPE_XGMI:
@@ -289,7 +288,7 @@ static void amdgpu_perf_read(struct perf_event *event)
count = 0;
break;
}
- } while (local64_cmpxchg(&hwc->prev_count, prev, count) != prev);
+ } while (!local64_try_cmpxchg(&hwc->prev_count, &prev, count));
local64_add(count - prev, &event->count);
}