From patchwork Tue Apr 11 08:39:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Rutland X-Patchwork-Id: 9674751 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CB8F460382 for ; Tue, 11 Apr 2017 08:56:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AD3D728524 for ; Tue, 11 Apr 2017 08:56:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A077828528; Tue, 11 Apr 2017 08:56:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1031628524 for ; Tue, 11 Apr 2017 08:56:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=S+5yUmrDs6D2Tn8rev5pi3vigFnmKwiRbKyli4D59mY=; b=sE2w5r9EAdqSatjKQp8tV8mnLY C9oeGNF1AsuOumanNdXx1kZiB4VgcFbteP+s6qjQBXk8A27G+++8asrQGBzlu0ueRZLHHIdL2pBEa 2j0PY3XVpqpX6TVeJQkXUNI0pE6EUaE33hPebh78OdByq5K/KHMW7CYzO69abV9N8bkNPlKKHlYZk GX41bfYdcMU07HTuSR+c75MRRFLgDWPZBRLA/ohGh74QcWQ7TRLvgB+i/qBx4nQgPmceYlOTcySxU 6nlU+RafW8Dqg10UpKjR4QQ/uT9cRW5lB319l/qFGcOfduAHNJIe7fxn8PbPugjbdhC07X+4KOz/x Oc/1UgZQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cxrbF-0007E7-Iv; Tue, 11 Apr 2017 08:56:33 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cxrML-0004lz-Af for linux-arm-kernel@lists.infradead.org; Tue, 11 Apr 2017 08:41:15 +0000 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 5BE2E16A0; Tue, 11 Apr 2017 01:40:41 -0700 (PDT) Received: from leverpostej.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 5810E3F575; Tue, 11 Apr 2017 01:40:40 -0700 (PDT) From: Mark Rutland To: linux-arm-kernel@lists.infradead.org Subject: [PATCHv3 09/14] drivers/perf: arm_pmu: move irq request/free into probe Date: Tue, 11 Apr 2017 09:39:52 +0100 Message-Id: <1491899997-32210-10-git-send-email-mark.rutland@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1491899997-32210-1-git-send-email-mark.rutland@arm.com> References: <1491899997-32210-1-git-send-email-mark.rutland@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170411_014110_173754_9C5FC2EA X-CRM114-Status: UNSURE ( 8.88 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, catalin.marinas@arm.com, lorenzo.pieralisi@arm.com, will.deacon@arm.com, jeremy.linton@arm.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Currently we request (and potentially free) all IRQs for a given PMU in cpu_pmu_init(). This works for platform/DT probing today, but it doesn't fit ACPI well as we don't have all our affinity data up-front. In preparation for ACPI support, fold the IRQ request/free into arm_pmu_device_probe(), which will remain specific to platform/DT probing. Signed-off-by: Mark Rutland Tested-by: Jeremy Linton Cc: Will Deacon --- drivers/perf/arm_pmu.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c index c09c379..f387d61 100644 --- a/drivers/perf/arm_pmu.c +++ b/drivers/perf/arm_pmu.c @@ -758,10 +758,6 @@ static int cpu_pmu_init(struct arm_pmu *cpu_pmu) { int err; - err = armpmu_request_irqs(cpu_pmu); - if (err) - goto out; - err = cpuhp_state_add_instance(CPUHP_AP_PERF_ARM_STARTING, &cpu_pmu->node); if (err) @@ -777,7 +773,6 @@ static int cpu_pmu_init(struct arm_pmu *cpu_pmu) cpuhp_state_remove_instance_nocalls(CPUHP_AP_PERF_ARM_STARTING, &cpu_pmu->node); out: - armpmu_free_irqs(cpu_pmu); return err; } @@ -1073,12 +1068,18 @@ int arm_pmu_device_probe(struct platform_device *pdev, goto out_free; } + ret = armpmu_request_irqs(pmu); + if (ret) + goto out_free_irqs; + ret = armpmu_register(pmu); if (ret) goto out_free; return 0; +out_free_irqs: + armpmu_free_irqs(pmu); out_free: pr_info("%s: failed to register PMU devices!\n", of_node_full_name(node));