Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1110150rwd; Thu, 15 Jun 2023 06:33:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7famPGZ5JMXZ1/bi+h2ZKAlLtrm4rwuMuAytT94Bqkw8k80tHy4wg2GT0/BE8gSgN9oXvo X-Received: by 2002:a05:6e02:806:b0:33f:dfd1:fe56 with SMTP id u6-20020a056e02080600b0033fdfd1fe56mr12538066ilm.7.1686835995353; Thu, 15 Jun 2023 06:33:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686835995; cv=none; d=google.com; s=arc-20160816; b=BtV80dZozkOjnAtmqaNWEBJm6+g2Ex3Hmk1ZHAWRyv272Ihzyve7HitDuKEjKvNNTf s4t/2vefX9EpvN3vWSlAZWtOJC9Z2y6E2FOixR83dtI4Tz+pyJlD1JI2fo3uvQ5nrBVE +tgNhgcvTzm1eAdIRcPMdMImK17RhYbvrc92jSjmrSaV4C2NXEXwQoegXWfJmY0S7PWd lJxmCa7RlQEepooIYeidwfyIkEkt47y1MnGe5Q+mFqxrPY/ZJ+MB1GIuwoI4cR9UitVR O6LmJYaJEhVNqqXDfD1br8n68Ats0QNfM6MCriEmBkB1Vb5rLst56+6OByQORdkMD9fy CGTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=sQHRkU9W+9/jVyIDMYZgXz8sS8Dn3bzHxep7RIBKUco=; b=Jw46f7XqWgTML3inl778ZwTlbCASvexknw4GMXwKHj9M/iaJ5hmYqxDA6ScNARapPY WiQBXhIMLEBSxgDjr3GIXPoOAvNGh2hQNqokcP8PD0C2KAzBG+/WCjQ7oF4BVhDEjp8e D7Cs2td0Bk79jk7OU8i50qoPxO4uK0LMhbj6gCeflrWwBp2I826Du7+Vx4+EKkGADgHT +3oO9T8/y+0bD4KCu53tC2VoVULYShu9DFTOuPVP7RAqnz8Q4TTlZP2KTeQK5zkpwoh9 vCwccmIb3IOOTKXbsGK4PQP0bEmVNflXpQcopCk1rNhln07f7980YTgfEjzW5vEd83f/ lQ5A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w21-20020a637b15000000b0054fe4986365si2301545pgc.343.2023.06.15.06.33.01; Thu, 15 Jun 2023 06:33:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343803AbjFONOY (ORCPT + 99 others); Thu, 15 Jun 2023 09:14:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343746AbjFONN7 (ORCPT ); Thu, 15 Jun 2023 09:13:59 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE1A22716 for ; Thu, 15 Jun 2023 06:13:41 -0700 (PDT) Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q9mmu-00050K-6d; Thu, 15 Jun 2023 15:13:20 +0200 Received: from sha by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1q9mmq-0001mi-I2; Thu, 15 Jun 2023 15:13:16 +0200 Date: Thu, 15 Jun 2023 15:13:16 +0200 From: Sascha Hauer To: linux-rockchip@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Heiko Stuebner , Kyungmin Park , MyungJoo Ham , Will Deacon , Mark Rutland , kernel@pengutronix.de, Michael Riesch , Robin Murphy , Vincent Legoll , Rob Herring , Krzysztof Kozlowski , Conor Dooley , devicetree@vger.kernel.org, Sebastian Reichel Subject: Re: [PATCH v5 16/25] PM / devfreq: rockchip-dfi: Add perf support Message-ID: <20230615131316.GF15436@pengutronix.de> References: <20230524083153.2046084-1-s.hauer@pengutronix.de> <20230524083153.2046084-17-s.hauer@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230524083153.2046084-17-s.hauer@pengutronix.de> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 |