From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752795AbcHQKFc (ORCPT ); Wed, 17 Aug 2016 06:05:32 -0400 Received: from foss.arm.com ([217.140.101.70]:51673 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751752AbcHQKFa (ORCPT ); Wed, 17 Aug 2016 06:05:30 -0400 Date: Wed, 17 Aug 2016 11:04:25 +0100 From: Mark Rutland To: Zhengyu Shen Cc: "shawnguo@kernel.org" , "peterz@infradead.org" , Frank Li , "linux-kernel@vger.kernel.org" , "acme@kernel.org" , "alexander.shishkin@linux.intel.com" , "mingo@redhat.com" , "lznuaa@gmail.com" , "linux-arm-kernel@lists.infradead.org" Subject: Re: [PATCH v2] Added perf functionality to mmdc driver Message-ID: <20160817100425.GB30900@leverpostej> References: <20160815223035.5429-1-zhengyu.shen@nxp.com> <20160815165050.GB31080@svinekod> <20160815194945.GB1120@svinekod> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 16, 2016 at 08:40:08PM +0000, Zhengyu Shen wrote: > > > > > + hrtimer_start(&pmu_mmdc->hrtimer, mmdc_timer_period(), > > > > > + HRTIMER_MODE_REL_PINNED); > > > > > > > > Why is a hrtimer necessary? Is this just copy-pasted from CCN, or do > > > > you have similar HW issues? > > > > > > > > Is there no overflow interrupt? > > > > > > When overflow occurs, a register bit is set to one. There is no > > > overflow interrupt which is why the timer is needed. > > > > I see. Please have add comment in the driver explaining this, so that this is > > obvious. > > > > Does the counter itself wrap and continue counting, or does it saturate? > > > > How have you tuned your polling period so as to avoid missing events in the > > case of an overflow? > > > > Thanks, > > Mark. > The counter wraps around once every ten seconds for total-cycles (which is the > Fastest increasing counter). Polling is done every one second just to be safe. Ok. It would be worth noting this with a comment next to either the hrtimer handler or registration thereof. I assume that on overflow the counter wraps rather than saturating? Thanks, Mark.