From: robherring2@gmail.com (Rob Herring)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 02/16] arm: add set_handle_irq() to register the parent IRQ controller handler function
Date: Tue, 20 Nov 2012 17:42:47 -0600 [thread overview]
Message-ID: <50AC1577.4080007@gmail.com> (raw)
In-Reply-To: <1353448867-15008-3-git-send-email-thomas.petazzoni@free-electrons.com>
On 11/20/2012 04:00 PM, Thomas Petazzoni wrote:
> In order to allow irqchip drivers to register their IRQ handling
> function as the parent IRQ controller handler function, we provide a
> convenience function. This will avoid poking directly into the global
> handle_arch_irq variable, and ensures that the user gets warned if
> we're trying to register a second IRQ controller as the parent one.
>
> Suggested by Arnd Bergmann.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
> arch/arm/include/asm/mach/irq.h | 1 +
> arch/arm/kernel/irq.c | 10 ++++++++++
> 2 files changed, 11 insertions(+)
>
> diff --git a/arch/arm/include/asm/mach/irq.h b/arch/arm/include/asm/mach/irq.h
> index 15cb035..18c8830 100644
> --- a/arch/arm/include/asm/mach/irq.h
> +++ b/arch/arm/include/asm/mach/irq.h
> @@ -22,6 +22,7 @@ extern int show_fiq_list(struct seq_file *, int);
>
> #ifdef CONFIG_MULTI_IRQ_HANDLER
> extern void (*handle_arch_irq)(struct pt_regs *);
> +extern void set_handle_irq(void (*handle_irq)(struct pt_regs *));
> #endif
>
> /*
> diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
> index 8961650..f135dab 100644
> --- a/arch/arm/kernel/irq.c
> +++ b/arch/arm/kernel/irq.c
> @@ -117,6 +117,16 @@ void __init init_IRQ(void)
> machine_desc->init_irq();
> }
>
> +#ifdef CONFIG_MULTI_IRQ_HANDLER
> +void __init set_handle_irq(void (*handle_irq)(struct pt_regs *))
> +{
> + if (WARN_ON(handle_arch_irq))
> + return;
I wonder if we should just return silently without warning and rely on
the top level controller being initialized 1st. For the DT case, this is
guaranteed. In the non-DT case, we don't really know if we are the
top-level controller at least in a consistent way. AFAIK, it happens
that the 1st instance of the VIC or GIC is always the top level and we
can use that (i.e. gic_nr == 0). However, theoretically you could have a
VIC connected to a top-level GIC or even vice-versa.
Rob
> +
> + handle_arch_irq = handle_irq;
> +}
> +#endif
> +
> #ifdef CONFIG_SPARSE_IRQ
> int __init arch_probe_nr_irqs(void)
> {
>
next prev parent reply other threads:[~2012-11-20 23:42 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-20 22:00 [PATCH v4] Introduce irqchip infrastructure Thomas Petazzoni
2012-11-20 22:00 ` [PATCH 01/16] irqchip: add basic infrastructure Thomas Petazzoni
2012-11-20 22:40 ` Stephen Warren
2012-11-20 22:54 ` Thomas Petazzoni
2012-11-20 22:00 ` [PATCH 02/16] arm: add set_handle_irq() to register the parent IRQ controller handler function Thomas Petazzoni
2012-11-20 23:42 ` Rob Herring [this message]
2012-11-20 22:00 ` [PATCH 03/16] arm: bcm2835: convert to the irqchip infrastructure Thomas Petazzoni
2012-11-20 22:00 ` [PATCH 04/16] arm: mvebu: move irq controller driver to drivers/irqchip Thomas Petazzoni
2012-11-20 22:00 ` [PATCH 05/16] irqchip: add to the directories part of the IRQ subsystem in MAINTAINERS Thomas Petazzoni
2012-11-20 22:00 ` [PATCH 06/16] ARM: gic: move register definitions into .c file Thomas Petazzoni
2012-11-20 23:35 ` Rob Herring
2012-11-20 22:00 ` [PATCH 07/16] ARM: gic: remove direct use of gic_raise_softirq Thomas Petazzoni
2012-11-20 22:00 ` [PATCH 08/16] irqchip: Move ARM GIC to drivers/irqchip Thomas Petazzoni
2012-11-20 22:01 ` [PATCH 09/16] irqchip: Move ARM VIC " Thomas Petazzoni
2012-11-23 12:01 ` Jamie Iles
2012-11-20 22:01 ` [PATCH 10/16] ARM: highbank: use common irqchip_init Thomas Petazzoni
2012-11-20 22:01 ` [PATCH 11/16] ARM: picoxcell: " Thomas Petazzoni
2012-11-23 12:04 ` Jamie Iles
2012-11-20 22:01 ` [PATCH 12/16] ARM: spear3xx: " Thomas Petazzoni
2012-11-20 22:01 ` [PATCH 13/16] ARM: spear6xx: " Thomas Petazzoni
2012-11-20 22:01 ` [PATCH 14/16] arm: vic: don't expose vic_of_init() anymore Thomas Petazzoni
2012-11-20 22:01 ` [PATCH 15/16] irqchip: vic: mark vic_of_init() as static Thomas Petazzoni
2012-11-21 12:40 ` Linus Walleij
2012-11-21 12:53 ` Thomas Petazzoni
2012-11-21 14:40 ` Linus Walleij
2012-11-21 14:46 ` Thomas Petazzoni
2012-11-21 15:07 ` Rob Herring
2012-11-21 15:20 ` Thomas Petazzoni
2012-11-20 22:01 ` [PATCH 16/16] ARM: plat-versatile: move FPGA irq driver to drivers/irqchip Thomas Petazzoni
2012-11-21 12:22 ` Linus Walleij
2012-11-21 12:47 ` Thomas Petazzoni
2012-11-20 22:38 ` [PATCH v4] Introduce irqchip infrastructure Rob Herring
2012-11-20 23:12 ` Thomas Petazzoni
2012-11-21 4:00 ` Rob Herring
2012-11-29 20:27 ` Grant Likely
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=50AC1577.4080007@gmail.com \
--to=robherring2@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.