Merge "drivers: soc: qcom: fix underflow in read_event"

This commit is contained in:
qctecmdr 2021-10-06 20:43:22 -07:00 • committed by Gerrit - the friendly Code Review server
commit 559734fe35
2 changed files with 9 additions and 5 deletions

View file

@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2014-2020, The Linux Foundation. All rights reserved.
* Copyright (c) 2014-2021, The Linux Foundation. All rights reserved.
*/
#define pr_fmt(fmt) "arm-memlat-mon: " fmt
@ -174,11 +174,13 @@ static inline void read_event(struct event_data *event)
return;
if (!per_cpu(cpu_is_idle, event->pevent->cpu) &&
!per_cpu(cpu_is_hp, event->pevent->cpu))
!per_cpu(cpu_is_hp, event->pevent->cpu)) {
total = perf_event_read_value(event->pevent, &enabled,
&running);
else
event->cached_total_count = total;
} else {
total = event->cached_total_count;
}
event->last_delta = total - event->prev_count;
event->prev_count = total;
}

View file

@ -560,10 +560,12 @@ static inline void msm_perf_read_event(struct event_data *event)
}
if (!per_cpu(cpu_is_idle, event->pevent->cpu) &&
!per_cpu(cpu_is_hp, event->pevent->cpu))
!per_cpu(cpu_is_hp, event->pevent->cpu)) {
total = perf_event_read_value(event->pevent, &enabled, &running);
else
event->cached_total_count = total;
} else {
total = event->cached_total_count;
}
ev_count = total - event->prev_count;
event->prev_count = total;