diff options
Diffstat (limited to 'arch/x86/kernel/apic/io_apic.c')
-rw-r--r-- | arch/x86/kernel/apic/io_apic.c | 62 |
1 files changed, 30 insertions, 32 deletions
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index ef8d9290c7ea..d2ed6c5ddc80 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c | |||
@@ -462,7 +462,8 @@ static struct IO_APIC_route_entry ioapic_read_entry(int apic, int pin) | |||
462 | static void | 462 | static void |
463 | __ioapic_write_entry(int apic, int pin, struct IO_APIC_route_entry e) | 463 | __ioapic_write_entry(int apic, int pin, struct IO_APIC_route_entry e) |
464 | { | 464 | { |
465 | union entry_union eu; | 465 | union entry_union eu = {{0, 0}}; |
466 | |||
466 | eu.entry = e; | 467 | eu.entry = e; |
467 | io_apic_write(apic, 0x11 + 2*pin, eu.w2); | 468 | io_apic_write(apic, 0x11 + 2*pin, eu.w2); |
468 | io_apic_write(apic, 0x10 + 2*pin, eu.w1); | 469 | io_apic_write(apic, 0x10 + 2*pin, eu.w1); |
@@ -1413,6 +1414,9 @@ int setup_ioapic_entry(int apic_id, int irq, | |||
1413 | irte.vector = vector; | 1414 | irte.vector = vector; |
1414 | irte.dest_id = IRTE_DEST(destination); | 1415 | irte.dest_id = IRTE_DEST(destination); |
1415 | 1416 | ||
1417 | /* Set source-id of interrupt request */ | ||
1418 | set_ioapic_sid(&irte, apic_id); | ||
1419 | |||
1416 | modify_irte(irq, &irte); | 1420 | modify_irte(irq, &irte); |
1417 | 1421 | ||
1418 | ir_entry->index2 = (index >> 15) & 0x1; | 1422 | ir_entry->index2 = (index >> 15) & 0x1; |
@@ -1712,25 +1716,19 @@ __apicdebuginit(void) print_IO_APIC(void) | |||
1712 | return; | 1716 | return; |
1713 | } | 1717 | } |
1714 | 1718 | ||
1715 | __apicdebuginit(void) print_APIC_bitfield(int base) | 1719 | __apicdebuginit(void) print_APIC_field(int base) |
1716 | { | 1720 | { |
1717 | unsigned int v; | 1721 | int i; |
1718 | int i, j; | ||
1719 | 1722 | ||
1720 | if (apic_verbosity == APIC_QUIET) | 1723 | if (apic_verbosity == APIC_QUIET) |
1721 | return; | 1724 | return; |
1722 | 1725 | ||
1723 | printk(KERN_DEBUG "0123456789abcdef0123456789abcdef\n" KERN_DEBUG); | 1726 | printk(KERN_DEBUG); |
1724 | for (i = 0; i < 8; i++) { | 1727 | |
1725 | v = apic_read(base + i*0x10); | 1728 | for (i = 0; i < 8; i++) |
1726 | for (j = 0; j < 32; j++) { | 1729 | printk(KERN_CONT "%08x", apic_read(base + i*0x10)); |
1727 | if (v & (1<<j)) | 1730 | |
1728 | printk("1"); | 1731 | printk(KERN_CONT "\n"); |
1729 | else | ||
1730 | printk("0"); | ||
1731 | } | ||
1732 | printk("\n"); | ||
1733 | } | ||
1734 | } | 1732 | } |
1735 | 1733 | ||
1736 | __apicdebuginit(void) print_local_APIC(void *dummy) | 1734 | __apicdebuginit(void) print_local_APIC(void *dummy) |
@@ -1741,7 +1739,7 @@ __apicdebuginit(void) print_local_APIC(void *dummy) | |||
1741 | if (apic_verbosity == APIC_QUIET) | 1739 | if (apic_verbosity == APIC_QUIET) |
1742 | return; | 1740 | return; |
1743 | 1741 | ||
1744 | 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", |
1745 | smp_processor_id(), hard_smp_processor_id()); | 1743 | smp_processor_id(), hard_smp_processor_id()); |
1746 | v = apic_read(APIC_ID); | 1744 | v = apic_read(APIC_ID); |
1747 | 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()); |
@@ -1782,11 +1780,11 @@ __apicdebuginit(void) print_local_APIC(void *dummy) | |||
1782 | printk(KERN_DEBUG "... APIC SPIV: %08x\n", v); | 1780 | printk(KERN_DEBUG "... APIC SPIV: %08x\n", v); |
1783 | 1781 | ||
1784 | printk(KERN_DEBUG "... APIC ISR field:\n"); | 1782 | printk(KERN_DEBUG "... APIC ISR field:\n"); |
1785 | print_APIC_bitfield(APIC_ISR); | 1783 | print_APIC_field(APIC_ISR); |
1786 | printk(KERN_DEBUG "... APIC TMR field:\n"); | 1784 | printk(KERN_DEBUG "... APIC TMR field:\n"); |
1787 | print_APIC_bitfield(APIC_TMR); | 1785 | print_APIC_field(APIC_TMR); |
1788 | printk(KERN_DEBUG "... APIC IRR field:\n"); | 1786 | printk(KERN_DEBUG "... APIC IRR field:\n"); |
1789 | print_APIC_bitfield(APIC_IRR); | 1787 | print_APIC_field(APIC_IRR); |
1790 | 1788 | ||
1791 | if (APIC_INTEGRATED(ver)) { /* !82489DX */ | 1789 | if (APIC_INTEGRATED(ver)) { /* !82489DX */ |
1792 | if (maxlvt > 3) /* Due to the Pentium erratum 3AP. */ | 1790 | if (maxlvt > 3) /* Due to the Pentium erratum 3AP. */ |
@@ -2003,7 +2001,9 @@ void disable_IO_APIC(void) | |||
2003 | /* | 2001 | /* |
2004 | * Use virtual wire A mode when interrupt remapping is enabled. | 2002 | * Use virtual wire A mode when interrupt remapping is enabled. |
2005 | */ | 2003 | */ |
2006 | disconnect_bsp_APIC(!intr_remapping_enabled && ioapic_i8259.pin != -1); | 2004 | if (cpu_has_apic) |
2005 | disconnect_bsp_APIC(!intr_remapping_enabled && | ||
2006 | ioapic_i8259.pin != -1); | ||
2007 | } | 2007 | } |
2008 | 2008 | ||
2009 | #ifdef CONFIG_X86_32 | 2009 | #ifdef CONFIG_X86_32 |
@@ -3287,6 +3287,9 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq, struct msi_ms | |||
3287 | irte.vector = cfg->vector; | 3287 | irte.vector = cfg->vector; |
3288 | irte.dest_id = IRTE_DEST(dest); | 3288 | irte.dest_id = IRTE_DEST(dest); |
3289 | 3289 | ||
3290 | /* Set source-id of interrupt request */ | ||
3291 | set_msi_sid(&irte, pdev); | ||
3292 | |||
3290 | modify_irte(irq, &irte); | 3293 | modify_irte(irq, &irte); |
3291 | 3294 | ||
3292 | msg->address_hi = MSI_ADDR_BASE_HI; | 3295 | msg->address_hi = MSI_ADDR_BASE_HI; |
@@ -3567,7 +3570,7 @@ static int dmar_msi_set_affinity(unsigned int irq, const struct cpumask *mask) | |||
3567 | 3570 | ||
3568 | #endif /* CONFIG_SMP */ | 3571 | #endif /* CONFIG_SMP */ |
3569 | 3572 | ||
3570 | struct irq_chip dmar_msi_type = { | 3573 | static struct irq_chip dmar_msi_type = { |
3571 | .name = "DMAR_MSI", | 3574 | .name = "DMAR_MSI", |
3572 | .unmask = dmar_msi_unmask, | 3575 | .unmask = dmar_msi_unmask, |
3573 | .mask = dmar_msi_mask, | 3576 | .mask = dmar_msi_mask, |
@@ -3790,6 +3793,9 @@ int arch_enable_uv_irq(char *irq_name, unsigned int irq, int cpu, int mmr_blade, | |||
3790 | mmr_pnode = uv_blade_to_pnode(mmr_blade); | 3793 | mmr_pnode = uv_blade_to_pnode(mmr_blade); |
3791 | uv_write_global_mmr64(mmr_pnode, mmr_offset, mmr_value); | 3794 | uv_write_global_mmr64(mmr_pnode, mmr_offset, mmr_value); |
3792 | 3795 | ||
3796 | if (cfg->move_in_progress) | ||
3797 | send_cleanup_vector(cfg); | ||
3798 | |||
3793 | return irq; | 3799 | return irq; |
3794 | } | 3800 | } |
3795 | 3801 | ||
@@ -4178,28 +4184,20 @@ fake_ioapic_page: | |||
4178 | } | 4184 | } |
4179 | } | 4185 | } |
4180 | 4186 | ||
4181 | static int __init ioapic_insert_resources(void) | 4187 | void __init ioapic_insert_resources(void) |
4182 | { | 4188 | { |
4183 | int i; | 4189 | int i; |
4184 | struct resource *r = ioapic_resources; | 4190 | struct resource *r = ioapic_resources; |
4185 | 4191 | ||
4186 | if (!r) { | 4192 | if (!r) { |
4187 | if (nr_ioapics > 0) { | 4193 | if (nr_ioapics > 0) |
4188 | printk(KERN_ERR | 4194 | printk(KERN_ERR |
4189 | "IO APIC resources couldn't be allocated.\n"); | 4195 | "IO APIC resources couldn't be allocated.\n"); |
4190 | return -1; | 4196 | return; |
4191 | } | ||
4192 | return 0; | ||
4193 | } | 4197 | } |
4194 | 4198 | ||
4195 | for (i = 0; i < nr_ioapics; i++) { | 4199 | for (i = 0; i < nr_ioapics; i++) { |
4196 | insert_resource(&iomem_resource, r); | 4200 | insert_resource(&iomem_resource, r); |
4197 | r++; | 4201 | r++; |
4198 | } | 4202 | } |
4199 | |||
4200 | return 0; | ||
4201 | } | 4203 | } |
4202 | |||
4203 | /* Insert the IO APIC resources after PCI initialization has occured to handle | ||
4204 | * IO APICS that are mapped in on a BAR in PCI space. */ | ||
4205 | late_initcall(ioapic_insert_resources); | ||