arm-ccn: Enable building as module
authorSuzuki K Poulose <suzuki.poulose@arm.com>
Thu, 28 Apr 2016 15:05:01 +0000 (16:05 +0100)
committerArnd Bergmann <arnd@arndb.de>
Mon, 9 May 2016 14:36:03 +0000 (16:36 +0200)
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 <will.deacon@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Acked-by: Pawel Moll <pawel.moll@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
drivers/bus/Kconfig
drivers/bus/arm-ccn.c

index f5ea153f53e9641090b4514abb4bb88814ce4fa1..c5a7de9bc7837b2125d369424171cd09ef16f447 100644 (file)
@@ -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
index 7082c7268845639399d9ceab44471937011e1705..acc3eb542c747eb5bf1d335ff1bd6a0cb9aaee01 100644 (file)
@@ -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);