diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-22 17:18:13 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-22 17:18:13 -0500 |
commit | dd508ae2dbff0cfc7401eb6e278339fc56bc5033 (patch) | |
tree | daa9f88a4e2e65e86b351ffa2d52dcc07e753c1e /arch/powerpc/sysdev/mpic.c | |
parent | 7801edb0b8b66e83c13623b483bc2e846c007c9d (diff) | |
parent | 95cd34b42b43c0ed5a89a764e023189bfe7b1530 (diff) |
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (36 commits)
powerpc/gc/wii: Remove get_irq_desc()
powerpc/gc/wii: hlwd-pic: convert irq_desc.lock to raw_spinlock
powerpc/gamecube/wii: Fix off-by-one error in ugecon/usbgecko_udbg
powerpc/mpic: Fix problem that affinity is not updated
powerpc/mm: Fix stupid bug in subpge protection handling
powerpc/iseries: use DECLARE_COMPLETION_ONSTACK for non-constant completion
powerpc: Fix MSI support on U4 bridge PCIe slot
powerpc: Handle VSX alignment faults correctly in little-endian mode
powerpc/mm: Fix typo of cpumask_clear_cpu()
powerpc/mm: Fix hash_utils_64.c compile errors with DEBUG enabled.
powerpc: Convert BUG() to use unreachable()
powerpc/pseries: Make declarations of cpu_hotplug_driver_lock() ANSI compatible.
powerpc/pseries: Don't panic when H_PROD fails during cpu-online.
powerpc/mm: Fix a WARN_ON() with CONFIG_DEBUG_PAGEALLOC and CONFIG_DEBUG_VM
powerpc/defconfigs: Set HZ=100 on pseries and ppc64 defconfigs
powerpc/defconfigs: Disable token ring in powerpc defconfigs
powerpc/defconfigs: Reduce 64bit vmlinux by making acenic and cramfs modules
powerpc/pseries: Select XICS and PCI_MSI PSERIES
powerpc/85xx: Wrong variable returned on error
powerpc/iseries: Convert to proc_fops
...
Diffstat (limited to 'arch/powerpc/sysdev/mpic.c')
-rw-r--r-- | arch/powerpc/sysdev/mpic.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c index aa9d06e5925b..470dc6c11d57 100644 --- a/arch/powerpc/sysdev/mpic.c +++ b/arch/powerpc/sysdev/mpic.c | |||
@@ -567,13 +567,11 @@ static void __init mpic_scan_ht_pics(struct mpic *mpic) | |||
567 | #endif /* CONFIG_MPIC_U3_HT_IRQS */ | 567 | #endif /* CONFIG_MPIC_U3_HT_IRQS */ |
568 | 568 | ||
569 | #ifdef CONFIG_SMP | 569 | #ifdef CONFIG_SMP |
570 | static int irq_choose_cpu(unsigned int virt_irq) | 570 | static int irq_choose_cpu(const cpumask_t *mask) |
571 | { | 571 | { |
572 | cpumask_t mask; | ||
573 | int cpuid; | 572 | int cpuid; |
574 | 573 | ||
575 | cpumask_copy(&mask, irq_to_desc(virt_irq)->affinity); | 574 | if (cpumask_equal(mask, cpu_all_mask)) { |
576 | if (cpus_equal(mask, CPU_MASK_ALL)) { | ||
577 | static int irq_rover; | 575 | static int irq_rover; |
578 | static DEFINE_SPINLOCK(irq_rover_lock); | 576 | static DEFINE_SPINLOCK(irq_rover_lock); |
579 | unsigned long flags; | 577 | unsigned long flags; |
@@ -594,20 +592,15 @@ static int irq_choose_cpu(unsigned int virt_irq) | |||
594 | 592 | ||
595 | spin_unlock_irqrestore(&irq_rover_lock, flags); | 593 | spin_unlock_irqrestore(&irq_rover_lock, flags); |
596 | } else { | 594 | } else { |
597 | cpumask_t tmp; | 595 | cpuid = cpumask_first_and(mask, cpu_online_mask); |
598 | 596 | if (cpuid >= nr_cpu_ids) | |
599 | cpus_and(tmp, cpu_online_map, mask); | ||
600 | |||
601 | if (cpus_empty(tmp)) | ||
602 | goto do_round_robin; | 597 | goto do_round_robin; |
603 | |||
604 | cpuid = first_cpu(tmp); | ||
605 | } | 598 | } |
606 | 599 | ||
607 | return get_hard_smp_processor_id(cpuid); | 600 | return get_hard_smp_processor_id(cpuid); |
608 | } | 601 | } |
609 | #else | 602 | #else |
610 | static int irq_choose_cpu(unsigned int virt_irq) | 603 | static int irq_choose_cpu(const cpumask_t *mask) |
611 | { | 604 | { |
612 | return hard_smp_processor_id(); | 605 | return hard_smp_processor_id(); |
613 | } | 606 | } |
@@ -816,7 +809,7 @@ int mpic_set_affinity(unsigned int irq, const struct cpumask *cpumask) | |||
816 | unsigned int src = mpic_irq_to_hw(irq); | 809 | unsigned int src = mpic_irq_to_hw(irq); |
817 | 810 | ||
818 | if (mpic->flags & MPIC_SINGLE_DEST_CPU) { | 811 | if (mpic->flags & MPIC_SINGLE_DEST_CPU) { |
819 | int cpuid = irq_choose_cpu(irq); | 812 | int cpuid = irq_choose_cpu(cpumask); |
820 | 813 | ||
821 | mpic_irq_write(src, MPIC_INFO(IRQ_DESTINATION), 1 << cpuid); | 814 | mpic_irq_write(src, MPIC_INFO(IRQ_DESTINATION), 1 << cpuid); |
822 | } else { | 815 | } else { |