irqchip/xtensa-mx: Report that effective affinity is a single target
authorMarc Zyngier <marc.zyngier@arm.com>
Fri, 18 Aug 2017 08:39:25 +0000 (09:39 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 18 Aug 2017 08:54:43 +0000 (10:54 +0200)
The xtensa-mx driver only targets a single CPU at a time, even if
the notional affinity is wider. Let's inform the core code
about this.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: James Hogan <james.hogan@imgtec.com>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Paul Burton <paul.burton@imgtec.com>
Cc: Chris Zankel <chris@zankel.net>
Cc: Kevin Cernekee <cernekee@gmail.com>
Cc: Wei Xu <xuwei5@hisilicon.com>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Gregory Clement <gregory.clement@free-electrons.com>
Cc: Matt Redfearn <matt.redfearn@imgtec.com>
Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Link: http://lkml.kernel.org/r/20170818083925.10108-13-marc.zyngier@arm.com
drivers/irqchip/Kconfig
drivers/irqchip/irq-xtensa-mx.c

index bca9a88012f04d4d107fe80bbb0d7158425888f7..1139de9da21a86aa18e51ed5d98126ffa8c39703 100644 (file)
@@ -223,6 +223,7 @@ config VERSATILE_FPGA_IRQ_NR
 config XTENSA_MX
        bool
        select IRQ_DOMAIN
+       select GENERIC_IRQ_EFFECTIVE_AFF_MASK
 
 config XILINX_INTC
        bool
index 72a391e01011c8356474765cde4ab18d2f997f10..a15a9510c90439b11072fe5cc88f6f4656414388 100644 (file)
@@ -32,6 +32,7 @@ static int xtensa_mx_irq_map(struct irq_domain *d, unsigned int irq,
                irq_set_status_flags(irq, IRQ_LEVEL);
                return 0;
        }
+       irqd_set_single_target(irq_desc_get_irq_data(irq_to_desc(irq)));
        return xtensa_irq_map(d, irq, hw);
 }
 
@@ -121,9 +122,12 @@ static int xtensa_mx_irq_retrigger(struct irq_data *d)
 static int xtensa_mx_irq_set_affinity(struct irq_data *d,
                const struct cpumask *dest, bool force)
 {
-       unsigned mask = 1u << cpumask_any_and(dest, cpu_online_mask);
+       int cpu = cpumask_any_and(dest, cpu_online_mask);
+       unsigned mask = 1u << cpu;
 
        set_er(mask, MIROUT(d->hwirq - HW_IRQ_MX_BASE));
+       irq_data_update_effective_affinity(d, cpumask_of(cpu));
+
        return 0;
 
 }