GIT 9f8a5785fd687155d5047a4c319052bb422a1d61 git+ssh://master.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6.git#test commit 216fcd29af47ab53ffd87e82139fcc4095e34d91 Author: Kenji Kaneshige Date: Mon Jul 30 11:56:30 2007 +0900 [IA64] Fix possible race in destroy_and_reserve_irq() Currently, destroy_and_reserve_irq() sets irq_status[irq] UNUSED using clear_irq_vector() and sets irq_status[irq] RSVD using reserve_irq(). But there is a race window because vector_lock is once released between them. This patch fixes this race window. Signed-off-by: Kenji Kaneshige Signed-off-by: Tony Luck commit c4c376f7e16deeba8f0542eabcaca19b712e7be1 Author: Kenji Kaneshige Date: Mon Jul 30 11:54:41 2007 +0900 [IA64] Fix registered interrupt check Fix the problem that interrupts are not initialized correctly at PCI hotplug or driver reloading time. By vector domain change, the iosapic_rte_info structure was changed to be on the iosapic_intr_info[irq].rtes list even after the interrupts are unregistered. So iosapic_intr_info[irq].rtes list must not be checked to see if there are registered interrupts (RTEs) on the irq. We must check iosapic_intr_info[irq].count counter instead. Signed-off-by: Kenji Kaneshige Signed-off-by: Tony Luck commit 1b30859b8d42b3161954a81da7f96055a4617220 Author: Jesper Juhl Date: Mon Jul 30 00:28:42 2007 +0200 [IA64] Remove a few duplicate includes This patch removes a few duplicate includes from arch/ia64/ Acked-by: Jes Sorensen Signed-off-by: Jesper Juhl Signed-off-by: Tony Luck commit 8a2d8693054a6cd86cc959576322b30e66e31208 Author: Avi Kivity Date: Thu Jul 19 18:32:43 2007 +0300 [IA64] Allow smp_call_function_single() to current cpu This removes the requirement for callers to get_cpu() to check in simple cases. i386 and x86_64 already received a similar treatment. Signed-off-by: Avi Kivity Signed-off-by: Tony Luck commit 056e6d89aab51babaa5f75c16832b19c55a68bc4 Author: Sam Ravnborg Date: Mon Jul 30 22:50:13 2007 +0200 [IA64] fix a few section mismatch warnings Fix the following section mismatch warnings: WARNING: vmlinux.o(.text+0x41902): Section mismatch: reference to .init.text:__alloc_bootmem (between 'ia64_mca_cpu_init' and 'ia64_do_tlb_purge') WARNING: vmlinux.o(.text+0x49222): Section mismatch: reference to .init.text:__alloc_bootmem (between 'register_intr' and 'iosapic_register_intr') WARNING: vmlinux.o(.text+0x62beb2): Section mismatch: reference to .init.text:__alloc_bootmem_node (between 'hubdev_init_node' and 'cnodeid_get_geoid') Signed-off-by: Sam Ravnborg Signed-off-by: Tony Luck commit 3c3344ca815487568d617860894898737677600a Author: Tony Luck Date: Fri May 11 15:18:45 2007 -0700 [IA64] s/scalibility/scalability/ Previous spelling patch from Simon Arlott broke one spot that didn't need fixing (reported by Simon within 35 minutes of the patch ... but not until after I'd applied to GIT and pushed :-( Signed-off-by: Tony Luck commit a19d4e1a15544a12b811c161039212a2cf63e70c Author: Tony Luck Date: Tue Mar 6 15:41:24 2007 -0800 Revert "[IA64] add idle loop entry/exit notifier" By request from Stephane: This reverts commit 041be4f00312683016c49362f4575aa4cbc264b3. He has an alternative way to do this. Signed-off-by: Tony Luck commit 041be4f00312683016c49362f4575aa4cbc264b3 Author: Stephane Eranian Date: Wed Nov 15 14:23:34 2006 -0800 [IA64] add idle loop entry/exit notifier - add a notifier to the idle loop to get called when entering/leaving the lowest level of the idle loop - migrate SGI LED acitvity over to using the idle notifier Signed-off-by: stephane eranian Signed-off-by: Tony Luck commit 7ab62884069d6d300812fc2b07f1c2332e0882c6 Author: Maeda Naoaki Date: Thu Oct 26 14:50:43 2006 -0700 [IA64] Kdump don't clear vector in kexec_disable_iosapic Mask IOSAPIC will make the following EOI write to IOSAPIC fail because IOSAPIC will not be able to find RTE entry. However move EOI write before IOSAPIC mask will leave a small racy windows between them for interrupts. So mask IOSAPIC but leave the vector field. Signed-off-by: Zou Nan hai Signed-off-by: Tony Luck commit 1050658418ee3d0d385b8679edd1c86941860ab2 Author: Zou Nan hai Date: Wed Oct 25 12:25:59 2006 +0800 [IA64] Kdump Fix fc.i offset in relocate_kernel.S There is 8 byte wrong offset in icache flush instruction in relocate_kernel.S. Which may cause normal Kexec(not kdump) fail on Montecito Box. Signed-off-by: Zou Nan hai Signed-off-by: Tony Luck commit 40eee8ab3441cc4d4fcb7cfbdbd339e7b583f846 Author: Khalid Aziz Date: Thu Oct 12 13:19:45 2006 -0600 [IA64] Fix compile failure with CONFIG_KEXEC but not CONFIG_CRASH_DUMP 2.6.18 kernel patched with kexec/kdump patch from Tony's test tree fails to compile if CONFIG_KEXEC is turned on but CONFIG_CRASH_DUMP is not. Following patch fixes this. Signed-off-by: Khalid Aziz Acked-by: Simon Horman Signed-off-by: Tony Luck commit e1983ff22209e0de0595abe9b61d30078ef3ccb9 Author: Michal Piotrowski Date: Tue Oct 10 14:25:29 2006 -0700 [IA64] kill #include "linux/config.h" config.h is obsolete. This patch removes all #include "linux/config.h". (specifically the one in arch/ia64/kernel/relocate_kernel.S) Signed-off-by: Michal Piotrowski Cc: "Luck, Tony" Signed-off-by: Andrew Morton Signed-off-by: Tony Luck commit dc52454505ea87f0e6d4dab534acdd29ef33e7df Author: Zou Nan hai Date: Mon Oct 2 13:51:30 2006 -0700 [IA64] Kexec/Kdump for Itanium Distillation of work largely by Zou Nan hai (who gets Author credit because 'git' only seems to support one author) but also inspired by Khalid Aziz, Simon Horman, and a few others whom I'm too lazy to look up in the mailing list archives, but whose support I appreciate. Signed-off-by: Tony Luck arch/ia64/ia32/sys_ia32.c | 1 - arch/ia64/kernel/iosapic.c | 14 +++++++------- arch/ia64/kernel/irq_ia64.c | 17 ++++++----------- arch/ia64/kernel/mca.c | 17 +++++++++++------ arch/ia64/kernel/setup.c | 1 - arch/ia64/kernel/smp.c | 8 +++++--- arch/ia64/sn/kernel/io_common.c | 2 +- arch/ia64/sn/kernel/setup.c | 1 - 8 files changed, 30 insertions(+), 31 deletions(-) diff --git a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c index af10462..a3405b3 100644 --- a/arch/ia64/ia32/sys_ia32.c +++ b/arch/ia64/ia32/sys_ia32.c @@ -34,7 +34,6 @@ #include #include #include #include -#include #include #include #include diff --git a/arch/ia64/kernel/iosapic.c b/arch/ia64/kernel/iosapic.c index 91e6dc1..5f6d98e 100644 --- a/arch/ia64/kernel/iosapic.c +++ b/arch/ia64/kernel/iosapic.c @@ -142,7 +142,7 @@ struct iosapic_rte_info { static struct iosapic_intr_info { struct list_head rtes; /* RTEs using this vector (empty => * not an IOSAPIC interrupt) */ - int count; /* # of RTEs that shares this vector */ + int count; /* # of registered RTEs */ u32 low32; /* current value of low word of * Redirection table entry */ unsigned int dest; /* destination CPU physical ID */ @@ -313,7 +313,7 @@ mask_irq (unsigned int irq) int rte_index; struct iosapic_rte_info *rte; - if (list_empty(&iosapic_intr_info[irq].rtes)) + if (!iosapic_intr_info[irq].count) return; /* not an IOSAPIC interrupt! */ /* set only the mask bit */ @@ -331,7 +331,7 @@ unmask_irq (unsigned int irq) int rte_index; struct iosapic_rte_info *rte; - if (list_empty(&iosapic_intr_info[irq].rtes)) + if (!iosapic_intr_info[irq].count) return; /* not an IOSAPIC interrupt! */ low32 = iosapic_intr_info[irq].low32 &= ~IOSAPIC_MASK; @@ -363,7 +363,7 @@ #ifdef CONFIG_SMP dest = cpu_physical_id(first_cpu(mask)); - if (list_empty(&iosapic_intr_info[irq].rtes)) + if (!iosapic_intr_info[irq].count) return; /* not an IOSAPIC interrupt */ set_irq_affinity_info(irq, dest, redir); @@ -542,7 +542,7 @@ iosapic_reassign_vector (int irq) { int new_irq; - if (!list_empty(&iosapic_intr_info[irq].rtes)) { + if (iosapic_intr_info[irq].count) { new_irq = create_irq(); if (new_irq < 0) panic("%s: out of interrupt vectors!\n", __FUNCTION__); @@ -560,7 +560,7 @@ iosapic_reassign_vector (int irq) } } -static struct iosapic_rte_info *iosapic_alloc_rte (void) +static struct iosapic_rte_info * __init_refok iosapic_alloc_rte (void) { int i; struct iosapic_rte_info *rte; @@ -677,7 +677,7 @@ #ifdef CONFIG_SMP * In case of vector shared by multiple RTEs, all RTEs that * share the vector need to use the same destination CPU. */ - if (!list_empty(&iosapic_intr_info[irq].rtes)) + if (iosapic_intr_info[irq].count) return iosapic_intr_info[irq].dest; /* diff --git a/arch/ia64/kernel/irq_ia64.c b/arch/ia64/kernel/irq_ia64.c index 9386b95..c47c8ac 100644 --- a/arch/ia64/kernel/irq_ia64.c +++ b/arch/ia64/kernel/irq_ia64.c @@ -101,15 +101,6 @@ int check_irq_used(int irq) return -1; } -static void reserve_irq(unsigned int irq) -{ - unsigned long flags; - - spin_lock_irqsave(&vector_lock, flags); - irq_status[irq] = IRQ_RSVD; - spin_unlock_irqrestore(&vector_lock, flags); -} - static inline int find_unassigned_irq(void) { int irq; @@ -302,10 +293,14 @@ #endif void destroy_and_reserve_irq(unsigned int irq) { + unsigned long flags; + dynamic_irq_cleanup(irq); - clear_irq_vector(irq); - reserve_irq(irq); + spin_lock_irqsave(&vector_lock, flags); + __clear_irq_vector(irq); + irq_status[irq] = IRQ_RSVD; + spin_unlock_irqrestore(&vector_lock, flags); } static int __reassign_irq_vector(int irq, int cpu) diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c index 4b5daa3..ff28620 100644 --- a/arch/ia64/kernel/mca.c +++ b/arch/ia64/kernel/mca.c @@ -1750,8 +1750,17 @@ format_mca_init_stack(void *mca_data, un strncpy(p->comm, type, sizeof(p->comm)-1); } -/* Do per-CPU MCA-related initialization. */ +/* Caller prevents this from being called after init */ +static void * __init_refok mca_bootmem(void) +{ + void *p; + p = alloc_bootmem(sizeof(struct ia64_mca_cpu) * NR_CPUS + + KERNEL_STACK_SIZE); + return (void *)ALIGN((unsigned long)p, KERNEL_STACK_SIZE); +} + +/* Do per-CPU MCA-related initialization. */ void __cpuinit ia64_mca_cpu_init(void *cpu_data) { @@ -1763,11 +1772,7 @@ ia64_mca_cpu_init(void *cpu_data) int cpu; first_time = 0; - mca_data = alloc_bootmem(sizeof(struct ia64_mca_cpu) - * NR_CPUS + KERNEL_STACK_SIZE); - mca_data = (void *)(((unsigned long)mca_data + - KERNEL_STACK_SIZE - 1) & - (-KERNEL_STACK_SIZE)); + mca_data = mca_bootmem(); for (cpu = 0; cpu < NR_CPUS; cpu++) { format_mca_init_stack(mca_data, offsetof(struct ia64_mca_cpu, mca_stack), diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c index 7cecd29..cd9a37a 100644 --- a/arch/ia64/kernel/setup.c +++ b/arch/ia64/kernel/setup.c @@ -60,7 +60,6 @@ #include #include #include #include -#include #if defined(CONFIG_SMP) && (IA64_CPU_SIZE > PAGE_SIZE) # error "struct cpuinfo_ia64 too big!" diff --git a/arch/ia64/kernel/smp.c b/arch/ia64/kernel/smp.c index 0982882..4e446aa 100644 --- a/arch/ia64/kernel/smp.c +++ b/arch/ia64/kernel/smp.c @@ -346,7 +346,7 @@ smp_flush_tlb_mm (struct mm_struct *mm) } /* - * Run a function on another CPU + * Run a function on a specific CPU * The function to run. This must be fast and non-blocking. * An arbitrary pointer to pass to the function. * Currently unused. @@ -366,9 +366,11 @@ smp_call_function_single (int cpuid, voi int me = get_cpu(); /* prevent preemption and reschedule on another processor */ if (cpuid == me) { - printk(KERN_INFO "%s: trying to call self\n", __FUNCTION__); + local_irq_disable(); + func(info); + local_irq_enable(); put_cpu(); - return -EBUSY; + return 0; } data.func = func; diff --git a/arch/ia64/sn/kernel/io_common.c b/arch/ia64/sn/kernel/io_common.c index 787ed64..4594770 100644 --- a/arch/ia64/sn/kernel/io_common.c +++ b/arch/ia64/sn/kernel/io_common.c @@ -391,7 +391,7 @@ void sn_bus_free_sysdata(void) * hubdev_init_node() - Creates the HUB data structure and link them to it's * own NODE specific data area. */ -void hubdev_init_node(nodepda_t * npda, cnodeid_t node) +void __init hubdev_init_node(nodepda_t * npda, cnodeid_t node) { struct hubdev_info *hubdev_info; int size; diff --git a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c index 684b1c9..1f38a3a 100644 --- a/arch/ia64/sn/kernel/setup.c +++ b/arch/ia64/sn/kernel/setup.c @@ -25,7 +25,6 @@ #include #include #include #include -#include #include #include #include