Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1507166
| From | Yuriy Kolerov <yuriy.kolerov@synopsys.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v2 2/5] ARC: SMP: Pass virq to smp_ipi_irq_setup instead of hwirq |
| Date | 2016-10-24 14:50 +0200 |
| Message-ID | <svMRr-7EB-7@gated-at.bofh.it> (permalink) |
| References | <svMRr-7EB-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
This function takes a cpu number and a virq number and registers an
appropriate handler per cpu. However smp_ipi_irq_setup is incorrectly
used in several places of ARC platform code - hwirq is passed instead of
virq. There is a code with an example of inccorect usage of smp_ipi_irq_setup:
smp_ipi_irq_setup(cpu, IPI_IRQ);
smp_ipi_irq_setup(cpu, SOFTIRQ_IRQ);
where IPI_IRQ and SOFTIRQ_IRQ are hwirq numbers for per cpu interrupts.
Since smp_ipi_irq_setup must be taken a virq number insdead of a hwirq
number then it is necessary to fix usage of this function this way:
smp_ipi_irq_setup(cpu, irq_find_mapping(NULL, IPI_IRQ));
smp_ipi_irq_setup(cpu, irq_find_mapping(NULL, SOFTIRQ_IRQ));
The idea is to find an appropriate mapping of <domain, hwirq> to virq
by using irq_find_mapping function. NULL value is used as a domain
argument (a default domain) since smp_ipi_irq_setup is used for
registering an IRQ handler for a root interrupt controller (a default
IRQ domain must be used).
Signed-off-by: Yuriy Kolerov <yuriy.kolerov@synopsys.com>
---
arch/arc/kernel/mcip.c | 5 +++--
arch/arc/plat-eznps/smp.c | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/arch/arc/kernel/mcip.c b/arch/arc/kernel/mcip.c
index 72f9179..28ff766 100644
--- a/arch/arc/kernel/mcip.c
+++ b/arch/arc/kernel/mcip.c
@@ -11,6 +11,7 @@
#include <linux/smp.h>
#include <linux/irq.h>
#include <linux/spinlock.h>
+#include <linux/irqdomain.h>
#include <asm/irqflags-arcv2.h>
#include <asm/mcip.h>
#include <asm/setup.h>
@@ -22,8 +23,8 @@ static DEFINE_RAW_SPINLOCK(mcip_lock);
static void mcip_setup_per_cpu(int cpu)
{
- smp_ipi_irq_setup(cpu, IPI_IRQ);
- smp_ipi_irq_setup(cpu, SOFTIRQ_IRQ);
+ smp_ipi_irq_setup(cpu, irq_find_mapping(NULL, IPI_IRQ));
+ smp_ipi_irq_setup(cpu, irq_find_mapping(NULL, SOFTIRQ_IRQ));
}
static void mcip_ipi_send(int cpu)
diff --git a/arch/arc/plat-eznps/smp.c b/arch/arc/plat-eznps/smp.c
index 5e901f8..dd996e0 100644
--- a/arch/arc/plat-eznps/smp.c
+++ b/arch/arc/plat-eznps/smp.c
@@ -134,7 +134,7 @@ static void eznps_ipi_send(int cpu)
static void eznps_init_per_cpu(int cpu)
{
- smp_ipi_irq_setup(cpu, NPS_IPI_IRQ);
+ smp_ipi_irq_setup(cpu, irq_find_mapping(NULL, NPS_IPI_IRQ));
eznps_init_core(cpu);
mtm_enable_core(cpu);
--
2.7.4
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v2 1/5] ARC: SMP: Use "unsigned virq" in smp_ipi_irq_setup instead of "signed irq" Yuriy Kolerov <yuriy.kolerov@synopsys.com> - 2016-10-24 14:50 +0200
[PATCH v2 2/5] ARC: SMP: Pass virq to smp_ipi_irq_setup instead of hwirq Yuriy Kolerov <yuriy.kolerov@synopsys.com> - 2016-10-24 14:50 +0200
Re: [PATCH v2 2/5] ARC: SMP: Pass virq to smp_ipi_irq_setup instead of hwirq Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-10-25 04:30 +0200
[PATCH v2 3/5] ARC: MCIP: Use hwirq instead of virq for resolution of IDU IRQ handlers Yuriy Kolerov <yuriy.kolerov@synopsys.com> - 2016-10-24 14:50 +0200
[PATCH v2 4/5] ARC: MCIP: Set an initial affinity value in idu_irq_map Yuriy Kolerov <yuriy.kolerov@synopsys.com> - 2016-10-24 14:50 +0200
Re: [PATCH v2 4/5] ARC: MCIP: Set an initial affinity value in idu_irq_map Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-10-25 20:30 +0200
Re: [PATCH v2 4/5] ARC: MCIP: Set an initial affinity value in idu_irq_map Marc Zyngier <marc.zyngier@arm.com> - 2016-10-26 16:10 +0200
Re: [PATCH v2 4/5] ARC: MCIP: Set an initial affinity value in idu_irq_map Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-10-26 18:20 +0200
Re: [PATCH v2 4/5] ARC: MCIP: Set an initial affinity value in idu_irq_map Marc Zyngier <marc.zyngier@arm.com> - 2016-10-26 18:40 +0200
Re: [PATCH v2 4/5] ARC: MCIP: Set an initial affinity value in idu_irq_map Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-10-26 19:30 +0200
Re: [PATCH v2 1/5] ARC: SMP: Use "unsigned virq" in smp_ipi_irq_setup instead of "signed irq" Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-10-24 22:10 +0200
Re: [PATCH v2 1/5] ARC: SMP: Use "unsigned virq" in smp_ipi_irq_setup instead of "signed irq" Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-10-25 04:30 +0200
RE: [PATCH v2 1/5] ARC: SMP: Use "unsigned virq" in smp_ipi_irq_setup instead of "signed irq" Yuriy Kolerov <Yuriy.Kolerov@synopsys.com> - 2016-10-25 19:30 +0200
csiph-web