Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1440350ybk; Thu, 21 May 2020 07:00:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCvbKVm9e5luU9ncJ8bUgxkzwqaaHwPVUt2rryYXIUWi1t8SvxIGIuY4vEJyk2/t/JnUkg X-Received: by 2002:a17:906:355b:: with SMTP id s27mr3672876eja.492.1590069631696; Thu, 21 May 2020 07:00:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590069631; cv=none; d=google.com; s=arc-20160816; b=fDT7GWtaLnH3Pt62HPSWMffr4y39+/GcEmJv/VRosQeCKLPZog/BSD28ad1acgw5XH XSF+gqV/eqdjIuiEe2vJ57LnxKpc/nHNECqMgLQkKSaF1fFPu7r0vV/3wkXelD7AGhk7 vJpQ677jI5RpPAb1MKw+YlHQ4wzL6Q1JOEj++D+I8Dl2jhy73X48Q4WrKer6lIcmf1jt R6awfiVivT86fJtCfCzLVP8G7Beks1YUc5dPMpf3eBHCHF3kglpx11RN+0B6ftW+ds69 adJGoUxhGLlGP06rxk3e54S1+NIvD5IKF/Sj7r4jOX2fE3qwsyQiP48E4ZpLP5ox0ECz mScw== 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=ngRwVVURilh1eZYjEw16IJPAYwj+FdumUcfS6MtXTdE=; b=GFiistT8IPHV6hphlR7oML+veHRBJs1z/1iMtSRQzXtuXejFAVjMVnKu37JdN/q9WV RJtkgdVnvy+6JB8QsRI28njUrzr0vXhyXLAKNz0DFs7RjALvByVeQk3NVvQprDU0vFwf aAMFMMv4xoIA4PYAwb7uyz4AI21/aogh4rx0gYXx036wzvFk/D9OmNtNObliizh7wCj9 pNOLuX/umL0U/Cy605w7jJNFXW5cs7c4y7Ekti3RtRBJ0E/DTZU2d6NEQJ4CIE1fMUDs 2lgIoK7BBLmgZpbjTJ7FLvchfW0pahPCXASUfcZjqCA0X0jWoeyygLN9vp3N8/1XBp4g DA2A== 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 u23si3724888ejr.391.2020.05.21.07.00.04; Thu, 21 May 2020 07:00:31 -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 S1729531AbgEUN4D (ORCPT + 99 others); Thu, 21 May 2020 09:56:03 -0400 Received: from foss.arm.com ([217.140.110.172]:47304 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728060AbgEUN4D (ORCPT ); Thu, 21 May 2020 09:56:03 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B5CBCD6E; Thu, 21 May 2020 06:56:02 -0700 (PDT) Received: from bogus (unknown [10.37.12.114]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A43143F305; Thu, 21 May 2020 06:56:00 -0700 (PDT) Date: Thu, 21 May 2020 14:55:57 +0100 From: Sudeep Holla To: Tuan Phan Cc: Mark Rutland , patches@amperecomputing.com, Will Deacon , linux-kernel@vger.kernel.org, Sudeep Holla , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2] perf: arm_dsu: Support DSU ACPI devices. Message-ID: <20200521135557.GB12282@bogus> References: <1589229160-18558-1-git-send-email-tuanphan@os.amperecomputing.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1589229160-18558-1-git-send-email-tuanphan@os.amperecomputing.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 11, 2020 at 01:32:40PM -0700, Tuan Phan wrote: > Add ACPI node probing device support. Each DSU ACPI node > defines a "cpus" package with a per cpu MPIDR element. > > Signed-off-by: Tuan Phan > --- > Changes in v2: > - Removed IRQF_SHARED. > - Fixed ACPI runtime detection. > > The ACPI binding spec for DSU ACPI node is under beta and located > in ARM server group under project "ACPI on ARM". > > drivers/perf/arm_dsu_pmu.c | 71 ++++++++++++++++++++++++++++++++++++++++------ > 1 file changed, 63 insertions(+), 8 deletions(-) > > diff --git a/drivers/perf/arm_dsu_pmu.c b/drivers/perf/arm_dsu_pmu.c > index 70968c8..784d177 100644 > --- a/drivers/perf/arm_dsu_pmu.c > +++ b/drivers/perf/arm_dsu_pmu.c > @@ -11,6 +11,7 @@ > #define DRVNAME PMUNAME "_pmu" > #define pr_fmt(fmt) DRVNAME ": " fmt > > +#include > #include > #include > #include > @@ -603,18 +604,21 @@ static struct dsu_pmu *dsu_pmu_alloc(struct platform_device *pdev) > } > > /** > - * dsu_pmu_dt_get_cpus: Get the list of CPUs in the cluster. > + * dsu_pmu_dt_get_cpus: Get the list of CPUs in the cluster > + * from device tree. > */ > -static int dsu_pmu_dt_get_cpus(struct device_node *dev, cpumask_t *mask) > +static int dsu_pmu_dt_get_cpus(struct platform_device *pdev) > { > int i = 0, n, cpu; > struct device_node *cpu_node; > + struct dsu_pmu *dsu_pmu = > + (struct dsu_pmu *) platform_get_drvdata(pdev); > > - n = of_count_phandle_with_args(dev, "cpus", NULL); > + n = of_count_phandle_with_args(pdev->dev.of_node, "cpus", NULL); > if (n <= 0) > return -ENODEV; > for (; i < n; i++) { > - cpu_node = of_parse_phandle(dev, "cpus", i); > + cpu_node = of_parse_phandle(pdev->dev.of_node, "cpus", i); > if (!cpu_node) > break; > cpu = of_cpu_node_to_id(cpu_node); > @@ -626,11 +630,54 @@ static int dsu_pmu_dt_get_cpus(struct device_node *dev, cpumask_t *mask) > */ > if (cpu < 0) > continue; > - cpumask_set_cpu(cpu, mask); > + cpumask_set_cpu(cpu, &dsu_pmu->associated_cpus); > } > return 0; > } > > +/** > + * dsu_pmu_acpi_get_cpus: Get the list of CPUs in the cluster > + * from ACPI. > + */ > +static int dsu_pmu_acpi_get_cpus(struct platform_device *pdev) > +{ > + int i, cpu, ret; > + const union acpi_object *obj; > + struct acpi_device *adev = ACPI_COMPANION(&pdev->dev); > + struct dsu_pmu *dsu_pmu = > + (struct dsu_pmu *) platform_get_drvdata(pdev); > + > + ret = acpi_dev_get_property(adev, "cpus", ACPI_TYPE_PACKAGE, &obj); I don't see any property "cpus" in the document: DEN 0093 A (Generic ACPI for Arm Components 1.0) [1] Is there any newer updates that I need to look at ? -- Regards, Sudeep [1] https://static.docs.arm.com/den0093/a/DEN0093_ACPI_Arm_Components_1.0.pdf