aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/quirks.c
diff options
context:
space:
mode:
authorDavid Woodhouse <David.Woodhouse@intel.com>2008-10-21 14:42:20 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2008-10-21 14:42:20 -0400
commitb876d08f816527af257e13d89fb0d3b4b849223c (patch)
tree40569f568230f918ca55f04b355e251747f913ed /drivers/pci/quirks.c
parentb364776ad1208a71f0c53578c84619a395412a8d (diff)
parent2515ddc6db8eb49a79f0fe5e67ff09ac7c81eab4 (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts: drivers/pci/dmar.c
Diffstat (limited to 'drivers/pci/quirks.c')
-rw-r--r--drivers/pci/quirks.c173
1 files changed, 87 insertions, 86 deletions
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 832175d9ca25..96cf8ecd04ce 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -24,6 +24,14 @@
24#include <linux/kallsyms.h> 24#include <linux/kallsyms.h>
25#include "pci.h" 25#include "pci.h"
26 26
27int isa_dma_bridge_buggy;
28EXPORT_SYMBOL(isa_dma_bridge_buggy);
29int pci_pci_problems;
30EXPORT_SYMBOL(pci_pci_problems);
31int pcie_mch_quirk;
32EXPORT_SYMBOL(pcie_mch_quirk);
33
34#ifdef CONFIG_PCI_QUIRKS
27/* The Mellanox Tavor device gives false positive parity errors 35/* The Mellanox Tavor device gives false positive parity errors
28 * Mark this device with a broken_parity_status, to allow 36 * Mark this device with a broken_parity_status, to allow
29 * PCI scanning code to "skip" this now blacklisted device. 37 * PCI scanning code to "skip" this now blacklisted device.
@@ -76,8 +84,6 @@ DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82441, quirk_p
76 84
77 This appears to be BIOS not version dependent. So presumably there is a 85 This appears to be BIOS not version dependent. So presumably there is a
78 chipset level fix */ 86 chipset level fix */
79int isa_dma_bridge_buggy;
80EXPORT_SYMBOL(isa_dma_bridge_buggy);
81 87
82static void __devinit quirk_isa_dma_hangs(struct pci_dev *dev) 88static void __devinit quirk_isa_dma_hangs(struct pci_dev *dev)
83{ 89{
@@ -98,9 +104,6 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_CBUS_1, quirk_isa_d
98DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_CBUS_2, quirk_isa_dma_hangs); 104DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_CBUS_2, quirk_isa_dma_hangs);
99DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_CBUS_3, quirk_isa_dma_hangs); 105DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_CBUS_3, quirk_isa_dma_hangs);
100 106
101int pci_pci_problems;
102EXPORT_SYMBOL(pci_pci_problems);
103
104/* 107/*
105 * Chipsets where PCI->PCI transfers vanish or hang 108 * Chipsets where PCI->PCI transfers vanish or hang
106 */ 109 */
@@ -1376,9 +1379,6 @@ static void __init quirk_alder_ioapic(struct pci_dev *pdev)
1376DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_EESSC, quirk_alder_ioapic); 1379DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_EESSC, quirk_alder_ioapic);
1377#endif 1380#endif
1378 1381
1379int pcie_mch_quirk;
1380EXPORT_SYMBOL(pcie_mch_quirk);
1381
1382static void __devinit quirk_pcie_mch(struct pci_dev *pdev) 1382static void __devinit quirk_pcie_mch(struct pci_dev *pdev)
1383{ 1383{
1384 pcie_mch_quirk = 1; 1384 pcie_mch_quirk = 1;
@@ -1569,84 +1569,6 @@ static void __devinit fixup_rev1_53c810(struct pci_dev* dev)
1569} 1569}
1570DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NCR, PCI_DEVICE_ID_NCR_53C810, fixup_rev1_53c810); 1570DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NCR, PCI_DEVICE_ID_NCR_53C810, fixup_rev1_53c810);
1571 1571
1572static void pci_do_fixups(struct pci_dev *dev, struct pci_fixup *f, struct pci_fixup *end)
1573{
1574 while (f < end) {
1575 if ((f->vendor == dev->vendor || f->vendor == (u16) PCI_ANY_ID) &&
1576 (f->device == dev->device || f->device == (u16) PCI_ANY_ID)) {
1577#ifdef DEBUG
1578 dev_dbg(&dev->dev, "calling %pF\n", f->hook);
1579#endif
1580 f->hook(dev);
1581 }
1582 f++;
1583 }
1584}
1585
1586extern struct pci_fixup __start_pci_fixups_early[];
1587extern struct pci_fixup __end_pci_fixups_early[];
1588extern struct pci_fixup __start_pci_fixups_header[];
1589extern struct pci_fixup __end_pci_fixups_header[];
1590extern struct pci_fixup __start_pci_fixups_final[];
1591extern struct pci_fixup __end_pci_fixups_final[];
1592extern struct pci_fixup __start_pci_fixups_enable[];
1593extern struct pci_fixup __end_pci_fixups_enable[];
1594extern struct pci_fixup __start_pci_fixups_resume[];
1595extern struct pci_fixup __end_pci_fixups_resume[];
1596extern struct pci_fixup __start_pci_fixups_resume_early[];
1597extern struct pci_fixup __end_pci_fixups_resume_early[];
1598extern struct pci_fixup __start_pci_fixups_suspend[];
1599extern struct pci_fixup __end_pci_fixups_suspend[];
1600
1601
1602void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev)
1603{
1604 struct pci_fixup *start, *end;
1605
1606 switch(pass) {
1607 case pci_fixup_early:
1608 start = __start_pci_fixups_early;
1609 end = __end_pci_fixups_early;
1610 break;
1611
1612 case pci_fixup_header:
1613 start = __start_pci_fixups_header;
1614 end = __end_pci_fixups_header;
1615 break;
1616
1617 case pci_fixup_final:
1618 start = __start_pci_fixups_final;
1619 end = __end_pci_fixups_final;
1620 break;
1621
1622 case pci_fixup_enable:
1623 start = __start_pci_fixups_enable;
1624 end = __end_pci_fixups_enable;
1625 break;
1626
1627 case pci_fixup_resume:
1628 start = __start_pci_fixups_resume;
1629 end = __end_pci_fixups_resume;
1630 break;
1631
1632 case pci_fixup_resume_early:
1633 start = __start_pci_fixups_resume_early;
1634 end = __end_pci_fixups_resume_early;
1635 break;
1636
1637 case pci_fixup_suspend:
1638 start = __start_pci_fixups_suspend;
1639 end = __end_pci_fixups_suspend;
1640 break;
1641
1642 default:
1643 /* stupid compiler warning, you would think with an enum... */
1644 return;
1645 }
1646 pci_do_fixups(dev, start, end);
1647}
1648EXPORT_SYMBOL(pci_fixup_device);
1649
1650/* Enable 1k I/O space granularity on the Intel P64H2 */ 1572/* Enable 1k I/O space granularity on the Intel P64H2 */
1651static void __devinit quirk_p64h2_1k_io(struct pci_dev *dev) 1573static void __devinit quirk_p64h2_1k_io(struct pci_dev *dev)
1652{ 1574{
@@ -2020,3 +1942,82 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4375,
2020 quirk_msi_intx_disable_bug); 1942 quirk_msi_intx_disable_bug);
2021 1943
2022#endif /* CONFIG_PCI_MSI */ 1944#endif /* CONFIG_PCI_MSI */
1945
1946static void pci_do_fixups(struct pci_dev *dev, struct pci_fixup *f, struct pci_fixup *end)
1947{
1948 while (f < end) {
1949 if ((f->vendor == dev->vendor || f->vendor == (u16) PCI_ANY_ID) &&
1950 (f->device == dev->device || f->device == (u16) PCI_ANY_ID)) {
1951 dev_dbg(&dev->dev, "calling %pF\n", f->hook);
1952 f->hook(dev);
1953 }
1954 f++;
1955 }
1956}
1957
1958extern struct pci_fixup __start_pci_fixups_early[];
1959extern struct pci_fixup __end_pci_fixups_early[];
1960extern struct pci_fixup __start_pci_fixups_header[];
1961extern struct pci_fixup __end_pci_fixups_header[];
1962extern struct pci_fixup __start_pci_fixups_final[];
1963extern struct pci_fixup __end_pci_fixups_final[];
1964extern struct pci_fixup __start_pci_fixups_enable[];
1965extern struct pci_fixup __end_pci_fixups_enable[];
1966extern struct pci_fixup __start_pci_fixups_resume[];
1967extern struct pci_fixup __end_pci_fixups_resume[];
1968extern struct pci_fixup __start_pci_fixups_resume_early[];
1969extern struct pci_fixup __end_pci_fixups_resume_early[];
1970extern struct pci_fixup __start_pci_fixups_suspend[];
1971extern struct pci_fixup __end_pci_fixups_suspend[];
1972
1973
1974void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev)
1975{
1976 struct pci_fixup *start, *end;
1977
1978 switch(pass) {
1979 case pci_fixup_early:
1980 start = __start_pci_fixups_early;
1981 end = __end_pci_fixups_early;
1982 break;
1983
1984 case pci_fixup_header:
1985 start = __start_pci_fixups_header;
1986 end = __end_pci_fixups_header;
1987 break;
1988
1989 case pci_fixup_final:
1990 start = __start_pci_fixups_final;
1991 end = __end_pci_fixups_final;
1992 break;
1993
1994 case pci_fixup_enable:
1995 start = __start_pci_fixups_enable;
1996 end = __end_pci_fixups_enable;
1997 break;
1998
1999 case pci_fixup_resume:
2000 start = __start_pci_fixups_resume;
2001 end = __end_pci_fixups_resume;
2002 break;
2003
2004 case pci_fixup_resume_early:
2005 start = __start_pci_fixups_resume_early;
2006 end = __end_pci_fixups_resume_early;
2007 break;
2008
2009 case pci_fixup_suspend:
2010 start = __start_pci_fixups_suspend;
2011 end = __end_pci_fixups_suspend;
2012 break;
2013
2014 default:
2015 /* stupid compiler warning, you would think with an enum... */
2016 return;
2017 }
2018 pci_do_fixups(dev, start, end);
2019}
2020#else
2021void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev) {}
2022#endif
2023EXPORT_SYMBOL(pci_fixup_device);