Commit 27da03fc authored by Andi Kleen's avatar Andi Kleen Committed by Linus Torvalds

[PATCH] Make x86-64 compile again

Various compile fixes for x86-64 in the current BKCVS tree.

- Use new information from acpi_pci_link_get_irq: handle 
  edge and level triggered interrupts properly
- Fixes for pci_dev->pretty_name 

Only changes x86-64 specific code.
parent 42033685
...@@ -1735,7 +1735,7 @@ int __init io_apic_get_redir_entries (int ioapic) ...@@ -1735,7 +1735,7 @@ int __init io_apic_get_redir_entries (int ioapic)
} }
int io_apic_set_pci_routing (int ioapic, int pin, int irq) int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int active_high_low)
{ {
struct IO_APIC_route_entry entry; struct IO_APIC_route_entry entry;
unsigned long flags; unsigned long flags;
...@@ -1757,19 +1757,24 @@ int io_apic_set_pci_routing (int ioapic, int pin, int irq) ...@@ -1757,19 +1757,24 @@ int io_apic_set_pci_routing (int ioapic, int pin, int irq)
entry.delivery_mode = dest_LowestPrio; entry.delivery_mode = dest_LowestPrio;
entry.dest_mode = INT_DELIVERY_MODE; entry.dest_mode = INT_DELIVERY_MODE;
entry.dest.logical.logical_dest = TARGET_CPUS; entry.dest.logical.logical_dest = TARGET_CPUS;
entry.trigger = edge_level;
entry.polarity = active_high_low;
entry.mask = 1; /* Disabled (masked) */ entry.mask = 1; /* Disabled (masked) */
entry.trigger = 1; /* Level sensitive */
entry.polarity = 1; /* Low active */
add_pin_to_irq(irq, ioapic, pin); add_pin_to_irq(irq, ioapic, pin);
entry.vector = assign_irq_vector(irq); entry.vector = assign_irq_vector(irq);
printk(KERN_DEBUG "IOAPIC[%d]: Set PCI routing entry (%d-%d -> 0x%x -> " printk(KERN_DEBUG "IOAPIC[%d]: Set PCI routing entry (%d-%d -> 0x%x -> "
"IRQ %d)\n", ioapic, "IRQ %d Mode:%i Active:%i)\n", ioapic,
mp_ioapics[ioapic].mpc_apicid, pin, entry.vector, irq); mp_ioapics[ioapic].mpc_apicid, pin, entry.vector, irq,
edge_level, active_high_low);
irq_desc[irq].handler = &ioapic_level_irq_type;
if (edge_level) {
irq_desc[irq].handler = &ioapic_level_irq_type;
} else {
irq_desc[irq].handler = &ioapic_edge_irq_type;
}
set_intr_gate(entry.vector, interrupt[irq]); set_intr_gate(entry.vector, interrupt[irq]);
......
...@@ -886,6 +886,8 @@ void __init mp_parse_prt (void) ...@@ -886,6 +886,8 @@ void __init mp_parse_prt (void)
int ioapic_pin = 0; int ioapic_pin = 0;
int irq = 0; int irq = 0;
int idx, bit = 0; int idx, bit = 0;
int edge_level = 0;
int active_high_low = 0;
/* /*
* Parsing through the PCI Interrupt Routing Table (PRT) and program * Parsing through the PCI Interrupt Routing Table (PRT) and program
...@@ -896,12 +898,19 @@ void __init mp_parse_prt (void) ...@@ -896,12 +898,19 @@ void __init mp_parse_prt (void)
/* Need to get irq for dynamic entry */ /* Need to get irq for dynamic entry */
if (entry->link.handle) { if (entry->link.handle) {
irq = acpi_pci_link_get_irq(entry->link.handle, entry->link.index); irq = acpi_pci_link_get_irq(entry->link.handle, entry->link.index, &edge_level, &active_high_low);
if (!irq) if (!irq)
continue; continue;
} else {
/* Hardwired IRQ. Assume PCI standard settings */
irq = entry->link.index;
edge_level = 1;
active_high_low = 1;
} }
else
irq = entry->link.index; /* Don't set up the ACPI SCI because it's already set up */
if (acpi_fadt.sci_int == irq)
continue;
ioapic = mp_find_ioapic(irq); ioapic = mp_find_ioapic(irq);
if (ioapic < 0) if (ioapic < 0)
...@@ -930,7 +939,7 @@ void __init mp_parse_prt (void) ...@@ -930,7 +939,7 @@ void __init mp_parse_prt (void)
mp_ioapic_routing[ioapic].pin_programmed[idx] |= (1<<bit); mp_ioapic_routing[ioapic].pin_programmed[idx] |= (1<<bit);
vector = io_apic_set_pci_routing(ioapic, ioapic_pin, irq); vector = io_apic_set_pci_routing(ioapic, ioapic_pin, irq, edge_level, active_high_low);
if (vector) if (vector)
entry->irq = irq; entry->irq = irq;
......
...@@ -31,6 +31,12 @@ ...@@ -31,6 +31,12 @@
#include <asm/kdebug.h> #include <asm/kdebug.h>
#include <asm/proto.h> #include <asm/proto.h>
#ifdef CONFIG_PCI_NAMES
#define pci_pretty_name(dev) ((dev)->pretty_name)
#else
#define pci_pretty_name(dev) ""
#endif
dma_addr_t bad_dma_address; dma_addr_t bad_dma_address;
unsigned long iommu_bus_base; /* GART remapping area (physical) */ unsigned long iommu_bus_base; /* GART remapping area (physical) */
...@@ -270,7 +276,7 @@ static void iommu_full(struct pci_dev *dev, size_t size, int dir) ...@@ -270,7 +276,7 @@ static void iommu_full(struct pci_dev *dev, size_t size, int dir)
printk(KERN_ERR printk(KERN_ERR
"PCI-DMA: Out of IOMMU space for %lu bytes at device %s[%s]\n", "PCI-DMA: Out of IOMMU space for %lu bytes at device %s[%s]\n",
size, dev ? dev->dev.name : "?", dev ? dev->slot_name : "?"); size, dev ? pci_pretty_name(dev) : "", dev ? dev->slot_name : "?");
if (size > PAGE_SIZE*EMERGENCY_PAGES) { if (size > PAGE_SIZE*EMERGENCY_PAGES) {
if (dir == PCI_DMA_FROMDEVICE || dir == PCI_DMA_BIDIRECTIONAL) if (dir == PCI_DMA_FROMDEVICE || dir == PCI_DMA_BIDIRECTIONAL)
......
...@@ -165,19 +165,11 @@ extern int skip_ioapic_setup; ...@@ -165,19 +165,11 @@ extern int skip_ioapic_setup;
extern int io_apic_get_unique_id (int ioapic, int apic_id); extern int io_apic_get_unique_id (int ioapic, int apic_id);
extern int io_apic_get_version (int ioapic); extern int io_apic_get_version (int ioapic);
extern int io_apic_get_redir_entries (int ioapic); extern int io_apic_get_redir_entries (int ioapic);
extern int io_apic_set_pci_routing (int ioapic, int pin, int irq); extern int io_apic_set_pci_routing (int ioapic, int pin, int irq, int, int);
#endif
#ifdef CONFIG_ACPI_BOOT
extern int io_apic_get_unique_id (int ioapic, int apic_id);
extern int io_apic_get_version (int ioapic);
extern int io_apic_get_redir_entries (int ioapic);
extern int io_apic_set_pci_routing (int ioapic, int pin, int irq);
#endif #endif
extern int sis_apic_bug; /* dummy */ extern int sis_apic_bug; /* dummy */
#else /* !CONFIG_X86_IO_APIC */ #else /* !CONFIG_X86_IO_APIC */
#define io_apic_assign_pci_irqs 0 #define io_apic_assign_pci_irqs 0
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment