From patchwork Tue Aug 23 20:47:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Linton X-Patchwork-Id: 74527 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp2288402qga; Tue, 23 Aug 2016 13:48:05 -0700 (PDT) X-Received: by 10.98.81.1 with SMTP id f1mr56908466pfb.35.1471985285362; Tue, 23 Aug 2016 13:48:05 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c5si5474696paf.138.2016.08.23.13.48.05; Tue, 23 Aug 2016 13:48:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-acpi-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-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-acpi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754698AbcHWUsD (ORCPT + 6 others); Tue, 23 Aug 2016 16:48:03 -0400 Received: from foss.arm.com ([217.140.101.70]:40993 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753490AbcHWUsC (ORCPT ); Tue, 23 Aug 2016 16:48:02 -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 0266D451; Tue, 23 Aug 2016 13:49:41 -0700 (PDT) Received: from beelzebub.ast.arm.com (unknown [10.118.96.220]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id A1AB73F580; Tue, 23 Aug 2016 13:48:01 -0700 (PDT) From: Jeremy Linton To: linux-arm-kernel@lists.infradead.org Cc: mark.rutland@arm.com, will.deacon@arm.com, punit.agrawal@arm.com, linux-acpi@vger.kernel.org, mlangsdorf@redhat.com, steve.capper@arm.com Subject: [PATCH v7 1/9] arm64: pmu: add fallback probe table Date: Tue, 23 Aug 2016 15:47:52 -0500 Message-Id: <1471985280-2243-2-git-send-email-jeremy.linton@arm.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1471985280-2243-1-git-send-email-jeremy.linton@arm.com> References: <1471985280-2243-1-git-send-email-jeremy.linton@arm.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org From: Mark Salter In preparation for ACPI support, add a pmu_probe_info table to the arm_pmu_device_probe() call. This table gets used when probing in the absence of a devicetree node for PMU. Signed-off-by: Mark Salter Signed-off-by: Jeremy Linton --- arch/arm64/kernel/perf_event.c | 13 ++++++++++++- drivers/perf/arm_pmu.c | 2 +- include/linux/perf/arm_pmu.h | 3 +++ 3 files changed, 16 insertions(+), 2 deletions(-) -- 2.5.5 -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c index 838ccf1..3aac598 100644 --- a/arch/arm64/kernel/perf_event.c +++ b/arch/arm64/kernel/perf_event.c @@ -24,6 +24,7 @@ #include #include +#include #include #include #include @@ -1044,9 +1045,19 @@ static const struct of_device_id armv8_pmu_of_device_ids[] = { {}, }; +static const struct pmu_probe_info armv8_pmu_probe_table[] = { + PMU_PROBE(0, 0, armv8_pmuv3_init), /* if all else fails... */ + { /* sentinel value */ } +}; + static int armv8_pmu_device_probe(struct platform_device *pdev) { - return arm_pmu_device_probe(pdev, armv8_pmu_of_device_ids, NULL); + if (acpi_disabled) + return arm_pmu_device_probe(pdev, armv8_pmu_of_device_ids, + NULL); + + return arm_pmu_device_probe(pdev, armv8_pmu_of_device_ids, + armv8_pmu_probe_table); } static struct platform_driver armv8_pmu_driver = { diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c index c494613..f1aee26 100644 --- a/drivers/perf/arm_pmu.c +++ b/drivers/perf/arm_pmu.c @@ -1028,7 +1028,7 @@ int arm_pmu_device_probe(struct platform_device *pdev, ret = of_pmu_irq_cfg(pmu); if (!ret) ret = init_fn(pmu); - } else { + } else if (probe_table) { cpumask_setall(&pmu->supported_cpus); ret = probe_current_pmu(pmu, probe_table); } diff --git a/include/linux/perf/arm_pmu.h b/include/linux/perf/arm_pmu.h index e188438..65d8e27 100644 --- a/include/linux/perf/arm_pmu.h +++ b/include/linux/perf/arm_pmu.h @@ -147,6 +147,9 @@ struct pmu_probe_info { #define XSCALE_PMU_PROBE(_version, _fn) \ PMU_PROBE(ARM_CPU_IMP_INTEL << 24 | _version, ARM_PMU_XSCALE_MASK, _fn) +#define ARMV8_PMU_PART_PROBE(_part, _fn) \ + PMU_PROBE((_part) << MIDR_PARTNUM_SHIFT, MIDR_PARTNUM_MASK, _fn) + int arm_pmu_device_probe(struct platform_device *pdev, const struct of_device_id *of_table, const struct pmu_probe_info *probe_table);