Received: by 10.223.185.111 with SMTP id b44csp321406wrg; Fri, 9 Mar 2018 05:37:46 -0800 (PST) X-Google-Smtp-Source: AG47ELs1Fzs6+w33FRjjFi4TVLskfmTNH/+Y/spagx2qOUiUOvLA/H2Ol66Gsu46zsPGXot/20hF X-Received: by 10.98.117.139 with SMTP id q133mr29893126pfc.64.1520602666701; Fri, 09 Mar 2018 05:37:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520602666; cv=none; d=google.com; s=arc-20160816; b=RciDvIok6LSCw7nn9A4L3yijb8IMQfHASMf0dNKoZwj8fJEZrQytylu/eOeb7/qjY3 P4MUZ0/76/I8BG6ocZVL/aUtoIdqJKt7x0iig1JTo7tcePl4C2eciaCYcnnbtoMXv6k+ ZO1X50ZeQEV5ArsJq0N8MwM+8IR0PWgsWAFoNuDSg8BbO2/X/VeLKB/Yt0kNl1SxhuAJ KCx7VjFf2ozgBpyzUGDj581B+aaRt+j1Esm0wfs4Aam3MqnizcjxhE/6Y6OWYYjfxq6u slkzs458FzZ/x2s7slRBYsoSoOa1+rYJwUQ0e4+R+URxUV+QznndZkpi7RqC4B8l6smL c3lg== 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:arc-authentication-results; bh=uqZDC3+o4IdBRWhMi3RVP9w1fx9nUxgX/rFOBb5jnTI=; b=oLZ3ZNKyks1vbPWNjUJIpMrSGK6IGaza7qyxZP83iQOJEWQABIJ2jbGoHKGIGrnuOg sEU2hookyplm8rHYHG37bgRGMX0jktvahvA017LZ3GCvykPIDNcZi1etl0EWuBRQMnE3 fFKbBlTFV6sPigriF7vq+24fDEVfnrQNruW07UcuhtMO0pHzpyh9HJtMxYfrL0ELC4pV lWswYB+pxob3kMo+jdw9e+49WrUpITi/S/NuNxAUuR32YgXNmaS6CpmHa8I5jW5iTIfN RHL9J9YQLEB0lAbOFTGZWhXS0bJsS5CFZpwkfktVyO+4gxdFXK++1gSSa9NiFMtPqoiZ z3sw== 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 q7si758114pgn.559.2018.03.09.05.37.29; Fri, 09 Mar 2018 05:37:46 -0800 (PST) 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 S932200AbeCINfm (ORCPT + 99 others); Fri, 9 Mar 2018 08:35:42 -0500 Received: from foss.arm.com ([217.140.101.70]:51730 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751096AbeCINfl (ORCPT ); Fri, 9 Mar 2018 08:35:41 -0500 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 990D61529; Fri, 9 Mar 2018 05:35:40 -0800 (PST) Received: from lakrids.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 C7DEC3F25C; Fri, 9 Mar 2018 05:35:37 -0800 (PST) Date: Fri, 9 Mar 2018 13:35:32 +0000 From: Mark Rutland To: Suzuki K Poulose Cc: Saravana Kannan , will.deacon@arm.com, robh@kernel.org, sudeep.holla@arm.com, mathieu.poirier@linaro.org, peterz@infradead.org, jonathan.cameron@huawei.com, linux-kernel@vger.kernel.org, marc.zyngier@arm.com, leo.yan@linaro.org, frowand.list@gmail.com, linux-arm-kernel@lists.infradead.org, rananta@codeaurora.org, avilaj@codeaurora.org, Lorenzo Pieralisi , Charles Garcia-Tobin Subject: Re: [PATCH v11 8/8] perf: ARM DynamIQ Shared Unit PMU support Message-ID: <20180309133531.fepm2suvdmvm4muv@lakrids.cambridge.arm.com> References: <20180102112533.13640-1-suzuki.poulose@arm.com> <20180102112533.13640-9-suzuki.poulose@arm.com> <5AA1CE48.5030203@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 09, 2018 at 10:53:14AM +0000, Suzuki K Poulose wrote: > + Cc: Lorenzo, Charles. > > On 08/03/18 23:59, Saravana Kannan wrote: > > On 01/02/2018 03:25 AM, Suzuki K Poulose wrote: > > > Add support for the Cluster PMU part of the ARM DynamIQ Shared Unit (DSU). > > > The DSU integrates one or more cores with an L3 memory system, control > > > logic, and external interfaces to form a multicore cluster. The PMU > > > allows counting the various events related to L3, SCU etc, along with > > > providing a cycle counter. > > > > > > The PMU can be accessed via system registers, which are common > > > to the cores in the same cluster. The PMU registers follow the > > > semantics of the ARMv8 PMU, mostly, with the exception that > > > the counters record the cluster wide events. > > > > > > This driver is mostly based on the ARMv8 and CCI PMU drivers. > > > The driver only supports ARM64 at the moment. It can be extended > > > to support ARM32 by providing register accessors like we do in > > > arch/arm64/include/arm_dsu_pmu.h. > > > > > > Cc: Mark Rutland > > > Cc: Will Deacon > > > Reviewed-by: Jonathan Cameron > > > Reviewed-by: Mark Rutland > > > Signed-off-by: Suzuki K Poulose > > [...] > > > > > Looking at the code, I didn't see any specific handling of cluster power collapse. AFAIK, the HW counters do not retain config (what event they are counting) or value (the current count) across power collapse. Wouldn't you need to register for some kind of PM_ENTER/EXIT notifiers to handle that? > > Good point, yes *somebody* needs to save-restore the registers. But who ? As far > as the kernel is concerned, it doesn't control the DSU states. Also, as of now > there is no reliable way to get the "ENTER/EXIT" notifications for the DSU power > domain state changes. All we do is use the PMU, assuming it is available. AFAIT, > it should really be done at EL3, which manages the DSU, but may be I am wrong. Given this can happen behind the back of the kernel, if FW doesn't save/restore this state, we'll have to inhibit cpuidle on a CPU associated with the DSU PMU whenever it has active events, which would keep the cluster online. Thanks, Mark.