From: Noam Camus <noamc@ezchip.com>
To: <linux-snps-arc@lists.infradead.org>
Cc: <linux-kernel@vger.kernel.org>, <cmetcalf@ezchip.com>,
<daniel.lezcano@linaro.org>, <marc.zyngier@arm.com>,
Noam Camus <noamc@ezchip.com>
Subject: [PATCH v5 10/20] ARC: IRQ: do not use hwirq directly at arch_do_IRQ()
Date: Sun, 27 Dec 2015 15:23:29 +0200 [thread overview]
Message-ID: <1451222619-3610-11-git-send-email-noamc@ezchip.com> (raw)
In-Reply-To: <1451222619-3610-1-git-send-email-noamc@ezchip.com>
From: Noam Camus <noamc@ezchip.com>
ARC uses hwirq at arch_do_IRQ() to pass into generic_handle_irq().
This is wrong since we need first to reverse map it into virq.
Happily, if we use handle_domain_irq() we get all we need.
Just like ARM I created a pointer to handler that should be filled
by an interrupt controller driver from driver/irqchip/
Signed-off-by: Noam Camus <noamc@ezchip.com>
---
arch/arc/Kconfig | 1 +
arch/arc/include/asm/irq.h | 5 +++++
arch/arc/kernel/irq.c | 14 ++++++++++++++
3 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
index 7be1020..079946e 100644
--- a/arch/arc/Kconfig
+++ b/arch/arc/Kconfig
@@ -32,6 +32,7 @@ config ARC
select HAVE_OPROFILE
select HAVE_PERF_EVENTS
select IRQ_DOMAIN
+ select HANDLE_DOMAIN_IRQ if ARC_PLAT_EZNPS
select MODULES_USE_ELF_RELA
select NO_BOOTMEM
select OF
diff --git a/arch/arc/include/asm/irq.h b/arch/arc/include/asm/irq.h
index c5f8f0f..64226c9 100644
--- a/arch/arc/include/asm/irq.h
+++ b/arch/arc/include/asm/irq.h
@@ -36,4 +36,9 @@ void arc_request_percpu_irq(int irq, int cpu,
irqreturn_t (*isr)(int irq, void *dev),
const char *irq_nm, void *percpu_dev);
+#ifdef CONFIG_HANDLE_DOMAIN_IRQ
+extern void set_handle_irq(void (*handle_irq)(unsigned int hwirq,
+ struct pt_regs *));
+#endif
+
#endif
diff --git a/arch/arc/kernel/irq.c b/arch/arc/kernel/irq.c
index ba17f85..7ae5411 100644
--- a/arch/arc/kernel/irq.c
+++ b/arch/arc/kernel/irq.c
@@ -41,6 +41,7 @@ void __init init_IRQ(void)
* "C" Entry point for any ARC ISR, called from low level vector handler
* @irq is the vector number read from ICAUSE reg of on-chip intc
*/
+#ifndef CONFIG_HANDLE_DOMAIN_IRQ
void arch_do_IRQ(unsigned int irq, struct pt_regs *regs)
{
struct pt_regs *old_regs = set_irq_regs(regs);
@@ -50,6 +51,19 @@ void arch_do_IRQ(unsigned int irq, struct pt_regs *regs)
irq_exit();
set_irq_regs(old_regs);
}
+#else
+void (*handle_arch_irq)(unsigned int hwirq, struct pt_regs *) = NULL;
+void arch_do_IRQ(unsigned int irq, struct pt_regs *regs)
+{
+ handle_arch_irq(irq, regs);
+}
+
+void __init set_handle_irq(void (*handle_irq)(unsigned int hwirq,
+ struct pt_regs *))
+{
+ handle_arch_irq = handle_irq;
+}
+#endif
/*
* API called for requesting percpu interrupts - called by each CPU
--
1.7.1
next prev parent reply other threads:[~2015-12-27 13:29 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-27 13:23 [PATCH v5 00/20] Adding plat-eznps to ARC Noam Camus
2015-12-27 13:23 ` [PATCH v5 01/20] Documentation: Add EZchip vendor to binding list Noam Camus
2015-12-27 13:23 ` [PATCH v5 02/20] soc: Support for EZchip SoC Noam Camus
2015-12-27 13:23 ` [PATCH v5 03/20] ARC: [plat-eznps] define IPI_IRQ Noam Camus
2015-12-27 13:23 ` [PATCH v5 04/20] clocksource: Add NPS400 timers driver Noam Camus
2015-12-27 14:55 ` kbuild test robot
2015-12-27 21:41 ` Noam Camus
2015-12-28 9:00 ` Daniel Lezcano
2015-12-28 10:35 ` Vineet Gupta
2015-12-28 10:55 ` Daniel Lezcano
2015-12-28 11:11 ` Vineet Gupta
2016-01-01 10:31 ` Vineet Gupta
2015-12-27 13:23 ` [PATCH v5 05/20] irqchip: add nps Internal and external irqchips Noam Camus
2015-12-30 10:08 ` Vineet Gupta
2015-12-30 10:41 ` Vineet Gupta
2015-12-27 13:23 ` [PATCH v5 06/20] ARC: Set vmalloc size from configuration Noam Camus
2015-12-27 13:23 ` [PATCH v5 07/20] ARC: rwlock: disable interrupts in !LLSC variant Noam Camus
2015-12-27 13:23 ` [PATCH v5 08/20] ARC: Mark secondary cpu online only after all HW setup is done Noam Camus
2015-12-27 13:23 ` [PATCH v5 09/20] ARC: IRQ: use device tree to get timer device configuration Noam Camus
2015-12-28 11:42 ` Vineet Gupta
2015-12-30 11:20 ` Vineet Gupta
2015-12-27 13:23 ` Noam Camus [this message]
2015-12-30 10:10 ` [PATCH v5 10/20] ARC: IRQ: do not use hwirq directly at arch_do_IRQ() Vineet Gupta
2015-12-31 5:21 ` Noam Camus
2015-12-27 13:23 ` [PATCH v5 11/20] ARC: IPI: do not use generic IRQ domain Noam Camus
2015-12-30 10:13 ` Vineet Gupta
2015-12-31 5:14 ` Noam Camus
2015-12-27 13:23 ` [PATCH v5 12/20] ARC: [plat-eznps] Add eznps board defconfig and dts Noam Camus
2015-12-27 13:23 ` [PATCH v5 13/20] ARC: [plat-eznps] Add eznps platform Noam Camus
2015-12-27 13:23 ` [PATCH v5 14/20] ARC: [plat-eznps] Use dedicated user stack top Noam Camus
2015-12-27 13:23 ` [PATCH v5 15/20] ARC: [plat-eznps] Use dedicated atomic/bitops/cmpxchg Noam Camus
2015-12-27 13:23 ` [PATCH v5 16/20] ARC: [plat-eznps] Use dedicated SMP barriers Noam Camus
2015-12-27 13:23 ` [PATCH v5 17/20] ARC: [plat-eznps] Use dedicated identity auxiliary register Noam Camus
2015-12-27 13:23 ` [PATCH v5 18/20] ARC: [plat-eznps] Use dedicated cpu_relax() Noam Camus
2015-12-27 13:23 ` [PATCH v5 19/20] ARC: [plat-eznps] Use dedicated COMMAND_LINE_SIZE Noam Camus
2015-12-27 13:23 ` [PATCH v5 20/20] ARC: Add eznps platform to Kconfig and Makefile Noam Camus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1451222619-3610-11-git-send-email-noamc@ezchip.com \
--to=noamc@ezchip.com \
--cc=cmetcalf@ezchip.com \
--cc=daniel.lezcano@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-snps-arc@lists.infradead.org \
--cc=marc.zyngier@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®