From patchwork Thu Apr 28 15:05:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suzuki K Poulose X-Patchwork-Id: 8971471 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1AC27BF29F for ; Thu, 28 Apr 2016 15:07:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3F733201C8 for ; Thu, 28 Apr 2016 15:07:16 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 23C07201FA for ; Thu, 28 Apr 2016 15:07:15 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1avnVn-0005V0-Nd; Thu, 28 Apr 2016 15:05:51 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1avnVi-0005Nh-BN for linux-arm-kernel@lists.infradead.org; Thu, 28 Apr 2016 15:05:49 +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 DB45E3A; Thu, 28 Apr 2016 08:05:26 -0700 (PDT) Received: from e106634-lin.cambridge.arm.com (e106634-lin.cambridge.arm.com [10.1.209.136]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id B6AB93F24D; Thu, 28 Apr 2016 08:05:23 -0700 (PDT) From: Suzuki K Poulose To: arm@kernel.org Subject: [PATCH] [for 4.7] arm-ccn: Enable building as module Date: Thu, 28 Apr 2016 16:05:01 +0100 Message-Id: <1461855901-23794-1-git-send-email-suzuki.poulose@arm.com> X-Mailer: git-send-email 1.7.9.5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160428_080546_418651_1C6D1DDA X-CRM114-Status: GOOD ( 11.70 ) X-Spam-Score: -7.9 (-------) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , arnd@arndb.de, Suzuki K Poulose , khilman@baylibre.com, Will Deacon , linux-kernel@vger.kernel.org, Paul Gortmaker , olof@lixom.net, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP arm-ccn driver uses irq_set_affinity, which is not exported and hence cannot be built as a module, eventhough we have all the bits ready. This patch makes use of the exported helper irq_set_affinity_hint() instead. Also, the __free_irq expects the affinity_hint to be NULL when we free the irq. So set the affinity_hint to NULL at clean up. Now that we can build it as a module, update the Kconfig to reflect the change. Cc: Will Deacon Cc: Mark Rutland Cc: Paul Gortmaker Acked-by: Pawel Moll Signed-off-by: Suzuki K Poulose --- drivers/bus/Kconfig | 2 +- drivers/bus/arm-ccn.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig index d4a3a31..3efc996 100644 --- a/drivers/bus/Kconfig +++ b/drivers/bus/Kconfig @@ -48,7 +48,7 @@ config ARM_CCI5xx_PMU If unsure, say Y config ARM_CCN - bool "ARM CCN driver support" + tristate "ARM CCN driver support" depends on ARM || ARM64 depends on PERF_EVENTS help diff --git a/drivers/bus/arm-ccn.c b/drivers/bus/arm-ccn.c index 7082c72..acc3eb5 100644 --- a/drivers/bus/arm-ccn.c +++ b/drivers/bus/arm-ccn.c @@ -1189,7 +1189,7 @@ static int arm_ccn_pmu_cpu_notifier(struct notifier_block *nb, perf_pmu_migrate_context(&dt->pmu, cpu, target); cpumask_set_cpu(target, &dt->cpu); if (ccn->irq) - WARN_ON(irq_set_affinity(ccn->irq, &dt->cpu) != 0); + WARN_ON(irq_set_affinity_hint(ccn->irq, &dt->cpu) != 0); default: break; } @@ -1278,7 +1278,7 @@ static int arm_ccn_pmu_init(struct arm_ccn *ccn) /* Also make sure that the overflow interrupt is handled by this CPU */ if (ccn->irq) { - err = irq_set_affinity(ccn->irq, &ccn->dt.cpu); + err = irq_set_affinity_hint(ccn->irq, &ccn->dt.cpu); if (err) { dev_err(ccn->dev, "Failed to set interrupt affinity!\n"); goto error_set_affinity; @@ -1306,7 +1306,8 @@ static void arm_ccn_pmu_cleanup(struct arm_ccn *ccn) { int i; - irq_set_affinity(ccn->irq, cpu_possible_mask); + if (ccn->irq) + irq_set_affinity_hint(ccn->irq, NULL); unregister_cpu_notifier(&ccn->dt.cpu_nb); for (i = 0; i < ccn->num_xps; i++) writel(0, ccn->xp[i].base + CCN_XP_DT_CONTROL);