Received: by 10.223.185.111 with SMTP id b44csp158148wrg; Fri, 9 Mar 2018 02:54:24 -0800 (PST) X-Google-Smtp-Source: AG47ELsdZMA41iHl5XAULTngvOQa5TQY1JhcR9Y1RZ+4bz77tq30l6lmq2PLy+ruL9iODIerusR+ X-Received: by 10.98.16.23 with SMTP id y23mr29637190pfi.84.1520592863955; Fri, 09 Mar 2018 02:54:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520592863; cv=none; d=google.com; s=arc-20160816; b=cHW2KNe8pC082dq8790aOZ39TBBeV2PPPVchHxCCrRvVpoXdHsFV5w7sSqjcKxffIn uM7hAj2Fk1p8Fduc/5TCllCnFWlKUuQeUh8Vs3vbiygVdxp9T5GvkPiJpN35hzvil09V 4a95K+K7tMPEbSDCoSF9HoibGk0LbQSUXvi7vJrgmX44BVMABkLkO3a7KEpFvf57aFCq MZ5rnMbnzjZG+/eHekBZk661LN63npL/7moLQmJtchiLnFNE6VHsyXvTPp/facoppPnF Nr90gn0xGyzsH4CWcJP5CJ7r0eG8BgyDRX2UAM0rpCUgtSaiq7Dsw13pzr1wr3wuVC3j QWJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=f5KQ32Yqaz6Cf6evm9Ub/R77kWPqlyJAA+8U2micGPA=; b=AzE7RhLBdGcebFC06GlZ+dke3v0rd1+qiWvmiaL8OoQozieiCXQ3eN3UGdk7iLq4tk FErpZHNy6rbvsVlyecdkpfmiLufuHu69fL/RnNs1pAvYrZnTK5AwhwAhbzzxo8UBBtN8 Gx3yGnh+mrfhwrJ0ab2vGRRmV47NyMTcHyNkaG8AN2CaCzOG5x98nkzklNWIBkofwd8L urTU4X2n0S9cySCucgE1OHwtN4Cx/PtzD5/CIX/16+plmKBUJroqxdJur1x/sQEXX3wf s7LhpmXlnh0lOWWPxSsfNxmQqNKAAD4Nz4jUjMsTPTUBI8UQOk3l/lRX6bq3SqTd+vjd C9GA== 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 g11si648019pfd.272.2018.03.09.02.54.09; Fri, 09 Mar 2018 02:54:23 -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 S1751054AbeCIKxU (ORCPT + 99 others); Fri, 9 Mar 2018 05:53:20 -0500 Received: from foss.arm.com ([217.140.101.70]:50334 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750912AbeCIKxT (ORCPT ); Fri, 9 Mar 2018 05:53:19 -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 EEEFA80D; Fri, 9 Mar 2018 02:53:18 -0800 (PST) Received: from [10.1.206.28] (e107814-lin.cambridge.arm.com [10.1.206.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 27A6C3F487; Fri, 9 Mar 2018 02:53:16 -0800 (PST) Subject: Re: [PATCH v11 8/8] perf: ARM DynamIQ Shared Unit PMU support To: Saravana Kannan Cc: will.deacon@arm.com, mark.rutland@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 References: <20180102112533.13640-1-suzuki.poulose@arm.com> <20180102112533.13640-9-suzuki.poulose@arm.com> <5AA1CE48.5030203@codeaurora.org> From: Suzuki K Poulose Message-ID: Date: Fri, 9 Mar 2018 10:53:14 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <5AA1CE48.5030203@codeaurora.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org + 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. Sudeep, Lorenzo, Charles, Please feel free to share your thoughts. Cheers Suzuki