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

* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6:
[IA64] ioremap() should prefer WB over UC
[IA64] Add __mca_table to the DISCARD list in gate.lds
[IA64] Move __mca_table out of the __init section
[IA64] simplify some condition checks in iosapic_check_gsi_range
[IA64] correct some messages and fixes some minor things
[IA64-SGI] fix for-loop in sn_hwperf_geoid_to_cnode()
[IA64-SGI] sn_hwperf use of num_online_cpus()
[IA64] optimize flush_tlb_range on large numa box
[IA64] lazy_mmu_prot_update needs to be aware of huge pages

+199 -123
+1
arch/ia64/kernel/gate.lds.S
··· 59 59 *(.dynbss) 60 60 *(.bss .bss.* .gnu.linkonce.b.*) 61 61 *(__ex_table) 62 + *(__mca_table) 62 63 } 63 64 } 64 65
+162 -103
arch/ia64/kernel/iosapic.c
··· 9 9 * Copyright (C) 1999 VA Linux Systems 10 10 * Copyright (C) 1999,2000 Walt Drummond <drummond@valinux.com> 11 11 * 12 - * 00/04/19 D. Mosberger Rewritten to mirror more closely the x86 I/O APIC code. 13 - * In particular, we now have separate handlers for edge 14 - * and level triggered interrupts. 15 - * 00/10/27 Asit Mallick, Goutham Rao <goutham.rao@intel.com> IRQ vector allocation 16 - * PCI to vector mapping, shared PCI interrupts. 17 - * 00/10/27 D. Mosberger Document things a bit more to make them more understandable. 18 - * Clean up much of the old IOSAPIC cruft. 19 - * 01/07/27 J.I. Lee PCI irq routing, Platform/Legacy interrupts and fixes for 20 - * ACPI S5(SoftOff) support. 12 + * 00/04/19 D. Mosberger Rewritten to mirror more closely the x86 I/O 13 + * APIC code. In particular, we now have separate 14 + * handlers for edge and level triggered 15 + * interrupts. 16 + * 00/10/27 Asit Mallick, Goutham Rao <goutham.rao@intel.com> IRQ vector 17 + * allocation PCI to vector mapping, shared PCI 18 + * interrupts. 19 + * 00/10/27 D. Mosberger Document things a bit more to make them more 20 + * understandable. Clean up much of the old 21 + * IOSAPIC cruft. 22 + * 01/07/27 J.I. Lee PCI irq routing, Platform/Legacy interrupts 23 + * and fixes for ACPI S5(SoftOff) support. 21 24 * 02/01/23 J.I. Lee iosapic pgm fixes for PCI irq routing from _PRT 22 - * 02/01/07 E. Focht <efocht@ess.nec.de> Redirectable interrupt vectors in 23 - * iosapic_set_affinity(), initializations for 24 - * /proc/irq/#/smp_affinity 25 + * 02/01/07 E. Focht <efocht@ess.nec.de> Redirectable interrupt 26 + * vectors in iosapic_set_affinity(), 27 + * initializations for /proc/irq/#/smp_affinity 25 28 * 02/04/02 P. Diefenbaugh Cleaned up ACPI PCI IRQ routing. 26 29 * 02/04/18 J.I. Lee bug fix in iosapic_init_pci_irq 27 - * 02/04/30 J.I. Lee bug fix in find_iosapic to fix ACPI PCI IRQ to IOSAPIC mapping 28 - * error 30 + * 02/04/30 J.I. Lee bug fix in find_iosapic to fix ACPI PCI IRQ to 31 + * IOSAPIC mapping error 29 32 * 02/07/29 T. Kochi Allocate interrupt vectors dynamically 30 - * 02/08/04 T. Kochi Cleaned up terminology (irq, global system interrupt, vector, etc.) 31 - * 02/09/20 D. Mosberger Simplified by taking advantage of ACPI's pci_irq code. 33 + * 02/08/04 T. Kochi Cleaned up terminology (irq, global system 34 + * interrupt, vector, etc.) 35 + * 02/09/20 D. Mosberger Simplified by taking advantage of ACPI's 36 + * pci_irq code. 32 37 * 03/02/19 B. Helgaas Make pcat_compat system-wide, not per-IOSAPIC. 33 - * Remove iosapic_address & gsi_base from external interfaces. 34 - * Rationalize __init/__devinit attributes. 38 + * Remove iosapic_address & gsi_base from 39 + * external interfaces. Rationalize 40 + * __init/__devinit attributes. 35 41 * 04/12/04 Ashok Raj <ashok.raj@intel.com> Intel Corporation 2004 36 - * Updated to work with irq migration necessary for CPU Hotplug 42 + * Updated to work with irq migration necessary 43 + * for CPU Hotplug 37 44 */ 38 45 /* 39 - * Here is what the interrupt logic between a PCI device and the kernel looks like: 46 + * Here is what the interrupt logic between a PCI device and the kernel looks 47 + * like: 40 48 * 41 - * (1) A PCI device raises one of the four interrupt pins (INTA, INTB, INTC, INTD). The 42 - * device is uniquely identified by its bus--, and slot-number (the function 43 - * number does not matter here because all functions share the same interrupt 44 - * lines). 49 + * (1) A PCI device raises one of the four interrupt pins (INTA, INTB, INTC, 50 + * INTD). The device is uniquely identified by its bus-, and slot-number 51 + * (the function number does not matter here because all functions share 52 + * the same interrupt lines). 45 53 * 46 - * (2) The motherboard routes the interrupt line to a pin on a IOSAPIC controller. 47 - * Multiple interrupt lines may have to share the same IOSAPIC pin (if they're level 48 - * triggered and use the same polarity). Each interrupt line has a unique Global 49 - * System Interrupt (GSI) number which can be calculated as the sum of the controller's 50 - * base GSI number and the IOSAPIC pin number to which the line connects. 54 + * (2) The motherboard routes the interrupt line to a pin on a IOSAPIC 55 + * controller. Multiple interrupt lines may have to share the same 56 + * IOSAPIC pin (if they're level triggered and use the same polarity). 57 + * Each interrupt line has a unique Global System Interrupt (GSI) number 58 + * which can be calculated as the sum of the controller's base GSI number 59 + * and the IOSAPIC pin number to which the line connects. 51 60 * 52 - * (3) The IOSAPIC uses an internal routing table entries (RTEs) to map the IOSAPIC pin 53 - * into the IA-64 interrupt vector. This interrupt vector is then sent to the CPU. 61 + * (3) The IOSAPIC uses an internal routing table entries (RTEs) to map the 62 + * IOSAPIC pin into the IA-64 interrupt vector. This interrupt vector is then 63 + * sent to the CPU. 54 64 * 55 - * (4) The kernel recognizes an interrupt as an IRQ. The IRQ interface is used as 56 - * architecture-independent interrupt handling mechanism in Linux. As an 57 - * IRQ is a number, we have to have IA-64 interrupt vector number <-> IRQ number 58 - * mapping. On smaller systems, we use one-to-one mapping between IA-64 vector and 59 - * IRQ. A platform can implement platform_irq_to_vector(irq) and 65 + * (4) The kernel recognizes an interrupt as an IRQ. The IRQ interface is 66 + * used as architecture-independent interrupt handling mechanism in Linux. 67 + * As an IRQ is a number, we have to have 68 + * IA-64 interrupt vector number <-> IRQ number mapping. On smaller 69 + * systems, we use one-to-one mapping between IA-64 vector and IRQ. A 70 + * platform can implement platform_irq_to_vector(irq) and 60 71 * platform_local_vector_to_irq(vector) APIs to differentiate the mapping. 61 72 * Please see also include/asm-ia64/hw_irq.h for those APIs. 62 73 * ··· 75 64 * 76 65 * PCI pin -> global system interrupt (GSI) -> IA-64 vector <-> IRQ 77 66 * 78 - * Note: The term "IRQ" is loosely used everywhere in Linux kernel to describe interrupts. 79 - * Now we use "IRQ" only for Linux IRQ's. ISA IRQ (isa_irq) is the only exception in this 80 - * source code. 67 + * Note: The term "IRQ" is loosely used everywhere in Linux kernel to 68 + * describeinterrupts. Now we use "IRQ" only for Linux IRQ's. ISA IRQ 69 + * (isa_irq) is the only exception in this source code. 81 70 */ 82 71 #include <linux/config.h> 83 72 ··· 101 90 #include <asm/ptrace.h> 102 91 #include <asm/system.h> 103 92 104 - 105 93 #undef DEBUG_INTERRUPT_ROUTING 106 94 107 95 #ifdef DEBUG_INTERRUPT_ROUTING ··· 109 99 #define DBG(fmt...) 110 100 #endif 111 101 112 - #define NR_PREALLOCATE_RTE_ENTRIES (PAGE_SIZE / sizeof(struct iosapic_rte_info)) 102 + #define NR_PREALLOCATE_RTE_ENTRIES \ 103 + (PAGE_SIZE / sizeof(struct iosapic_rte_info)) 113 104 #define RTE_PREALLOCATED (1) 114 105 115 106 static DEFINE_SPINLOCK(iosapic_lock); 116 107 117 - /* These tables map IA-64 vectors to the IOSAPIC pin that generates this vector. */ 108 + /* 109 + * These tables map IA-64 vectors to the IOSAPIC pin that generates this 110 + * vector. 111 + */ 118 112 119 113 struct iosapic_rte_info { 120 - struct list_head rte_list; /* node in list of RTEs sharing the same vector */ 114 + struct list_head rte_list; /* node in list of RTEs sharing the 115 + * same vector */ 121 116 char __iomem *addr; /* base address of IOSAPIC */ 122 - unsigned int gsi_base; /* first GSI assigned to this IOSAPIC */ 117 + unsigned int gsi_base; /* first GSI assigned to this 118 + * IOSAPIC */ 123 119 char rte_index; /* IOSAPIC RTE index */ 124 120 int refcnt; /* reference counter */ 125 121 unsigned int flags; /* flags */ 126 122 } ____cacheline_aligned; 127 123 128 124 static struct iosapic_intr_info { 129 - struct list_head rtes; /* RTEs using this vector (empty => not an IOSAPIC interrupt) */ 125 + struct list_head rtes; /* RTEs using this vector (empty => 126 + * not an IOSAPIC interrupt) */ 130 127 int count; /* # of RTEs that shares this vector */ 131 - u32 low32; /* current value of low word of Redirection table entry */ 128 + u32 low32; /* current value of low word of 129 + * Redirection table entry */ 132 130 unsigned int dest; /* destination CPU physical ID */ 133 131 unsigned char dmode : 3; /* delivery mode (see iosapic.h) */ 134 - unsigned char polarity: 1; /* interrupt polarity (see iosapic.h) */ 132 + unsigned char polarity: 1; /* interrupt polarity 133 + * (see iosapic.h) */ 135 134 unsigned char trigger : 1; /* trigger mode (see iosapic.h) */ 136 135 } iosapic_intr_info[IA64_NUM_VECTORS]; 137 136 138 137 static struct iosapic { 139 138 char __iomem *addr; /* base address of IOSAPIC */ 140 - unsigned int gsi_base; /* first GSI assigned to this IOSAPIC */ 141 - unsigned short num_rte; /* number of RTE in this IOSAPIC */ 139 + unsigned int gsi_base; /* first GSI assigned to this 140 + * IOSAPIC */ 141 + unsigned short num_rte; /* # of RTEs on this IOSAPIC */ 142 142 int rtes_inuse; /* # of RTEs in use on this IOSAPIC */ 143 143 #ifdef CONFIG_NUMA 144 144 unsigned short node; /* numa node association via pxm */ ··· 169 149 int i; 170 150 171 151 for (i = 0; i < NR_IOSAPICS; i++) { 172 - if ((unsigned) (gsi - iosapic_lists[i].gsi_base) < iosapic_lists[i].num_rte) 152 + if ((unsigned) (gsi - iosapic_lists[i].gsi_base) < 153 + iosapic_lists[i].num_rte) 173 154 return i; 174 155 } 175 156 ··· 183 162 struct iosapic_intr_info *info; 184 163 struct iosapic_rte_info *rte; 185 164 186 - for (info = iosapic_intr_info; info < iosapic_intr_info + IA64_NUM_VECTORS; ++info) 165 + for (info = iosapic_intr_info; info < 166 + iosapic_intr_info + IA64_NUM_VECTORS; ++info) 187 167 list_for_each_entry(rte, &info->rtes, rte_list) 188 168 if (rte->gsi_base + rte->rte_index == gsi) 189 169 return info - iosapic_intr_info; ··· 207 185 unsigned long flags; 208 186 int irq; 209 187 /* 210 - * XXX fix me: this assumes an identity mapping vetween IA-64 vector and Linux irq 211 - * numbers... 188 + * XXX fix me: this assumes an identity mapping between IA-64 vector 189 + * and Linux irq numbers... 212 190 */ 213 191 spin_lock_irqsave(&iosapic_lock, flags); 214 192 { ··· 219 197 return irq; 220 198 } 221 199 222 - static struct iosapic_rte_info *gsi_vector_to_rte(unsigned int gsi, unsigned int vec) 200 + static struct iosapic_rte_info *gsi_vector_to_rte(unsigned int gsi, 201 + unsigned int vec) 223 202 { 224 203 struct iosapic_rte_info *rte; 225 204 ··· 260 237 261 238 for (irq = 0; irq < NR_IRQS; ++irq) 262 239 if (irq_to_vector(irq) == vector) { 263 - set_irq_affinity_info(irq, (int)(dest & 0xffff), redir); 240 + set_irq_affinity_info(irq, 241 + (int)(dest & 0xffff), 242 + redir); 264 243 break; 265 244 } 266 245 } ··· 284 259 } 285 260 286 261 static void 287 - nop (unsigned int vector) 262 + nop (unsigned int irq) 288 263 { 289 264 /* do nothing... */ 290 265 } ··· 306 281 { 307 282 /* set only the mask bit */ 308 283 low32 = iosapic_intr_info[vec].low32 |= IOSAPIC_MASK; 309 - list_for_each_entry(rte, &iosapic_intr_info[vec].rtes, rte_list) { 284 + list_for_each_entry(rte, &iosapic_intr_info[vec].rtes, 285 + rte_list) { 310 286 addr = rte->addr; 311 287 rte_index = rte->rte_index; 312 288 iosapic_write(addr, IOSAPIC_RTE_LOW(rte_index), low32); ··· 332 306 spin_lock_irqsave(&iosapic_lock, flags); 333 307 { 334 308 low32 = iosapic_intr_info[vec].low32 &= ~IOSAPIC_MASK; 335 - list_for_each_entry(rte, &iosapic_intr_info[vec].rtes, rte_list) { 309 + list_for_each_entry(rte, &iosapic_intr_info[vec].rtes, 310 + rte_list) { 336 311 addr = rte->addr; 337 312 rte_index = rte->rte_index; 338 313 iosapic_write(addr, IOSAPIC_RTE_LOW(rte_index), low32); ··· 373 346 374 347 spin_lock_irqsave(&iosapic_lock, flags); 375 348 { 376 - low32 = iosapic_intr_info[vec].low32 & ~(7 << IOSAPIC_DELIVERY_SHIFT); 349 + low32 = iosapic_intr_info[vec].low32 & 350 + ~(7 << IOSAPIC_DELIVERY_SHIFT); 377 351 378 352 if (redir) 379 353 /* change delivery mode to lowest priority */ 380 - low32 |= (IOSAPIC_LOWEST_PRIORITY << IOSAPIC_DELIVERY_SHIFT); 354 + low32 |= (IOSAPIC_LOWEST_PRIORITY << 355 + IOSAPIC_DELIVERY_SHIFT); 381 356 else 382 357 /* change delivery mode to fixed */ 383 358 low32 |= (IOSAPIC_FIXED << IOSAPIC_DELIVERY_SHIFT); 384 359 385 360 iosapic_intr_info[vec].low32 = low32; 386 361 iosapic_intr_info[vec].dest = dest; 387 - list_for_each_entry(rte, &iosapic_intr_info[vec].rtes, rte_list) { 362 + list_for_each_entry(rte, &iosapic_intr_info[vec].rtes, 363 + rte_list) { 388 364 addr = rte->addr; 389 365 rte_index = rte->rte_index; 390 - iosapic_write(addr, IOSAPIC_RTE_HIGH(rte_index), high32); 366 + iosapic_write(addr, IOSAPIC_RTE_HIGH(rte_index), 367 + high32); 391 368 iosapic_write(addr, IOSAPIC_RTE_LOW(rte_index), low32); 392 369 } 393 370 } ··· 464 433 * interrupt for real. This prevents IRQ storms from unhandled 465 434 * devices. 466 435 */ 467 - if ((idesc->status & (IRQ_PENDING|IRQ_DISABLED)) == (IRQ_PENDING|IRQ_DISABLED)) 436 + if ((idesc->status & (IRQ_PENDING|IRQ_DISABLED)) == 437 + (IRQ_PENDING|IRQ_DISABLED)) 468 438 mask_irq(irq); 469 439 } 470 440 ··· 499 467 return iosapic_read(addr, IOSAPIC_VERSION); 500 468 } 501 469 502 - static int iosapic_find_sharable_vector (unsigned long trigger, unsigned long pol) 470 + static int iosapic_find_sharable_vector (unsigned long trigger, 471 + unsigned long pol) 503 472 { 504 473 int i, vector = -1, min_count = -1; 505 474 struct iosapic_intr_info *info; ··· 515 482 for (i = IA64_FIRST_DEVICE_VECTOR; i <= IA64_LAST_DEVICE_VECTOR; i++) { 516 483 info = &iosapic_intr_info[i]; 517 484 if (info->trigger == trigger && info->polarity == pol && 518 - (info->dmode == IOSAPIC_FIXED || info->dmode == IOSAPIC_LOWEST_PRIORITY)) { 485 + (info->dmode == IOSAPIC_FIXED || info->dmode == 486 + IOSAPIC_LOWEST_PRIORITY)) { 519 487 if (min_count == -1 || info->count < min_count) { 520 488 vector = i; 521 489 min_count = info->count; ··· 540 506 new_vector = assign_irq_vector(AUTO_ASSIGN); 541 507 if (new_vector < 0) 542 508 panic("%s: out of interrupt vectors!\n", __FUNCTION__); 543 - printk(KERN_INFO "Reassigning vector %d to %d\n", vector, new_vector); 509 + printk(KERN_INFO "Reassigning vector %d to %d\n", 510 + vector, new_vector); 544 511 memcpy(&iosapic_intr_info[new_vector], &iosapic_intr_info[vector], 545 512 sizeof(struct iosapic_intr_info)); 546 513 INIT_LIST_HEAD(&iosapic_intr_info[new_vector].rtes); 547 - list_move(iosapic_intr_info[vector].rtes.next, &iosapic_intr_info[new_vector].rtes); 548 - memset(&iosapic_intr_info[vector], 0, sizeof(struct iosapic_intr_info)); 514 + list_move(iosapic_intr_info[vector].rtes.next, 515 + &iosapic_intr_info[new_vector].rtes); 516 + memset(&iosapic_intr_info[vector], 0, 517 + sizeof(struct iosapic_intr_info)); 549 518 iosapic_intr_info[vector].low32 = IOSAPIC_MASK; 550 519 INIT_LIST_HEAD(&iosapic_intr_info[vector].rtes); 551 520 } ··· 561 524 int preallocated = 0; 562 525 563 526 if (!iosapic_kmalloc_ok && list_empty(&free_rte_list)) { 564 - rte = alloc_bootmem(sizeof(struct iosapic_rte_info) * NR_PREALLOCATE_RTE_ENTRIES); 527 + rte = alloc_bootmem(sizeof(struct iosapic_rte_info) * 528 + NR_PREALLOCATE_RTE_ENTRIES); 565 529 if (!rte) 566 530 return NULL; 567 531 for (i = 0; i < NR_PREALLOCATE_RTE_ENTRIES; i++, rte++) ··· 570 532 } 571 533 572 534 if (!list_empty(&free_rte_list)) { 573 - rte = list_entry(free_rte_list.next, struct iosapic_rte_info, rte_list); 535 + rte = list_entry(free_rte_list.next, struct iosapic_rte_info, 536 + rte_list); 574 537 list_del(&rte->rte_list); 575 538 preallocated++; 576 539 } else { ··· 614 575 615 576 index = find_iosapic(gsi); 616 577 if (index < 0) { 617 - printk(KERN_WARNING "%s: No IOSAPIC for GSI %u\n", __FUNCTION__, gsi); 578 + printk(KERN_WARNING "%s: No IOSAPIC for GSI %u\n", 579 + __FUNCTION__, gsi); 618 580 return -ENODEV; 619 581 } 620 582 ··· 626 586 if (!rte) { 627 587 rte = iosapic_alloc_rte(); 628 588 if (!rte) { 629 - printk(KERN_WARNING "%s: cannot allocate memory\n", __FUNCTION__); 589 + printk(KERN_WARNING "%s: cannot allocate memory\n", 590 + __FUNCTION__); 630 591 return -ENOMEM; 631 592 } 632 593 ··· 643 602 else if (vector_is_shared(vector)) { 644 603 struct iosapic_intr_info *info = &iosapic_intr_info[vector]; 645 604 if (info->trigger != trigger || info->polarity != polarity) { 646 - printk (KERN_WARNING "%s: cannot override the interrupt\n", __FUNCTION__); 605 + printk (KERN_WARNING 606 + "%s: cannot override the interrupt\n", 607 + __FUNCTION__); 647 608 return -EINVAL; 648 609 } 649 610 } ··· 662 619 idesc = irq_descp(vector); 663 620 if (idesc->handler != irq_type) { 664 621 if (idesc->handler != &no_irq_type) 665 - printk(KERN_WARNING "%s: changing vector %d from %s to %s\n", 666 - __FUNCTION__, vector, idesc->handler->typename, irq_type->typename); 622 + printk(KERN_WARNING 623 + "%s: changing vector %d from %s to %s\n", 624 + __FUNCTION__, vector, 625 + idesc->handler->typename, irq_type->typename); 667 626 idesc->handler = irq_type; 668 627 } 669 628 return 0; ··· 726 681 if (!num_cpus) 727 682 goto skip_numa_setup; 728 683 729 - /* Use vector assigment to distribute across cpus in node */ 684 + /* Use vector assignment to distribute across cpus in node */ 730 685 cpu_index = vector % num_cpus; 731 686 732 687 for (numa_cpu = first_cpu(cpu_mask) ; i < cpu_index ; i++) ··· 748 703 } while (!cpu_online(cpu)); 749 704 750 705 return cpu_physical_id(cpu); 751 - #else 706 + #else /* CONFIG_SMP */ 752 707 return cpu_physical_id(smp_processor_id()); 753 708 #endif 754 709 } ··· 800 755 if (list_empty(&iosapic_intr_info[vector].rtes)) 801 756 free_irq_vector(vector); 802 757 spin_unlock(&iosapic_lock); 803 - spin_unlock_irqrestore(&irq_descp(vector)->lock, flags); 758 + spin_unlock_irqrestore(&irq_descp(vector)->lock, 759 + flags); 804 760 goto again; 805 761 } 806 762 ··· 810 764 polarity, trigger); 811 765 if (err < 0) { 812 766 spin_unlock(&iosapic_lock); 813 - spin_unlock_irqrestore(&irq_descp(vector)->lock, flags); 767 + spin_unlock_irqrestore(&irq_descp(vector)->lock, 768 + flags); 814 769 return err; 815 770 } 816 771 ··· 853 806 */ 854 807 irq = gsi_to_irq(gsi); 855 808 if (irq < 0) { 856 - printk(KERN_ERR "iosapic_unregister_intr(%u) unbalanced\n", gsi); 809 + printk(KERN_ERR "iosapic_unregister_intr(%u) unbalanced\n", 810 + gsi); 857 811 WARN_ON(1); 858 812 return; 859 813 } ··· 865 817 spin_lock(&iosapic_lock); 866 818 { 867 819 if ((rte = gsi_vector_to_rte(gsi, vector)) == NULL) { 868 - printk(KERN_ERR "iosapic_unregister_intr(%u) unbalanced\n", gsi); 820 + printk(KERN_ERR 821 + "iosapic_unregister_intr(%u) unbalanced\n", 822 + gsi); 869 823 WARN_ON(1); 870 824 goto out; 871 825 } ··· 877 827 878 828 /* Mask the interrupt */ 879 829 low32 = iosapic_intr_info[vector].low32 | IOSAPIC_MASK; 880 - iosapic_write(rte->addr, IOSAPIC_RTE_LOW(rte->rte_index), low32); 830 + iosapic_write(rte->addr, IOSAPIC_RTE_LOW(rte->rte_index), 831 + low32); 881 832 882 833 /* Remove the rte entry from the list */ 883 834 list_del(&rte->rte_list); ··· 891 840 trigger = iosapic_intr_info[vector].trigger; 892 841 polarity = iosapic_intr_info[vector].polarity; 893 842 dest = iosapic_intr_info[vector].dest; 894 - printk(KERN_INFO "GSI %u (%s, %s) -> CPU %d (0x%04x) vector %d unregistered\n", 843 + printk(KERN_INFO 844 + "GSI %u (%s, %s) -> CPU %d (0x%04x)" 845 + " vector %d unregistered\n", 895 846 gsi, (trigger == IOSAPIC_EDGE ? "edge" : "level"), 896 847 (polarity == IOSAPIC_POL_HIGH ? "high" : "low"), 897 848 cpu_logical_id(dest), dest, vector); ··· 906 853 idesc->handler = &no_irq_type; 907 854 908 855 /* Clear the interrupt information */ 909 - memset(&iosapic_intr_info[vector], 0, sizeof(struct iosapic_intr_info)); 856 + memset(&iosapic_intr_info[vector], 0, 857 + sizeof(struct iosapic_intr_info)); 910 858 iosapic_intr_info[vector].low32 |= IOSAPIC_MASK; 911 859 INIT_LIST_HEAD(&iosapic_intr_info[vector].rtes); 912 860 913 861 if (idesc->action) { 914 - printk(KERN_ERR "interrupt handlers still exist on IRQ %u\n", irq); 862 + printk(KERN_ERR 863 + "interrupt handlers still exist on" 864 + "IRQ %u\n", irq); 915 865 WARN_ON(1); 916 866 } 917 867 ··· 929 873 930 874 /* 931 875 * ACPI calls this when it finds an entry for a platform interrupt. 932 - * Note that the irq_base and IOSAPIC address must be set in iosapic_init(). 933 876 */ 934 877 int __init 935 878 iosapic_register_platform_intr (u32 int_type, unsigned int gsi, ··· 962 907 mask = 1; 963 908 break; 964 909 default: 965 - printk(KERN_ERR "iosapic_register_platform_irq(): invalid int type 0x%x\n", int_type); 910 + printk(KERN_ERR "%s: invalid int type 0x%x\n", __FUNCTION__, 911 + int_type); 966 912 return -1; 967 913 } 968 914 969 915 register_intr(gsi, vector, delivery, polarity, trigger); 970 916 971 - printk(KERN_INFO "PLATFORM int %s (0x%x): GSI %u (%s, %s) -> CPU %d (0x%04x) vector %d\n", 917 + printk(KERN_INFO 918 + "PLATFORM int %s (0x%x): GSI %u (%s, %s) -> CPU %d (0x%04x)" 919 + " vector %d\n", 972 920 int_type < ARRAY_SIZE(name) ? name[int_type] : "unknown", 973 921 int_type, gsi, (trigger == IOSAPIC_EDGE ? "edge" : "level"), 974 922 (polarity == IOSAPIC_POL_HIGH ? "high" : "low"), ··· 981 923 return vector; 982 924 } 983 925 984 - 985 926 /* 986 927 * ACPI calls this when it finds an entry for a legacy ISA IRQ override. 987 - * Note that the gsi_base and IOSAPIC address must be set in iosapic_init(). 988 928 */ 989 929 void __init 990 930 iosapic_override_isa_irq (unsigned int isa_irq, unsigned int gsi, ··· 1011 955 1012 956 for (vector = 0; vector < IA64_NUM_VECTORS; ++vector) { 1013 957 iosapic_intr_info[vector].low32 = IOSAPIC_MASK; 1014 - INIT_LIST_HEAD(&iosapic_intr_info[vector].rtes); /* mark as unused */ 958 + /* mark as unused */ 959 + INIT_LIST_HEAD(&iosapic_intr_info[vector].rtes); 1015 960 } 1016 961 1017 962 pcat_compat = system_pcat_compat; 1018 963 if (pcat_compat) { 1019 964 /* 1020 - * Disable the compatibility mode interrupts (8259 style), needs IN/OUT support 1021 - * enabled. 965 + * Disable the compatibility mode interrupts (8259 style), 966 + * needs IN/OUT support enabled. 1022 967 */ 1023 - printk(KERN_INFO "%s: Disabling PC-AT compatible 8259 interrupts\n", __FUNCTION__); 968 + printk(KERN_INFO 969 + "%s: Disabling PC-AT compatible 8259 interrupts\n", 970 + __FUNCTION__); 1024 971 outb(0xff, 0xA1); 1025 972 outb(0xff, 0x21); 1026 973 } ··· 1063 1004 base = iosapic_lists[index].gsi_base; 1064 1005 end = base + iosapic_lists[index].num_rte - 1; 1065 1006 1066 - if (gsi_base < base && gsi_end < base) 1067 - continue;/* OK */ 1068 - 1069 - if (gsi_base > end && gsi_end > end) 1007 + if (gsi_end < base || end < gsi_base) 1070 1008 continue; /* OK */ 1071 1009 1072 1010 return -EBUSY; ··· 1109 1053 1110 1054 if ((gsi_base == 0) && pcat_compat) { 1111 1055 /* 1112 - * Map the legacy ISA devices into the IOSAPIC data. Some of these may 1113 - * get reprogrammed later on with data from the ACPI Interrupt Source 1114 - * Override table. 1056 + * Map the legacy ISA devices into the IOSAPIC data. Some of 1057 + * these may get reprogrammed later on with data from the ACPI 1058 + * Interrupt Source Override table. 1115 1059 */ 1116 1060 for (isa_irq = 0; isa_irq < 16; ++isa_irq) 1117 - iosapic_override_isa_irq(isa_irq, isa_irq, IOSAPIC_POL_HIGH, IOSAPIC_EDGE); 1061 + iosapic_override_isa_irq(isa_irq, isa_irq, 1062 + IOSAPIC_POL_HIGH, 1063 + IOSAPIC_EDGE); 1118 1064 } 1119 1065 return 0; 1120 1066 } ··· 1139 1081 1140 1082 if (iosapic_lists[index].rtes_inuse) { 1141 1083 err = -EBUSY; 1142 - printk(KERN_WARNING "%s: IOSAPIC for GSI base %u is busy\n", 1084 + printk(KERN_WARNING 1085 + "%s: IOSAPIC for GSI base %u is busy\n", 1143 1086 __FUNCTION__, gsi_base); 1144 1087 goto out; 1145 1088 }
+9 -9
arch/ia64/kernel/vmlinux.lds.S
··· 70 70 __stop___ex_table = .; 71 71 } 72 72 73 + /* MCA table */ 74 + . = ALIGN(16); 75 + __mca_table : AT(ADDR(__mca_table) - LOAD_OFFSET) 76 + { 77 + __start___mca_table = .; 78 + *(__mca_table) 79 + __stop___mca_table = .; 80 + } 81 + 73 82 /* Global data */ 74 83 _data = .; 75 84 ··· 137 128 *(.initcall6.init) 138 129 *(.initcall7.init) 139 130 __initcall_end = .; 140 - } 141 - 142 - /* MCA table */ 143 - . = ALIGN(16); 144 - __mca_table : AT(ADDR(__mca_table) - LOAD_OFFSET) 145 - { 146 - __start___mca_table = .; 147 - *(__mca_table) 148 - __stop___mca_table = .; 149 131 } 150 132 151 133 .data.patch.vtop : AT(ADDR(.data.patch.vtop) - LOAD_OFFSET)
+7 -1
arch/ia64/mm/init.c
··· 109 109 { 110 110 unsigned long addr; 111 111 struct page *page; 112 + unsigned long order; 112 113 113 114 if (!pte_exec(pte)) 114 115 return; /* not an executable page... */ ··· 120 119 if (test_bit(PG_arch_1, &page->flags)) 121 120 return; /* i-cache is already coherent with d-cache */ 122 121 123 - flush_icache_range(addr, addr + PAGE_SIZE); 122 + if (PageCompound(page)) { 123 + order = (unsigned long) (page[1].lru.prev); 124 + flush_icache_range(addr, addr + (1UL << order << PAGE_SHIFT)); 125 + } 126 + else 127 + flush_icache_range(addr, addr + PAGE_SIZE); 124 128 set_bit(PG_arch_1, &page->flags); /* mark page as clean */ 125 129 } 126 130
+3 -3
arch/ia64/mm/ioremap.c
··· 21 21 void __iomem * 22 22 ioremap (unsigned long offset, unsigned long size) 23 23 { 24 - if (efi_mem_attribute_range(offset, size, EFI_MEMORY_UC)) 25 - return __ioremap(offset, size); 26 - 27 24 if (efi_mem_attribute_range(offset, size, EFI_MEMORY_WB)) 28 25 return phys_to_virt(offset); 26 + 27 + if (efi_mem_attribute_range(offset, size, EFI_MEMORY_UC)) 28 + return __ioremap(offset, size); 29 29 30 30 /* 31 31 * Someday this should check ACPI resources so we
+7 -5
arch/ia64/mm/tlb.c
··· 156 156 nbits = purge.max_bits; 157 157 start &= ~((1UL << nbits) - 1); 158 158 159 - # ifdef CONFIG_SMP 160 - platform_global_tlb_purge(mm, start, end, nbits); 161 - # else 162 159 preempt_disable(); 160 + #ifdef CONFIG_SMP 161 + if (mm != current->active_mm || cpus_weight(mm->cpu_vm_mask) != 1) { 162 + platform_global_tlb_purge(mm, start, end, nbits); 163 + preempt_enable(); 164 + return; 165 + } 166 + #endif 163 167 do { 164 168 ia64_ptcl(start, (nbits<<2)); 165 169 start += (1UL << nbits); 166 170 } while (start < end); 167 171 preempt_enable(); 168 - # endif 169 - 170 172 ia64_srlz_i(); /* srlz.i implies srlz.d */ 171 173 } 172 174 EXPORT_SYMBOL(flush_tlb_range);
+6 -2
arch/ia64/sn/kernel/sn2/sn_hwperf.c
··· 110 110 if (sn_hwperf_location_to_bpos(location, &rack, &bay, &slot, &slab)) 111 111 return -1; 112 112 113 - for_each_node(cnode) { 113 + /* 114 + * FIXME: replace with cleaner for_each_XXX macro which addresses 115 + * both compute and IO nodes once ACPI3.0 is available. 116 + */ 117 + for (cnode = 0; cnode < num_cnodes; cnode++) { 114 118 geoid = cnodeid_get_geoid(cnode); 115 119 module_id = geo_module(geoid); 116 120 this_rack = MODULE_GET_RACK(module_id); ··· 609 605 op_info->a->arg &= SN_HWPERF_ARG_OBJID_MASK; 610 606 611 607 if (cpu != SN_HWPERF_ARG_ANY_CPU) { 612 - if (cpu >= num_online_cpus() || !cpu_online(cpu)) { 608 + if (cpu >= NR_CPUS || !cpu_online(cpu)) { 613 609 r = -EINVAL; 614 610 goto out; 615 611 }
+4
include/asm-ia64/asmmacro.h
··· 38 38 39 39 /* 40 40 * Helper macros for accessing user memory. 41 + * 42 + * When adding any new .section/.previous entries here, make sure to 43 + * also add it to the DISCARD section in arch/ia64/kernel/gate.lds.S or 44 + * unpleasant things will happen. 41 45 */ 42 46 43 47 .section "__ex_table", "a" // declare section & section attributes