Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753556AbdFVS3N (ORCPT ); Thu, 22 Jun 2017 14:29:13 -0400 Received: from mail-yw0-f178.google.com ([209.85.161.178]:36172 "EHLO mail-yw0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753493AbdFVS3M (ORCPT ); Thu, 22 Jun 2017 14:29:12 -0400 MIME-Version: 1.0 In-Reply-To: <20170622181749.GF25967@leverpostej> References: <1496772146-11084-1-git-send-email-hotran@apm.com> <1496772146-11084-4-git-send-email-hotran@apm.com> <20170622175255.GD25967@leverpostej> <20170622181749.GF25967@leverpostej> From: Hoan Tran Date: Thu, 22 Jun 2017 11:29:10 -0700 Message-ID: Subject: Re: [PATCH v3 3/3] perf: xgene: Add support for SoC PMU version 3 To: Mark Rutland Cc: Will Deacon , Jonathan Corbet , Tai Nguyen , linux-arm-kernel@lists.infradead.org, lkml , linux-doc@vger.kernel.org, Loc Ho Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1362 Lines: 38 On Thu, Jun 22, 2017 at 11:17 AM, Mark Rutland wrote: > On Thu, Jun 22, 2017 at 11:13:08AM -0700, Hoan Tran wrote: >> On Thu, Jun 22, 2017 at 10:52 AM, Mark Rutland wrote: >> > On Tue, Jun 06, 2017 at 11:02:26AM -0700, Hoan Tran wrote: >> > > static inline void >> > > +xgene_pmu_write_counter64(struct xgene_pmu_dev *pmu_dev, int idx, u64 val) >> > > +{ >> > > + u32 cnt_lo, cnt_hi; >> > > + >> > > + cnt_hi = upper_32_bits(val); >> > > + cnt_lo = lower_32_bits(val); >> > > + >> > > + /* v3 has 64-bit counter registers composed by 2 32-bit registers */ >> > > + xgene_pmu_write_counter32(pmu_dev, 2 * idx, cnt_lo); >> > > + xgene_pmu_write_counter32(pmu_dev, 2 * idx + 1, cnt_hi); >> > > +} >> > >> > For this to be atomic, we need to disable the counters for the duration >> > of the IRQ handler, which we don't do today. >> > >> > Regardless, we should do that to ensure that groups are self-consistent. >> > >> > i.e. in xgene_pmu_isr() we should call ops->stop_counters() just after >> > taking the pmu lock, and we should call ops->start_counters() just >> > before releasing it. >> >> Thanks for your comments. I'll fix them and send another version of >> patch set soon. > > No need; I'm picking these up now, and I'll apply the fixups locally. Thanks! Hoan > > Thanks, > Mark.