lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 15 Jun 2023 15:13:16 +0200
From:   Sascha Hauer <s.hauer@...gutronix.de>
To:     linux-rockchip@...ts.infradead.org
Cc:     linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        linux-pm@...r.kernel.org, Heiko Stuebner <heiko@...ech.de>,
        Kyungmin Park <kyungmin.park@...sung.com>,
        MyungJoo Ham <myungjoo.ham@...sung.com>,
        Will Deacon <will@...nel.org>,
        Mark Rutland <mark.rutland@....com>, kernel@...gutronix.de,
        Michael Riesch <michael.riesch@...fvision.net>,
        Robin Murphy <robin.murphy@....com>,
        Vincent Legoll <vincent.legoll@...il.com>,
        Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        Conor Dooley <conor+dt@...nel.org>, devicetree@...r.kernel.org,
        Sebastian Reichel <sebastian.reichel@...labora.com>
Subject: Re: [PATCH v5 16/25] PM / devfreq: rockchip-dfi: Add perf support

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 |

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ