direct-io.hg

view linux-2.6-xen-sparse/arch/i386/kernel/quirks-xen.c @ 9479:85b7a341207e

Include the E7520 (e.g., Dell 1850) irqbalance quirk fix even when
building a non-SMP kernel. The underlying hypervisor may still be SMP.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Thu Mar 30 14:06:11 2006 +0100 (2006-03-30)
parents 2494b4e00cbb
children 3adf00179a63
line source
1 /*
2 * This file contains work-arounds for x86 and x86_64 platform bugs.
3 */
4 #include <linux/config.h>
5 #include <linux/pci.h>
6 #include <linux/irq.h>
8 #if defined(CONFIG_X86_IO_APIC) && (defined(CONFIG_SMP) || defined(CONFIG_XEN)) && defined(CONFIG_PCI)
10 static void __devinit quirk_intel_irqbalance(struct pci_dev *dev)
11 {
12 u8 config, rev;
13 u32 word;
15 /* BIOS may enable hardware IRQ balancing for
16 * E7520/E7320/E7525(revision ID 0x9 and below)
17 * based platforms.
18 * Disable SW irqbalance/affinity on those platforms.
19 */
20 pci_read_config_byte(dev, PCI_CLASS_REVISION, &rev);
21 if (rev > 0x9)
22 return;
24 printk(KERN_INFO "Intel E7520/7320/7525 detected.");
26 /* enable access to config space*/
27 pci_read_config_byte(dev, 0xf4, &config);
28 pci_write_config_byte(dev, 0xf4, config|0x2);
30 /* read xTPR register */
31 raw_pci_ops->read(0, 0, 0x40, 0x4c, 2, &word);
33 if (!(word & (1 << 13))) {
34 dom0_op_t op;
35 printk(KERN_INFO "Disabling irq balancing and affinity\n");
36 op.cmd = DOM0_PLATFORM_QUIRK;
37 op.u.platform_quirk.quirk_id = QUIRK_NOIRQBALANCING;
38 (void)HYPERVISOR_dom0_op(&op);
39 }
41 /* put back the original value for config space*/
42 if (!(config & 0x2))
43 pci_write_config_byte(dev, 0xf4, config);
44 }
45 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_E7320_MCH, quirk_intel_irqbalance);
46 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_E7525_MCH, quirk_intel_irqbalance);
47 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_E7520_MCH, quirk_intel_irqbalance);
48 #endif