From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752755AbcD1PF1 (ORCPT ); Thu, 28 Apr 2016 11:05:27 -0400 Received: from foss.arm.com ([217.140.101.70]:44202 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752468AbcD1PF0 (ORCPT ); Thu, 28 Apr 2016 11:05:26 -0400 From: Suzuki K Poulose To: arm@kernel.org Cc: olof@lixom.net, arnd@arndb.de, khilman@baylibre.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Suzuki K Poulose , Will Deacon , Mark Rutland , Paul Gortmaker 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 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); -- 1.7.9.5