Commit 2540817d authored by Anton Blanchard's avatar Anton Blanchard Committed by Linus Torvalds

[PATCH] ppc64: Remove CONFIG_IRQ_ALL_CPUS

Replace CONFIG_IRQ_ALL_CPUS with a boot option (noirqdistrib).  Compile
options arent much use on a distro kernel.  This also removes the ppc64 use
of smp_threads_ready.

I considered removing the option completely but we have had problems in the
past with firmware bugs.  In those cases the boot option would have helped.
Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent ff341227
...@@ -186,14 +186,6 @@ config SMP ...@@ -186,14 +186,6 @@ config SMP
If you don't know what to do here, say Y. If you don't know what to do here, say Y.
config IRQ_ALL_CPUS
bool "Distribute interrupts on all CPUs by default"
depends on SMP && PPC_MULTIPLATFORM
help
This option gives the kernel permission to distribute IRQs across
multiple CPUs. Saying N here will route all IRQs to the first
CPU.
config NR_CPUS config NR_CPUS
int "Maximum number of CPUs (2-128)" int "Maximum number of CPUs (2-128)"
range 2 128 range 2 128
......
...@@ -62,6 +62,7 @@ extern void iSeries_smp_message_recv( struct pt_regs * ); ...@@ -62,6 +62,7 @@ extern void iSeries_smp_message_recv( struct pt_regs * );
extern irq_desc_t irq_desc[NR_IRQS]; extern irq_desc_t irq_desc[NR_IRQS];
int distribute_irqs = 1;
int __irq_offset_value; int __irq_offset_value;
int ppc_spurious_interrupts; int ppc_spurious_interrupts;
unsigned long lpevent_count; unsigned long lpevent_count;
...@@ -479,3 +480,10 @@ EXPORT_SYMBOL(do_softirq); ...@@ -479,3 +480,10 @@ EXPORT_SYMBOL(do_softirq);
#endif /* CONFIG_IRQSTACKS */ #endif /* CONFIG_IRQSTACKS */
static int __init setup_noirqdistrib(char *str)
{
distribute_irqs = 0;
return 1;
}
__setup("noirqdistrib", setup_noirqdistrib);
...@@ -765,10 +765,8 @@ void mpic_setup_this_cpu(void) ...@@ -765,10 +765,8 @@ void mpic_setup_this_cpu(void)
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
struct mpic *mpic = mpic_primary; struct mpic *mpic = mpic_primary;
unsigned long flags; unsigned long flags;
#ifdef CONFIG_IRQ_ALL_CPUS
u32 msk = 1 << hard_smp_processor_id(); u32 msk = 1 << hard_smp_processor_id();
unsigned int i; unsigned int i;
#endif
BUG_ON(mpic == NULL); BUG_ON(mpic == NULL);
...@@ -776,16 +774,16 @@ void mpic_setup_this_cpu(void) ...@@ -776,16 +774,16 @@ void mpic_setup_this_cpu(void)
spin_lock_irqsave(&mpic_lock, flags); spin_lock_irqsave(&mpic_lock, flags);
#ifdef CONFIG_IRQ_ALL_CPUS
/* let the mpic know we want intrs. default affinity is 0xffffffff /* let the mpic know we want intrs. default affinity is 0xffffffff
* until changed via /proc. That's how it's done on x86. If we want * until changed via /proc. That's how it's done on x86. If we want
* it differently, then we should make sure we also change the default * it differently, then we should make sure we also change the default
* values of irq_affinity in irq.c. * values of irq_affinity in irq.c.
*/ */
for (i = 0; i < mpic->num_sources ; i++) if (distribute_irqs) {
mpic_irq_write(i, MPIC_IRQ_DESTINATION, for (i = 0; i < mpic->num_sources ; i++)
mpic_irq_read(i, MPIC_IRQ_DESTINATION) | msk); mpic_irq_write(i, MPIC_IRQ_DESTINATION,
#endif /* CONFIG_IRQ_ALL_CPUS */ mpic_irq_read(i, MPIC_IRQ_DESTINATION) | msk);
}
/* Set current processor priority to 0 */ /* Set current processor priority to 0 */
mpic_cpu_write(MPIC_CPU_CURRENT_TASK_PRI, 0); mpic_cpu_write(MPIC_CPU_CURRENT_TASK_PRI, 0);
......
...@@ -259,7 +259,6 @@ static void __devinit smp_xics_setup_cpu(int cpu) ...@@ -259,7 +259,6 @@ static void __devinit smp_xics_setup_cpu(int cpu)
if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR)
vpa_init(cpu); vpa_init(cpu);
#ifdef CONFIG_IRQ_ALL_CPUS
/* /*
* Put the calling processor into the GIQ. This is really only * Put the calling processor into the GIQ. This is really only
* necessary from a secondary thread as the OF start-cpu interface * necessary from a secondary thread as the OF start-cpu interface
...@@ -267,7 +266,6 @@ static void __devinit smp_xics_setup_cpu(int cpu) ...@@ -267,7 +266,6 @@ static void __devinit smp_xics_setup_cpu(int cpu)
*/ */
rtas_set_indicator(GLOBAL_INTERRUPT_QUEUE, rtas_set_indicator(GLOBAL_INTERRUPT_QUEUE,
(1UL << interrupt_server_size) - 1 - default_distrib_server, 1); (1UL << interrupt_server_size) - 1 - default_distrib_server, 1);
#endif
} }
static spinlock_t timebase_lock = SPIN_LOCK_UNLOCKED; static spinlock_t timebase_lock = SPIN_LOCK_UNLOCKED;
......
...@@ -526,9 +526,6 @@ void __init smp_cpus_done(unsigned int max_cpus) ...@@ -526,9 +526,6 @@ void __init smp_cpus_done(unsigned int max_cpus)
smp_ops->setup_cpu(boot_cpuid); smp_ops->setup_cpu(boot_cpuid);
/* XXX fix this, xics currently relies on it - Anton */
smp_threads_ready = 1;
set_cpus_allowed(current, old_mask); set_cpus_allowed(current, old_mask);
/* /*
......
...@@ -242,28 +242,24 @@ static unsigned int real_irq_to_virt(unsigned int real_irq) ...@@ -242,28 +242,24 @@ static unsigned int real_irq_to_virt(unsigned int real_irq)
static int get_irq_server(unsigned int irq) static int get_irq_server(unsigned int irq)
{ {
unsigned int server; unsigned int server;
#ifdef CONFIG_IRQ_ALL_CPUS
/* For the moment only implement delivery to all cpus or one cpu */ /* For the moment only implement delivery to all cpus or one cpu */
if (smp_threads_ready) { cpumask_t cpumask = irq_affinity[irq];
cpumask_t cpumask = irq_affinity[irq]; cpumask_t tmp = CPU_MASK_NONE;
cpumask_t tmp = CPU_MASK_NONE;
if (cpus_equal(cpumask, CPU_MASK_ALL)) {
server = default_distrib_server;
} else {
cpus_and(tmp, cpu_online_map, cpumask);
if (cpus_empty(tmp)) if (!distribute_irqs)
server = default_distrib_server; return default_server;
else
server = get_hard_smp_processor_id(first_cpu(tmp)); if (cpus_equal(cpumask, CPU_MASK_ALL)) {
} server = default_distrib_server;
} else { } else {
server = default_server; cpus_and(tmp, cpu_online_map, cpumask);
if (cpus_empty(tmp))
server = default_distrib_server;
else
server = get_hard_smp_processor_id(first_cpu(tmp));
} }
#else
server = default_server;
#endif
return server; return server;
} }
......
...@@ -87,6 +87,8 @@ static __inline__ int irq_canonicalize(int irq) ...@@ -87,6 +87,8 @@ static __inline__ int irq_canonicalize(int irq)
return irq; return irq;
} }
extern int distribute_irqs;
struct irqaction; struct irqaction;
struct pt_regs; struct pt_regs;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment