* [RFC PATCH 3/3] [ARM] Allow boards to specify the exact number of IRQs needed
@ 2010-02-04 19:12 Eric Miao
2010-02-05 8:14 ` Ben Dooks
2010-02-05 8:30 ` Ben Dooks
0 siblings, 2 replies; 4+ messages in thread
From: Eric Miao @ 2010-02-04 19:12 UTC (permalink / raw)
To: linux-arm-kernel
commit 988a6a2bd322d83eba42c05cb6cb77a74cba056b
Author: Eric Miao <eric.y.miao@gmail.com>
Date: Thu Feb 4 11:06:35 2010 -0800
[ARM] Allow boards to specify the exact number of IRQs needed
This will only take effect if SPARSE_IRQ is enabled, any board that
depends on this _only_ has to explicitly select SPARSE_IRQ.
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
diff --git a/arch/arm/include/asm/irq.h b/arch/arm/include/asm/irq.h
index a1ea728..825ee34 100644
--- a/arch/arm/include/asm/irq.h
+++ b/arch/arm/include/asm/irq.h
@@ -19,6 +19,7 @@
#ifndef __ASSEMBLY__
struct irqaction;
+extern int arch_nr_irqs;
extern void migrate_irqs(void);
extern void asm_do_IRQ(unsigned int, struct pt_regs *);
diff --git a/arch/arm/include/asm/mach/arch.h b/arch/arm/include/asm/mach/arch.h
index c59842d..a9128b4 100644
--- a/arch/arm/include/asm/mach/arch.h
+++ b/arch/arm/include/asm/mach/arch.h
@@ -20,6 +20,7 @@ struct machine_desc {
* by assembler code in head.S, head-common.S
*/
unsigned int nr; /* architecture number */
+ unsigned int num_irqs; /* number of IRQs */
unsigned int phys_io; /* start of physical io */
unsigned int io_pg_offst; /* byte offset for io
* page tabe entry */
diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
index e62f39b..e23d248 100644
--- a/arch/arm/kernel/irq.c
+++ b/arch/arm/kernel/irq.c
@@ -168,7 +168,7 @@ void __init init_IRQ(void)
#ifdef CONFIG_SPARSE_IRQ
int __init arch_probe_nr_irqs(void)
{
- nr_irqs = NR_IRQS;
+ nr_irqs = arch_nr_irqs ? arch_nr_irqs : NR_IRQS;
return 0;
}
#endif
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index c6c57b6..803ed95 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -755,6 +755,7 @@ void __init setup_arch(char **cmdline_p)
/*
* Set up various architecture-specific pointers
*/
+ arch_nr_irqs = mdesc->num_irqs;
init_arch_irq = mdesc->init_irq;
system_timer = mdesc->timer;
init_machine = mdesc->init_machine;
^ permalink raw reply related [flat|nested] 4+ messages in thread* [RFC PATCH 3/3] [ARM] Allow boards to specify the exact number of IRQs needed
2010-02-04 19:12 [RFC PATCH 3/3] [ARM] Allow boards to specify the exact number of IRQs needed Eric Miao
@ 2010-02-05 8:14 ` Ben Dooks
2010-02-05 8:30 ` Ben Dooks
1 sibling, 0 replies; 4+ messages in thread
From: Ben Dooks @ 2010-02-05 8:14 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Feb 04, 2010 at 11:12:37AM -0800, Eric Miao wrote:
> commit 988a6a2bd322d83eba42c05cb6cb77a74cba056b
> Author: Eric Miao <eric.y.miao@gmail.com>
> Date: Thu Feb 4 11:06:35 2010 -0800
>
> [ARM] Allow boards to specify the exact number of IRQs needed
>
> This will only take effect if SPARSE_IRQ is enabled, any board that
> depends on this _only_ has to explicitly select SPARSE_IRQ.
>
> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
Is this going to cause errors when the core support tries to register
irq chips over the number that the board itself supports?
> diff --git a/arch/arm/include/asm/irq.h b/arch/arm/include/asm/irq.h
> index a1ea728..825ee34 100644
> --- a/arch/arm/include/asm/irq.h
> +++ b/arch/arm/include/asm/irq.h
> @@ -19,6 +19,7 @@
>
> #ifndef __ASSEMBLY__
> struct irqaction;
> +extern int arch_nr_irqs;
> extern void migrate_irqs(void);
>
> extern void asm_do_IRQ(unsigned int, struct pt_regs *);
> diff --git a/arch/arm/include/asm/mach/arch.h b/arch/arm/include/asm/mach/arch.h
> index c59842d..a9128b4 100644
> --- a/arch/arm/include/asm/mach/arch.h
> +++ b/arch/arm/include/asm/mach/arch.h
> @@ -20,6 +20,7 @@ struct machine_desc {
> * by assembler code in head.S, head-common.S
> */
> unsigned int nr; /* architecture number */
> + unsigned int num_irqs; /* number of IRQs */
> unsigned int phys_io; /* start of physical io */
> unsigned int io_pg_offst; /* byte offset for io
> * page tabe entry */
> diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
> index e62f39b..e23d248 100644
> --- a/arch/arm/kernel/irq.c
> +++ b/arch/arm/kernel/irq.c
> @@ -168,7 +168,7 @@ void __init init_IRQ(void)
> #ifdef CONFIG_SPARSE_IRQ
> int __init arch_probe_nr_irqs(void)
> {
> - nr_irqs = NR_IRQS;
> + nr_irqs = arch_nr_irqs ? arch_nr_irqs : NR_IRQS;
> return 0;
> }
> #endif
> diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
> index c6c57b6..803ed95 100644
> --- a/arch/arm/kernel/setup.c
> +++ b/arch/arm/kernel/setup.c
> @@ -755,6 +755,7 @@ void __init setup_arch(char **cmdline_p)
> /*
> * Set up various architecture-specific pointers
> */
> + arch_nr_irqs = mdesc->num_irqs;
> init_arch_irq = mdesc->init_irq;
> system_timer = mdesc->timer;
> init_machine = mdesc->init_machine;
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
--
--
Ben
Q: What's a light-year?
A: One-third less calories than a regular year.
^ permalink raw reply [flat|nested] 4+ messages in thread* [RFC PATCH 3/3] [ARM] Allow boards to specify the exact number of IRQs needed
2010-02-04 19:12 [RFC PATCH 3/3] [ARM] Allow boards to specify the exact number of IRQs needed Eric Miao
2010-02-05 8:14 ` Ben Dooks
@ 2010-02-05 8:30 ` Ben Dooks
2010-02-05 9:50 ` Eric Miao
1 sibling, 1 reply; 4+ messages in thread
From: Ben Dooks @ 2010-02-05 8:30 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Feb 04, 2010 at 11:12:37AM -0800, Eric Miao wrote:
> commit 988a6a2bd322d83eba42c05cb6cb77a74cba056b
> Author: Eric Miao <eric.y.miao@gmail.com>
> Date: Thu Feb 4 11:06:35 2010 -0800
>
> [ARM] Allow boards to specify the exact number of IRQs needed
>
> This will only take effect if SPARSE_IRQ is enabled, any board that
> depends on this _only_ has to explicitly select SPARSE_IRQ.
>
> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
out of interest, what happens if the user wants to instantiate an irq
that is above the board's nr_irq setting?
--
Ben
Q: What's a light-year?
A: One-third less calories than a regular year.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [RFC PATCH 3/3] [ARM] Allow boards to specify the exact number of IRQs needed
2010-02-05 8:30 ` Ben Dooks
@ 2010-02-05 9:50 ` Eric Miao
0 siblings, 0 replies; 4+ messages in thread
From: Eric Miao @ 2010-02-05 9:50 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Feb 5, 2010 at 12:30 AM, Ben Dooks <ben-linux@fluff.org> wrote:
> On Thu, Feb 04, 2010 at 11:12:37AM -0800, Eric Miao wrote:
>> commit 988a6a2bd322d83eba42c05cb6cb77a74cba056b
>> Author: Eric Miao <eric.y.miao@gmail.com>
>> Date: ? Thu Feb 4 11:06:35 2010 -0800
>>
>> ? ? [ARM] Allow boards to specify the exact number of IRQs needed
>>
>> ? ? This will only take effect if SPARSE_IRQ is enabled, any board that
>> ? ? depends on this _only_ has to explicitly select SPARSE_IRQ.
>>
>> ? ? Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
>
> out of interest, what happens if the user wants to instantiate an irq
> that is above the board's nr_irq setting?
>
Normally, he doesn't. Well, the board's nr_irq should have included
all the possible IRQs used on that specific board.
Taking into account of expansion at run-time (e.g. insertion into a
baseboard dynamically), he's still able to do that with
irq_to_desc_alloc_node()
instead of irq_to_desc()
explicitly when adding elements to irq_desc[].
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-02-05 9:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-04 19:12 [RFC PATCH 3/3] [ARM] Allow boards to specify the exact number of IRQs needed Eric Miao
2010-02-05 8:14 ` Ben Dooks
2010-02-05 8:30 ` Ben Dooks
2010-02-05 9:50 ` Eric Miao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox