aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/apic/io_apic.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/apic/io_apic.c')
-rw-r--r--arch/x86/kernel/apic/io_apic.c50
1 files changed, 21 insertions, 29 deletions
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index b7a79207295e..2284a4812b68 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -1414,6 +1414,9 @@ int setup_ioapic_entry(int apic_id, int irq,
1414 irte.vector = vector; 1414 irte.vector = vector;
1415 irte.dest_id = IRTE_DEST(destination); 1415 irte.dest_id = IRTE_DEST(destination);
1416 1416
1417 /* Set source-id of interrupt request */
1418 set_ioapic_sid(&irte, apic_id);
1419
1417 modify_irte(irq, &irte); 1420 modify_irte(irq, &irte);
1418 1421
1419 ir_entry->index2 = (index >> 15) & 0x1; 1422 ir_entry->index2 = (index >> 15) & 0x1;
@@ -1713,25 +1716,19 @@ __apicdebuginit(void) print_IO_APIC(void)
1713 return; 1716 return;
1714} 1717}
1715 1718
1716__apicdebuginit(void) print_APIC_bitfield(int base) 1719__apicdebuginit(void) print_APIC_field(int base)
1717{ 1720{
1718 unsigned int v; 1721 int i;
1719 int i, j;
1720 1722
1721 if (apic_verbosity == APIC_QUIET) 1723 if (apic_verbosity == APIC_QUIET)
1722 return; 1724 return;
1723 1725
1724 printk(KERN_DEBUG "0123456789abcdef0123456789abcdef\n" KERN_DEBUG); 1726 printk(KERN_DEBUG);
1725 for (i = 0; i < 8; i++) { 1727
1726 v = apic_read(base + i*0x10); 1728 for (i = 0; i < 8; i++)
1727 for (j = 0; j < 32; j++) { 1729 printk(KERN_CONT "%08x", apic_read(base + i*0x10));
1728 if (v & (1<<j)) 1730
1729 printk("1"); 1731 printk(KERN_CONT "\n");
1730 else
1731 printk("0");
1732 }
1733 printk("\n");
1734 }
1735} 1732}
1736 1733
1737__apicdebuginit(void) print_local_APIC(void *dummy) 1734__apicdebuginit(void) print_local_APIC(void *dummy)
@@ -1742,7 +1739,7 @@ __apicdebuginit(void) print_local_APIC(void *dummy)
1742 if (apic_verbosity == APIC_QUIET) 1739 if (apic_verbosity == APIC_QUIET)
1743 return; 1740 return;
1744 1741
1745 printk("\n" KERN_DEBUG "printing local APIC contents on CPU#%d/%d:\n", 1742 printk(KERN_DEBUG "printing local APIC contents on CPU#%d/%d:\n",
1746 smp_processor_id(), hard_smp_processor_id()); 1743 smp_processor_id(), hard_smp_processor_id());
1747 v = apic_read(APIC_ID); 1744 v = apic_read(APIC_ID);
1748 printk(KERN_INFO "... APIC ID: %08x (%01x)\n", v, read_apic_id()); 1745 printk(KERN_INFO "... APIC ID: %08x (%01x)\n", v, read_apic_id());
@@ -1783,11 +1780,11 @@ __apicdebuginit(void) print_local_APIC(void *dummy)
1783 printk(KERN_DEBUG "... APIC SPIV: %08x\n", v); 1780 printk(KERN_DEBUG "... APIC SPIV: %08x\n", v);
1784 1781
1785 printk(KERN_DEBUG "... APIC ISR field:\n"); 1782 printk(KERN_DEBUG "... APIC ISR field:\n");
1786 print_APIC_bitfield(APIC_ISR); 1783 print_APIC_field(APIC_ISR);
1787 printk(KERN_DEBUG "... APIC TMR field:\n"); 1784 printk(KERN_DEBUG "... APIC TMR field:\n");
1788 print_APIC_bitfield(APIC_TMR); 1785 print_APIC_field(APIC_TMR);
1789 printk(KERN_DEBUG "... APIC IRR field:\n"); 1786 printk(KERN_DEBUG "... APIC IRR field:\n");
1790 print_APIC_bitfield(APIC_IRR); 1787 print_APIC_field(APIC_IRR);
1791 1788
1792 if (APIC_INTEGRATED(ver)) { /* !82489DX */ 1789 if (APIC_INTEGRATED(ver)) { /* !82489DX */
1793 if (maxlvt > 3) /* Due to the Pentium erratum 3AP. */ 1790 if (maxlvt > 3) /* Due to the Pentium erratum 3AP. */
@@ -3290,6 +3287,9 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq, struct msi_ms
3290 irte.vector = cfg->vector; 3287 irte.vector = cfg->vector;
3291 irte.dest_id = IRTE_DEST(dest); 3288 irte.dest_id = IRTE_DEST(dest);
3292 3289
3290 /* Set source-id of interrupt request */
3291 set_msi_sid(&irte, pdev);
3292
3293 modify_irte(irq, &irte); 3293 modify_irte(irq, &irte);
3294 3294
3295 msg->address_hi = MSI_ADDR_BASE_HI; 3295 msg->address_hi = MSI_ADDR_BASE_HI;
@@ -4181,28 +4181,20 @@ fake_ioapic_page:
4181 } 4181 }
4182} 4182}
4183 4183
4184static int __init ioapic_insert_resources(void) 4184void __init ioapic_insert_resources(void)
4185{ 4185{
4186 int i; 4186 int i;
4187 struct resource *r = ioapic_resources; 4187 struct resource *r = ioapic_resources;
4188 4188
4189 if (!r) { 4189 if (!r) {
4190 if (nr_ioapics > 0) { 4190 if (nr_ioapics > 0)
4191 printk(KERN_ERR 4191 printk(KERN_ERR
4192 "IO APIC resources couldn't be allocated.\n"); 4192 "IO APIC resources couldn't be allocated.\n");
4193 return -1; 4193 return;
4194 }
4195 return 0;
4196 } 4194 }
4197 4195
4198 for (i = 0; i < nr_ioapics; i++) { 4196 for (i = 0; i < nr_ioapics; i++) {
4199 insert_resource(&iomem_resource, r); 4197 insert_resource(&iomem_resource, r);
4200 r++; 4198 r++;
4201 } 4199 }
4202
4203 return 0;
4204} 4200}
4205
4206/* Insert the IO APIC resources after PCI initialization has occured to handle
4207 * IO APICS that are mapped in on a BAR in PCI space. */
4208late_initcall(ioapic_insert_resources);