Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1338705yba; Thu, 4 Apr 2019 08:49:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqw7ptNfPQlvVh6wpCJNV4YBhQlsI1jrlEORNKZi+rC1C5HLto85xI0U6ICfAEqCw0bRNVd5 X-Received: by 2002:a17:902:2989:: with SMTP id h9mr7294922plb.26.1554392999023; Thu, 04 Apr 2019 08:49:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554392999; cv=none; d=google.com; s=arc-20160816; b=npX5pdaA9hMykcjNmPKAUdrb4hWczCQ9JpUZk624oXiNzGMCCDwAzK7dEXPw2k6DgU 7qeZDwcqnZ/7IKtrXMZoxn1V94FuddUYy/BMYR5uCO3hpe1o66TocFV08fu4hfJNNg4Y 8E7xbumNb4kXTecLfrAck2wRVn8fdlBSyExBYGKe0z3u5KUF+8JeAu2ufh6vT5jTcC2P sz8U6Q9PvPMOEzgU9ZMBo9BY7cB3HcU+ydiLjRCng4l1uVZHoOwtNSxDEmktzXjNGQDW IGX38TTmnLXUjpaY92Og8Z7jSL7MItliHdPVbiJrHs1mMkppFJ2MCnc2OKhPBX+6kxbf jWbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=FplwQeDpq9+fGZp2EusHVpf4BemKmyeY3nA/aHFtmT8=; b=ooCvXC4k03nXvHUb9jIdS14f5gWu21ROQxNuyaY3b5blRW077vsx1vVZbYoI7Q+C82 ITRpUnrOdCtM2jt1bzXD9xQQwsjcd4YIncyCi1eemNWruS+QsUq6RKRXTS+RAgwSa+bC F0XcSKO93xmQEN1j+un2uvA31BbwFXaS0FUY4JpsjmMtkUWdmn05gBdj0qXx8ZD59C1b LQiv3Mc+mdj8+olLzdc3D36YXP4XHrIVLJd9p4DZwiw7H9nRKv17e3bj4/n8oPNo8oF7 nNTN0hy2rBNoh42uR87vhbv2cGhVlEotxU3g+zYFLI+tSsh9iHE/t4qzRpdffhEkm5o4 UU4Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g123si17713234pfb.24.2019.04.04.08.49.43; Thu, 04 Apr 2019 08:49:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728919AbfDDPrT (ORCPT + 99 others); Thu, 4 Apr 2019 11:47:19 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:34548 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727398AbfDDPrT (ORCPT ); Thu, 4 Apr 2019 11:47:19 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8569A169E; Thu, 4 Apr 2019 08:47:18 -0700 (PDT) Received: from fuggles.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D6FB43F59C; Thu, 4 Apr 2019 08:47:15 -0700 (PDT) Date: Thu, 4 Apr 2019 16:47:11 +0100 From: Will Deacon To: Shameer Kolothum Cc: lorenzo.pieralisi@arm.com, robin.murphy@arm.com, andrew.murray@arm.com, jean-philippe.brucker@arm.com, mark.rutland@arm.com, guohanjun@huawei.com, john.garry@huawei.com, pabba@codeaurora.org, vkilari@codeaurora.org, rruigrok@codeaurora.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxarm@huawei.com, neil.m.leeder@gmail.com Subject: Re: [PATCH v7 4/4] perf/smmuv3: Enable HiSilicon Erratum 162001800 quirk Message-ID: <20190404154711.GA27577@fuggles.cambridge.arm.com> References: <20190326151753.19384-1-shameerali.kolothum.thodi@huawei.com> <20190326151753.19384-5-shameerali.kolothum.thodi@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190326151753.19384-5-shameerali.kolothum.thodi@huawei.com> User-Agent: Mutt/1.11.1+86 (6f28e57d73f2) () Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 26, 2019 at 03:17:53PM +0000, Shameer Kolothum wrote: > HiSilicon erratum 162001800 describes the limitation of > SMMUv3 PMCG implementation on HiSilicon Hip08 platforms. > > On these platforms, the PMCG event counter registers > (SMMU_PMCG_EVCNTRn) are read only and as a result it > is not possible to set the initial counter period value > on event monitor start. > > To work around this, the current value of the counter > is read and used for delta calculations. OEM information > from ACPI header is used to identify the affected hardware > platforms. > > Signed-off-by: Shameer Kolothum > Reviewed-by: Hanjun Guo > Reviewed-by: Robin Murphy > --- > drivers/acpi/arm64/iort.c | 16 ++++++++++++++- > drivers/perf/arm_smmuv3_pmu.c | 48 ++++++++++++++++++++++++++++++++++++------- > include/linux/acpi_iort.h | 1 + > 3 files changed, 57 insertions(+), 8 deletions(-) > > diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c > index e2c9b26..4dc68de 100644 > --- a/drivers/acpi/arm64/iort.c > +++ b/drivers/acpi/arm64/iort.c > @@ -1366,9 +1366,23 @@ static void __init arm_smmu_v3_pmcg_init_resources(struct resource *res, > ACPI_EDGE_SENSITIVE, &res[2]); > } > > +static struct acpi_platform_list pmcg_plat_info[] __initdata = { > + /* HiSilicon Hip08 Platform */ > + {"HISI ", "HIP08 ", 0, ACPI_SIG_IORT, greater_than_or_equal, 0, Passing integer constant 0 for the reason feels wrong to me. I'm going to change it to "Erratum #162001800" and also add an entry to silicon-errata.txt. Please shout if that's not ok. Will