summaryrefslogtreecommitdiffstats
path: root/arch/arc/kernel/smp.c
diff options
context:
space:
mode:
authorYuriy Kolerov <yuriy.kolerov@synopsys.com>2016-11-08 10:08:31 +0300
committerVineet Gupta <vgupta@synopsys.com>2016-11-08 12:05:10 -0800
commit34e71e4cbb8eb467dbcfb3afbd2b95ff2b08f482 (patch)
tree966bf5fe9c434972a1a6be5b37653c65b1ecaeb2 /arch/arc/kernel/smp.c
parent19dbc76228899be555b84a09fd3a364c2ce86bbb (diff)
downloadlinux-34e71e4cbb8eb467dbcfb3afbd2b95ff2b08f482.tar.gz
linux-34e71e4cbb8eb467dbcfb3afbd2b95ff2b08f482.tar.bz2
linux-34e71e4cbb8eb467dbcfb3afbd2b95ff2b08f482.zip
ARC: IRQ: Do not use hwirq as virq and vice versa
This came up when reviewing code to address missing IRQ affinity setting in AXS103 platform and/or implementing hierarchical IRQ domains - smp_ipi_irq_setup() callers pass hwirq but in turn calls request_percpu_irq() which expects a linux virq. So invoke irq_find_mapping() to do the conversion (also explicitify this in code by renaming the args appropriately) - idu_of_init()/idu_cascade_isr() were similarly using linux virq where hwirq is expected, so do the conversion using irqd_to_hwirq() helper Signed-off-by: Yuriy Kolerov <yuriy.kolerov@synopsys.com> [vgupta: made changelog a bit concise a bit] Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Diffstat (limited to 'arch/arc/kernel/smp.c')
-rw-r--r--arch/arc/kernel/smp.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/arch/arc/kernel/smp.c b/arch/arc/kernel/smp.c
index f00029e9cbe4..88674d972c9d 100644
--- a/arch/arc/kernel/smp.c
+++ b/arch/arc/kernel/smp.c
@@ -22,6 +22,7 @@
#include <linux/atomic.h>
#include <linux/cpumask.h>
#include <linux/reboot.h>
+#include <linux/irqdomain.h>
#include <asm/processor.h>
#include <asm/setup.h>
#include <asm/mach_desc.h>
@@ -353,20 +354,24 @@ irqreturn_t do_IPI(int irq, void *dev_id)
*/
static DEFINE_PER_CPU(int, ipi_dev);
-int smp_ipi_irq_setup(int cpu, int irq)
+int smp_ipi_irq_setup(int cpu, irq_hw_number_t hwirq)
{
int *dev = per_cpu_ptr(&ipi_dev, cpu);
+ unsigned int virq = irq_find_mapping(NULL, hwirq);
+
+ if (!virq)
+ panic("Cannot find virq for root domain and hwirq=%lu", hwirq);
/* Boot cpu calls request, all call enable */
if (!cpu) {
int rc;
- rc = request_percpu_irq(irq, do_IPI, "IPI Interrupt", dev);
+ rc = request_percpu_irq(virq, do_IPI, "IPI Interrupt", dev);
if (rc)
- panic("Percpu IRQ request failed for %d\n", irq);
+ panic("Percpu IRQ request failed for %u\n", virq);
}
- enable_percpu_irq(irq, 0);
+ enable_percpu_irq(virq, 0);
return 0;
}