Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1456223ybk; Thu, 21 May 2020 07:19:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzx0/k1gqWKsK8uIeLA2uS+zEJe0fOA7ER54RrlEd7BgSGrgXPxNmOHAYa7d4qioSrNJQex X-Received: by 2002:a17:906:278e:: with SMTP id j14mr3724269ejc.270.1590070763750; Thu, 21 May 2020 07:19:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590070763; cv=none; d=google.com; s=arc-20160816; b=qkZ8WJJQunf4H0wMP9H1iZKbX8OsXe5CHdHgIKJX2xdnx08qXeGGXmpOiYm/CNqUlV 1G/OSEzSZEglqEdYyNgOOQVD8piCulKzn84y1PkKvDeJHG6qsYNt2yMD8ihwKWM63o5w ZECTwSNn6oPQMmh02E2hJtaUe0dyozx+66NulIE0eIi/B6rqn+hwzHFEWXm2Q/ghBUbO 7ycpiJSBhyS8GxI2blxY0Ny4cLKBhxm5iesV8KFk/hW9hzElrwmgwBNkQp4wismbXO96 EE44VSX1aNJVJEdH/Bieg/ybjIZq/kSu3GZT2D7g4Kigk3LIoCFt7vxZv09kF7m4c7R3 h8Pg== 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; bh=s7S0DGvA9hY0KmZUr6iQgI/ppSjX2kbrEkFCENC8YI0=; b=RhwzkyQsS0naoUK8LFargVTtUvkMTmsOb2Jd9VkQegXrUrZ9B/rLIzQYu81XJE8o7D kFhvWwO8Wt0vINaHh9lsH5bwOV3dWsLA1PhZtgzeK92/T2pD3I6yL74lwcUAoZO25x9K v44LT2+jyBBdNXKJHMt+eBJz3wVuSc/XPAYmSxhmn1LYa9uKesE4ewviVEhJi+3na3xx hO4ueRhgmyeHC1Bny9vj6KVpKkFNg0YDoRlP597jP1B9neqhvnf06olaNi2XLlHERvse G3WkScu8xK3YeOKsUf152lOqPLtC9eHTOryIjYQz8auLnmwjoQCLFoT2j+NTzTdeOAMM OJMw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r23si2956465edp.515.2020.05.21.07.18.59; Thu, 21 May 2020 07:19:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729642AbgEUORc (ORCPT + 99 others); Thu, 21 May 2020 10:17:32 -0400 Received: from lhrrgout.huawei.com ([185.176.76.210]:2239 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727909AbgEUORb (ORCPT ); Thu, 21 May 2020 10:17:31 -0400 Received: from lhreml724-chm.china.huawei.com (unknown [172.18.7.108]) by Forcepoint Email with ESMTP id B7AC5851A8F64C7CAB12; Thu, 21 May 2020 15:17:29 +0100 (IST) Received: from [127.0.0.1] (10.47.6.132) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Thu, 21 May 2020 15:17:28 +0100 Subject: Re: [PATCH V1 RESEND 1/3] perf/imx_ddr: Add system PMU identifier for userspace To: Mark Rutland , Will Deacon CC: Rob Herring , Joakim Zhang , , , , , References: <20200512073115.14177-1-qiangqing.zhang@nxp.com> <20200512073115.14177-2-qiangqing.zhang@nxp.com> <20200519185125.GB453195@bogus> <20200520073304.GA23534@willie-the-truck> <20200521132641.GB47848@C02TD0UTHF1T.local> From: John Garry Message-ID: <04e6ed82-d33e-9153-eeab-29986ccf8e1e@huawei.com> Date: Thu, 21 May 2020 15:16:29 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.1.2 MIME-Version: 1.0 In-Reply-To: <20200521132641.GB47848@C02TD0UTHF1T.local> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.47.6.132] X-ClientProxiedBy: lhreml715-chm.china.huawei.com (10.201.108.66) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21/05/2020 14:26, Mark Rutland wrote: > On Wed, May 20, 2020 at 08:33:04AM +0100, Will Deacon wrote: >> On Tue, May 19, 2020 at 12:51:25PM -0600, Rob Herring wrote: >>> On Tue, May 12, 2020 at 03:31:13PM +0800, Joakim Zhang wrote: >>>> +static ssize_t ddr_perf_identifier_show(struct device *dev, >>>> + struct device_attribute *attr, >>>> + char *page) >>>> +{ >>>> + struct ddr_pmu *pmu = dev_get_drvdata(dev); >>>> + >>>> + return sprintf(page, "%s\n", pmu->devtype_data->identifier); >>> >>> Why do we need yet another way to identify the SoC from userspace? >> >> I also really dislike this. What's the preferred way to identify the SoC >> from userspace? It's needed so that the perf userspace tool can describe >> perf events that are supported for the PMU, as this isn't probe-able >> directly from the hardware. We have the same issue with the SMMUv3 PMCG [1], >> and so we need to solve the problem for both DT and ACPI. > > Worth noting that while in this case it happens to identify the SoC, > in general you can have distinct instances of system IP in a single > system, so I do think that we need *something* instance-specific, even > if that's combined with SoC info. > Hi Mark, > Where IP gets reused across SoCs, it makes sense for that to not depend > on top-level SoC info. This would be quite an uncommon case. Generally most instances of a given PMU in a SoC would be identical implementations. And anyway, we should be able to solve that problem in perf tool, as long as the PMU device name is fixed. Like what we have for the SMMUv3 PMU, where the device name contains the device bus address, i.e don't use idr for perf drivers device naming.... Thanks, John