Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6

+137 -37
+14 -2
arch/ia64/hp/sim/hpsim_console.c
··· 21 21 #include <asm/machvec.h> 22 22 #include <asm/pgtable.h> 23 23 #include <asm/sal.h> 24 + #include <asm/hpsim.h> 24 25 25 26 #include "hpsim_ssc.h" 26 27 ··· 29 28 static void simcons_write (struct console *, const char *, unsigned); 30 29 static struct tty_driver *simcons_console_device (struct console *, int *); 31 30 32 - struct console hpsim_cons = { 31 + static struct console hpsim_cons = { 33 32 .name = "simcons", 34 33 .write = simcons_write, 35 34 .device = simcons_console_device, ··· 59 58 60 59 static struct tty_driver *simcons_console_device (struct console *c, int *index) 61 60 { 62 - extern struct tty_driver *hp_simserial_driver; 63 61 *index = c->index; 64 62 return hp_simserial_driver; 63 + } 64 + 65 + int simcons_register(void) 66 + { 67 + if (!ia64_platform_is("hpsim")) 68 + return 1; 69 + 70 + if (hpsim_cons.flags & CON_ENABLED) 71 + return 1; 72 + 73 + register_console(&hpsim_cons); 74 + return 0; 65 75 }
+2 -7
arch/ia64/hp/sim/hpsim_setup.c
··· 21 21 #include <asm/machvec.h> 22 22 #include <asm/pgtable.h> 23 23 #include <asm/sal.h> 24 + #include <asm/hpsim.h> 24 25 25 26 #include "hpsim_ssc.h" 26 27 ··· 42 41 { 43 42 ROOT_DEV = Root_SDA1; /* default to first SCSI drive */ 44 43 45 - #ifdef CONFIG_HP_SIMSERIAL_CONSOLE 46 - { 47 - extern struct console hpsim_cons; 48 - if (ia64_platform_is("hpsim")) 49 - register_console(&hpsim_cons); 50 - } 51 - #endif 44 + simcons_register(); 52 45 }
+3 -9
arch/ia64/hp/sim/simeth.c
··· 22 22 #include <linux/bitops.h> 23 23 #include <asm/system.h> 24 24 #include <asm/irq.h> 25 + #include <asm/hpsim.h> 26 + 27 + #include "hpsim_ssc.h" 25 28 26 29 #define SIMETH_RECV_MAX 10 27 30 ··· 37 34 */ 38 35 #define SIMETH_FRAME_SIZE ETH_FRAME_LEN 39 36 40 - 41 - #define SSC_NETDEV_PROBE 100 42 - #define SSC_NETDEV_SEND 101 43 - #define SSC_NETDEV_RECV 102 44 - #define SSC_NETDEV_ATTACH 103 45 - #define SSC_NETDEV_DETACH 104 46 37 47 38 #define NETWORK_INTR 8 48 39 ··· 120 123 121 124 return r; 122 125 } 123 - 124 - extern long ia64_ssc (long, long, long, long, int); 125 - extern void ia64_ssc_connect_irq (long intr, long irq); 126 126 127 127 static inline int 128 128 netdev_probe(char *name, unsigned char *ether)
+1 -2
arch/ia64/hp/sim/simscsi.c
··· 14 14 #include <linux/kernel.h> 15 15 #include <linux/timer.h> 16 16 #include <asm/irq.h> 17 + #include "hpsim_ssc.h" 17 18 18 19 #include <scsi/scsi.h> 19 20 #include <scsi/scsi_cmnd.h> ··· 59 58 int fd; 60 59 unsigned count; 61 60 }; 62 - 63 - extern long ia64_ssc (long arg0, long arg1, long arg2, long arg3, int nr); 64 61 65 62 static int desc[16] = { 66 63 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
+22 -6
arch/ia64/kernel/irq_ia64.c
··· 82 82 }; 83 83 84 84 DEFINE_PER_CPU(int[IA64_NUM_VECTORS], vector_irq) = { 85 - [0 ... IA64_NUM_VECTORS - 1] = IA64_SPURIOUS_INT_VECTOR 85 + [0 ... IA64_NUM_VECTORS - 1] = -1 86 86 }; 87 87 88 88 static cpumask_t vector_table[IA64_NUM_VECTORS] = { ··· 179 179 domain = cfg->domain; 180 180 cpus_and(mask, cfg->domain, cpu_online_map); 181 181 for_each_cpu_mask(cpu, mask) 182 - per_cpu(vector_irq, cpu)[vector] = IA64_SPURIOUS_INT_VECTOR; 182 + per_cpu(vector_irq, cpu)[vector] = -1; 183 183 cfg->vector = IRQ_VECTOR_UNASSIGNED; 184 184 cfg->domain = CPU_MASK_NONE; 185 185 irq_status[irq] = IRQ_UNUSED; ··· 249 249 250 250 /* Clear vector_irq */ 251 251 for (vector = 0; vector < IA64_NUM_VECTORS; ++vector) 252 - per_cpu(vector_irq, cpu)[vector] = IA64_SPURIOUS_INT_VECTOR; 252 + per_cpu(vector_irq, cpu)[vector] = -1; 253 253 /* Mark the inuse vectors */ 254 254 for (irq = 0; irq < NR_IRQS; ++irq) { 255 255 if (!cpu_isset(cpu, irq_cfg[irq].domain)) ··· 432 432 } else if (unlikely(IS_RESCHEDULE(vector))) 433 433 kstat_this_cpu.irqs[vector]++; 434 434 else { 435 + int irq = local_vector_to_irq(vector); 436 + 435 437 ia64_setreg(_IA64_REG_CR_TPR, vector); 436 438 ia64_srlz_d(); 437 439 438 - generic_handle_irq(local_vector_to_irq(vector)); 440 + if (unlikely(irq < 0)) { 441 + printk(KERN_ERR "%s: Unexpected interrupt " 442 + "vector %d on CPU %d is not mapped " 443 + "to any IRQ!\n", __FUNCTION__, vector, 444 + smp_processor_id()); 445 + } else 446 + generic_handle_irq(irq); 439 447 440 448 /* 441 449 * Disable interrupts and send EOI: ··· 491 483 kstat_this_cpu.irqs[vector]++; 492 484 else { 493 485 struct pt_regs *old_regs = set_irq_regs(NULL); 486 + int irq = local_vector_to_irq(vector); 494 487 495 488 ia64_setreg(_IA64_REG_CR_TPR, vector); 496 489 ia64_srlz_d(); ··· 502 493 * it will work. I hope it works!. 503 494 * Probably could shared code. 504 495 */ 505 - vectors_in_migration[local_vector_to_irq(vector)]=0; 506 - generic_handle_irq(local_vector_to_irq(vector)); 496 + if (unlikely(irq < 0)) { 497 + printk(KERN_ERR "%s: Unexpected interrupt " 498 + "vector %d on CPU %d not being mapped " 499 + "to any IRQ!!\n", __FUNCTION__, vector, 500 + smp_processor_id()); 501 + } else { 502 + vectors_in_migration[irq]=0; 503 + generic_handle_irq(irq); 504 + } 507 505 set_irq_regs(old_regs); 508 506 509 507 /*
+7 -6
arch/ia64/kernel/setup.c
··· 60 60 #include <asm/smp.h> 61 61 #include <asm/system.h> 62 62 #include <asm/unistd.h> 63 + #include <asm/hpsim.h> 63 64 64 65 #if defined(CONFIG_SMP) && (IA64_CPU_SIZE > PAGE_SIZE) 65 66 # error "struct cpuinfo_ia64 too big!" ··· 390 389 if (!efi_setup_pcdp_console(cmdline)) 391 390 earlycons++; 392 391 #endif 393 - #ifdef CONFIG_HP_SIMSERIAL_CONSOLE 394 - { 395 - extern struct console hpsim_cons; 396 - register_console(&hpsim_cons); 392 + if (!simcons_register()) 397 393 earlycons++; 398 - } 399 - #endif 400 394 401 395 return (earlycons) ? 0 : -1; 402 396 } ··· 956 960 957 961 /* clear TPR & XTP to enable all interrupt classes: */ 958 962 ia64_setreg(_IA64_REG_CR_TPR, 0); 963 + 964 + /* Clear any pending interrupts left by SAL/EFI */ 965 + while (ia64_get_ivr() != IA64_SPURIOUS_INT_VECTOR) 966 + ia64_eoi(); 967 + 959 968 #ifdef CONFIG_SMP 960 969 normal_xtp(); 961 970 #endif
+6
arch/ia64/kernel/smpboot.c
··· 58 58 #include <asm/system.h> 59 59 #include <asm/tlbflush.h> 60 60 #include <asm/unistd.h> 61 + #include <asm/sn/arch.h> 61 62 62 63 #define SMP_DEBUG 0 63 64 ··· 729 728 if (cpu == 0 && !bsp_remove_ok) { 730 729 printk ("Your platform does not support removal of BSP\n"); 731 730 return (-EBUSY); 731 + } 732 + 733 + if (ia64_platform_is("sn2")) { 734 + if (!sn_cpu_disable_allowed(cpu)) 735 + return -EBUSY; 732 736 } 733 737 734 738 cpu_clear(cpu, cpu_online_map);
+3
arch/ia64/mm/contig.c
··· 17 17 #include <linux/bootmem.h> 18 18 #include <linux/efi.h> 19 19 #include <linux/mm.h> 20 + #include <linux/nmi.h> 20 21 #include <linux/swap.h> 21 22 22 23 #include <asm/meminit.h> ··· 57 56 present = pgdat->node_present_pages; 58 57 for(i = 0; i < pgdat->node_spanned_pages; i++) { 59 58 struct page *page; 59 + if (unlikely(i % MAX_ORDER_NR_PAGES == 0)) 60 + touch_nmi_watchdog(); 60 61 if (pfn_valid(pgdat->node_start_pfn + i)) 61 62 page = pfn_to_page(pgdat->node_start_pfn + i); 62 63 else {
+3
arch/ia64/mm/discontig.c
··· 16 16 17 17 #include <linux/kernel.h> 18 18 #include <linux/mm.h> 19 + #include <linux/nmi.h> 19 20 #include <linux/swap.h> 20 21 #include <linux/bootmem.h> 21 22 #include <linux/acpi.h> ··· 534 533 present = pgdat->node_present_pages; 535 534 for(i = 0; i < pgdat->node_spanned_pages; i++) { 536 535 struct page *page; 536 + if (unlikely(i % MAX_ORDER_NR_PAGES == 0)) 537 + touch_nmi_watchdog(); 537 538 if (pfn_valid(pgdat->node_start_pfn + i)) 538 539 page = pfn_to_page(pgdat->node_start_pfn + i); 539 540 else {
+10 -4
arch/ia64/sn/kernel/huberror.c
··· 185 185 */ 186 186 void hub_error_init(struct hubdev_info *hubdev_info) 187 187 { 188 + 188 189 if (request_irq(SGI_II_ERROR, hub_eint_handler, IRQF_SHARED, 189 - "SN_hub_error", (void *)hubdev_info)) 190 + "SN_hub_error", (void *)hubdev_info)) { 190 191 printk("hub_error_init: Failed to request_irq for 0x%p\n", 191 192 hubdev_info); 192 - return; 193 + return; 194 + } 195 + sn_set_err_irq_affinity(SGI_II_ERROR); 193 196 } 194 197 195 198 ··· 205 202 */ 206 203 void ice_error_init(struct hubdev_info *hubdev_info) 207 204 { 205 + 208 206 if (request_irq 209 207 (SGI_TIO_ERROR, (void *)hub_eint_handler, IRQF_SHARED, "SN_TIO_error", 210 - (void *)hubdev_info)) 208 + (void *)hubdev_info)) { 211 209 printk("ice_error_init: request_irq() error hubdev_info 0x%p\n", 212 210 hubdev_info); 213 - return; 211 + return; 212 + } 213 + sn_set_err_irq_affinity(SGI_TIO_ERROR); 214 214 } 215 215
+15
arch/ia64/sn/kernel/irq.c
··· 19 19 #include <asm/sn/pcidev.h> 20 20 #include <asm/sn/shub_mmr.h> 21 21 #include <asm/sn/sn_sal.h> 22 + #include <asm/sn/sn_feature_sets.h> 22 23 23 24 static void force_interrupt(int irq); 24 25 static void register_intr_pda(struct sn_irq_info *sn_irq_info); ··· 233 232 sn_irq_lh[irq], list) 234 233 (void)sn_retarget_vector(sn_irq_info, nasid, slice); 235 234 } 235 + 236 + #ifdef CONFIG_SMP 237 + void sn_set_err_irq_affinity(unsigned int irq) 238 + { 239 + /* 240 + * On systems which support CPU disabling (SHub2), all error interrupts 241 + * are targetted at the boot CPU. 242 + */ 243 + if (is_shub2() && sn_prom_feature_available(PRF_CPU_DISABLE_SUPPORT)) 244 + set_irq_affinity_info(irq, cpu_physical_id(0), 0); 245 + } 246 + #else 247 + void sn_set_err_irq_affinity(unsigned int irq) { } 248 + #endif 236 249 237 250 static void 238 251 sn_mask_irq(unsigned int irq)
+26
arch/ia64/sn/kernel/sn2/sn2_smp.c
··· 40 40 #include <asm/sn/shub_mmr.h> 41 41 #include <asm/sn/nodepda.h> 42 42 #include <asm/sn/rw_mmr.h> 43 + #include <asm/sn/sn_feature_sets.h> 43 44 44 45 DEFINE_PER_CPU(struct ptc_stats, ptcstats); 45 46 DECLARE_PER_CPU(struct ptc_stats, ptcstats); ··· 429 428 430 429 sn_send_IPI_phys(nasid, physid, vector, delivery_mode); 431 430 } 431 + 432 + #ifdef CONFIG_HOTPLUG_CPU 433 + /** 434 + * sn_cpu_disable_allowed - Determine if a CPU can be disabled. 435 + * @cpu - CPU that is requested to be disabled. 436 + * 437 + * CPU disable is only allowed on SHub2 systems running with a PROM 438 + * that supports CPU disable. It is not permitted to disable the boot processor. 439 + */ 440 + bool sn_cpu_disable_allowed(int cpu) 441 + { 442 + if (is_shub2() && sn_prom_feature_available(PRF_CPU_DISABLE_SUPPORT)) { 443 + if (cpu != 0) 444 + return true; 445 + else 446 + printk(KERN_WARNING 447 + "Disabling the boot processor is not allowed.\n"); 448 + 449 + } else 450 + printk(KERN_WARNING 451 + "CPU disable is not supported on this system.\n"); 452 + 453 + return false; 454 + } 455 + #endif /* CONFIG_HOTPLUG_CPU */ 432 456 433 457 #ifdef CONFIG_PROC_FS 434 458
+2 -1
arch/ia64/sn/kernel/sn2/sn_hwperf.c
··· 66 66 } 67 67 68 68 sz = sn_hwperf_obj_cnt * sizeof(struct sn_hwperf_object_info); 69 - if ((objbuf = (struct sn_hwperf_object_info *) vmalloc(sz)) == NULL) { 69 + objbuf = vmalloc(sz); 70 + if (objbuf == NULL) { 70 71 printk("sn_hwperf_enum_objects: vmalloc(%d) failed\n", (int)sz); 71 72 e = -ENOMEM; 72 73 goto out;
+1
arch/ia64/sn/pci/pcibr/pcibr_provider.c
··· 145 145 printk(KERN_WARNING 146 146 "pcibr cannot allocate interrupt for error handler\n"); 147 147 } 148 + sn_set_err_irq_affinity(SGI_PCIASIC_ERROR); 148 149 149 150 /* 150 151 * Update the Bridge with the "kernel" pagesize
+2
arch/ia64/sn/pci/tioca_provider.c
··· 654 654 __FUNCTION__, SGI_TIOCA_ERROR, 655 655 (int)tioca_common->ca_common.bs_persist_busnum); 656 656 657 + sn_set_err_irq_affinity(SGI_TIOCA_ERROR); 658 + 657 659 /* Setup locality information */ 658 660 controller->node = tioca_kern->ca_closest_node; 659 661 return tioca_common;
+1
arch/ia64/sn/pci/tioce_provider.c
··· 1034 1034 tioce_common->ce_pcibus.bs_persist_segment, 1035 1035 tioce_common->ce_pcibus.bs_persist_busnum); 1036 1036 1037 + sn_set_err_irq_affinity(SGI_PCIASIC_ERROR); 1037 1038 return tioce_common; 1038 1039 } 1039 1040
+16
include/asm-ia64/hpsim.h
··· 1 + #ifndef _ASMIA64_HPSIM_H 2 + #define _ASMIA64_HPSIM_H 3 + 4 + #ifndef CONFIG_HP_SIMSERIAL_CONSOLE 5 + static inline int simcons_register(void) { return 1; } 6 + #else 7 + int simcons_register(void); 8 + #endif 9 + 10 + struct tty_driver; 11 + extern struct tty_driver *hp_simserial_driver; 12 + 13 + void ia64_ssc_connect_irq(long intr, long irq); 14 + void ia64_ctl_trace(long on); 15 + 16 + #endif
+1
include/asm-ia64/sn/arch.h
··· 81 81 extern u8 sn_region_size; 82 82 83 83 extern void sn_flush_all_caches(long addr, long bytes); 84 + extern bool sn_cpu_disable_allowed(int cpu); 84 85 85 86 #endif /* _ASM_IA64_SN_ARCH_H */
+1
include/asm-ia64/sn/intr.h
··· 60 60 int, nasid_t, int); 61 61 extern void sn_intr_free(nasid_t, int, struct sn_irq_info *); 62 62 extern struct sn_irq_info *sn_retarget_vector(struct sn_irq_info *, nasid_t, int); 63 + extern void sn_set_err_irq_affinity(unsigned int); 63 64 extern struct list_head **sn_irq_lh; 64 65 65 66 #define CPU_VECTOR_TO_IRQ(cpuid,vector) (vector)
+1
include/asm-ia64/sn/sn_feature_sets.h
··· 31 31 #define PRF_PAL_CACHE_FLUSH_SAFE 0 32 32 #define PRF_DEVICE_FLUSH_LIST 1 33 33 #define PRF_HOTPLUG_SUPPORT 2 34 + #define PRF_CPU_DISABLE_SUPPORT 3 34 35 35 36 /* --------------------- OS Features -------------------------------*/ 36 37