diff options
| -rw-r--r-- | arch/i386/kernel/quirks.c | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/arch/i386/kernel/quirks.c b/arch/i386/kernel/quirks.c index a01320a7b636..34874c398b44 100644 --- a/arch/i386/kernel/quirks.c +++ b/arch/i386/kernel/quirks.c | |||
| @@ -10,13 +10,38 @@ | |||
| 10 | #if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_SMP) && defined(CONFIG_PCI) | 10 | #if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_SMP) && defined(CONFIG_PCI) |
| 11 | static void __devinit verify_quirk_intel_irqbalance(struct pci_dev *dev) | 11 | static void __devinit verify_quirk_intel_irqbalance(struct pci_dev *dev) |
| 12 | { | 12 | { |
| 13 | u8 config, rev; | ||
| 14 | u32 word; | ||
| 15 | |||
| 16 | /* BIOS may enable hardware IRQ balancing for | ||
| 17 | * E7520/E7320/E7525(revision ID 0x9 and below) | ||
| 18 | * based platforms. | ||
| 19 | * For those platforms, make sure that the genapic is set to 'flat' | ||
| 20 | */ | ||
| 21 | pci_read_config_byte(dev, PCI_CLASS_REVISION, &rev); | ||
| 22 | if (rev > 0x9) | ||
| 23 | return; | ||
| 24 | |||
| 25 | /* enable access to config space*/ | ||
| 26 | pci_read_config_byte(dev, 0xf4, &config); | ||
| 27 | pci_write_config_byte(dev, 0xf4, config|0x2); | ||
| 28 | |||
| 29 | /* read xTPR register */ | ||
| 30 | raw_pci_ops->read(0, 0, 0x40, 0x4c, 2, &word); | ||
| 31 | |||
| 32 | if (!(word & (1 << 13))) { | ||
| 13 | #ifdef CONFIG_X86_64 | 33 | #ifdef CONFIG_X86_64 |
| 14 | if (genapic != &apic_flat) | 34 | if (genapic != &apic_flat) |
| 15 | panic("APIC mode must be flat on this system\n"); | 35 | panic("APIC mode must be flat on this system\n"); |
| 16 | #elif defined(CONFIG_X86_GENERICARCH) | 36 | #elif defined(CONFIG_X86_GENERICARCH) |
| 17 | if (genapic != &apic_default) | 37 | if (genapic != &apic_default) |
| 18 | panic("APIC mode must be default(flat) on this system. Use apic=default\n"); | 38 | panic("APIC mode must be default(flat) on this system. Use apic=default\n"); |
| 19 | #endif | 39 | #endif |
| 40 | } | ||
| 41 | |||
| 42 | /* put back the original value for config space*/ | ||
| 43 | if (!(config & 0x2)) | ||
| 44 | pci_write_config_byte(dev, 0xf4, config); | ||
| 20 | } | 45 | } |
| 21 | 46 | ||
| 22 | void __init quirk_intel_irqbalance(void) | 47 | void __init quirk_intel_irqbalance(void) |
