From patchwork Fri Mar 10 11:04:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Rutland X-Patchwork-Id: 9616061 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 D660060414 for ; Fri, 10 Mar 2017 11:08:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 01EFA286E7 for ; Fri, 10 Mar 2017 11:08:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EAF3D2870D; Fri, 10 Mar 2017 11:08:57 +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 81D96286E7 for ; Fri, 10 Mar 2017 11:08:57 +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=qYUbQfh6BpIOQceph8GJlxmEVBctg9R/kzQjYFOSwRs=; b=jvf03TOg4REeq3H74N85qDMhLs h+E/ALpaUr+gJG/8awnfH0WlLygiEOITA8buCgWElSWufIhbxhh70fuoE6iQ43yrEJ+0sQSdqA5nF UiJ+8jo21Cq32wX5nN9WGrvOxRe7QMC4ZQ3jq8ek8gXGGpxgJN9G9VrgYw8SdRiMngt9qmFPmpjtp JnuzxVY8h3rC4fz34436KGHNlxh2DHZJ9CsT0EXlAiNGAUMB9haKSJJxR2N01cFutXSwt7ImfsYBW Ko+A0s973qPfDJxDkcBO6e/va9R/NzQ0sJGy7PtTNRbpSUImsC/MaMXlq8I1H5ThMOb3eulBbbRMN NzOfd9xA==; 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 1cmIPo-0004Ag-NC; Fri, 10 Mar 2017 11:08:56 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cmINH-0002Nt-VB for linux-arm-kernel@lists.infradead.org; Fri, 10 Mar 2017 11:06:22 +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 C7DEA1515; Fri, 10 Mar 2017 03:06:03 -0800 (PST) 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 ADA173F3E1; Fri, 10 Mar 2017 03:06:02 -0800 (PST) From: Mark Rutland To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 09/14] drivers/perf: arm_pmu: move irq request/free into probe Date: Fri, 10 Mar 2017 11:04:46 +0000 Message-Id: <1489143891-11596-10-git-send-email-mark.rutland@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1489143891-11596-1-git-send-email-mark.rutland@arm.com> References: <1489143891-11596-1-git-send-email-mark.rutland@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170310_030620_076441_9997671C X-CRM114-Status: UNSURE ( 8.79 ) 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 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 5e5ea12..d202a73 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));