Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 559734fe authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

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

parents a0112284 4e1ccaa4
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
// 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;
}
+4 −2
Original line number Diff line number Diff line
@@ -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;