Thread (57 messages) 57 messages, 5 authors, 2023-06-15

Re: [PATCH v5 16/25] PM / devfreq: rockchip-dfi: Add perf support

From: Sascha Hauer <s.hauer@pengutronix.de>
Date: 2023-06-15 13:14:28
Also in: linux-devicetree, linux-pm, linux-rockchip, lkml

On Wed, May 24, 2023 at 10:31:44AM +0200, Sascha Hauer wrote:
+static int rockchip_ddr_perf_event_add(struct perf_event *event, int flags)
+{
+	struct rockchip_dfi *dfi = container_of(event->pmu, struct rockchip_dfi, pmu);
+
+	dfi->active_events++;
+
+	if (dfi->active_events == 1)
We need to initialize dfi->last_perf_count here:

		rockchip_dfi_read_counters(dfi, &dfi->last_perf_count);

dfi->last_perf_count contains the start values for the counters and
without initializing this the u32 counter overflows are not correctly
handled.

Sascha


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help