diff options
| -rw-r--r-- | arch/x86/include/asm/io_apic.h | 2 | ||||
| -rw-r--r-- | arch/x86/kernel/apic/io_apic.c | 14 | ||||
| -rw-r--r-- | arch/x86/pci/i386.c | 7 |
3 files changed, 12 insertions, 11 deletions
diff --git a/arch/x86/include/asm/io_apic.h b/arch/x86/include/asm/io_apic.h index daf866ed0612..330ee807f89e 100644 --- a/arch/x86/include/asm/io_apic.h +++ b/arch/x86/include/asm/io_apic.h | |||
| @@ -161,6 +161,7 @@ extern int io_apic_set_pci_routing(struct device *dev, int irq, | |||
| 161 | struct io_apic_irq_attr *irq_attr); | 161 | struct io_apic_irq_attr *irq_attr); |
| 162 | extern int (*ioapic_renumber_irq)(int ioapic, int irq); | 162 | extern int (*ioapic_renumber_irq)(int ioapic, int irq); |
| 163 | extern void ioapic_init_mappings(void); | 163 | extern void ioapic_init_mappings(void); |
| 164 | extern void ioapic_insert_resources(void); | ||
| 164 | 165 | ||
| 165 | extern struct IO_APIC_route_entry **alloc_ioapic_entries(void); | 166 | extern struct IO_APIC_route_entry **alloc_ioapic_entries(void); |
| 166 | extern void free_ioapic_entries(struct IO_APIC_route_entry **ioapic_entries); | 167 | extern void free_ioapic_entries(struct IO_APIC_route_entry **ioapic_entries); |
| @@ -180,6 +181,7 @@ extern void ioapic_write_entry(int apic, int pin, | |||
| 180 | #define io_apic_assign_pci_irqs 0 | 181 | #define io_apic_assign_pci_irqs 0 |
| 181 | static const int timer_through_8259 = 0; | 182 | static const int timer_through_8259 = 0; |
| 182 | static inline void ioapic_init_mappings(void) { } | 183 | static inline void ioapic_init_mappings(void) { } |
| 184 | static inline void ioapic_insert_resources(void) { } | ||
| 183 | 185 | ||
| 184 | static inline void probe_nr_irqs_gsi(void) { } | 186 | static inline void probe_nr_irqs_gsi(void) { } |
| 185 | #endif | 187 | #endif |
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index 90b5e6efa938..2284a4812b68 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c | |||
| @@ -4181,28 +4181,20 @@ fake_ioapic_page: | |||
| 4181 | } | 4181 | } |
| 4182 | } | 4182 | } |
| 4183 | 4183 | ||
| 4184 | static int __init ioapic_insert_resources(void) | 4184 | void __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. */ | ||
| 4208 | late_initcall(ioapic_insert_resources); | ||
diff --git a/arch/x86/pci/i386.c b/arch/x86/pci/i386.c index 0fb56db16d18..52e62e57fedd 100644 --- a/arch/x86/pci/i386.c +++ b/arch/x86/pci/i386.c | |||
| @@ -35,6 +35,7 @@ | |||
| 35 | #include <asm/pat.h> | 35 | #include <asm/pat.h> |
| 36 | #include <asm/e820.h> | 36 | #include <asm/e820.h> |
| 37 | #include <asm/pci_x86.h> | 37 | #include <asm/pci_x86.h> |
| 38 | #include <asm/io_apic.h> | ||
| 38 | 39 | ||
| 39 | 40 | ||
| 40 | static int | 41 | static int |
| @@ -227,6 +228,12 @@ void __init pcibios_resource_survey(void) | |||
| 227 | pcibios_allocate_resources(1); | 228 | pcibios_allocate_resources(1); |
| 228 | 229 | ||
| 229 | e820_reserve_resources_late(); | 230 | e820_reserve_resources_late(); |
| 231 | /* | ||
| 232 | * Insert the IO APIC resources after PCI initialization has | ||
| 233 | * occured to handle IO APICS that are mapped in on a BAR in | ||
| 234 | * PCI space, but before trying to assign unassigned pci res. | ||
| 235 | */ | ||
| 236 | ioapic_insert_resources(); | ||
| 230 | } | 237 | } |
| 231 | 238 | ||
| 232 | /** | 239 | /** |
