summaryrefslogtreecommitdiff
path: root/arch/x86/events/amd/ibs.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2019-09-05 11:40:54 +0200
committerLinus Walleij <linus.walleij@linaro.org>2019-09-05 11:40:54 +0200
commit151a41014bff92f353263cadc051435dc9c3258e (patch)
treeaa082a0745edd5b7051668f455dfc0ee1e4a9de0 /arch/x86/events/amd/ibs.c
parentae0755b56da9db4190288155ea884331993ed51b (diff)
parent089cf7f6ecb266b6a4164919a2e69bd2f938374a (diff)
Merge tag 'v5.3-rc7' into devel
Linux 5.3-rc7
Diffstat (limited to 'arch/x86/events/amd/ibs.c')
-rw-r--r--arch/x86/events/amd/ibs.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/arch/x86/events/amd/ibs.c b/arch/x86/events/amd/ibs.c
index 62f317c9113a..5b35b7ea5d72 100644
--- a/arch/x86/events/amd/ibs.c
+++ b/arch/x86/events/amd/ibs.c
@@ -661,10 +661,17 @@ fail:
throttle = perf_event_overflow(event, &data, &regs);
out:
- if (throttle)
+ if (throttle) {
perf_ibs_stop(event, 0);
- else
- perf_ibs_enable_event(perf_ibs, hwc, period >> 4);
+ } else {
+ period >>= 4;
+
+ if ((ibs_caps & IBS_CAPS_RDWROPCNT) &&
+ (*config & IBS_OP_CNT_CTL))
+ period |= *config & IBS_OP_CUR_CNT_RAND;
+
+ perf_ibs_enable_event(perf_ibs, hwc, period);
+ }
perf_event_update_userpage(event);