diff options
Diffstat (limited to 'drivers/pci/quirks.c')
-rw-r--r-- | drivers/pci/quirks.c | 173 |
1 files changed, 87 insertions, 86 deletions
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index e872ac925b4b..bbf66ea8fd87 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 | ||
27 | int isa_dma_bridge_buggy; | ||
28 | EXPORT_SYMBOL(isa_dma_bridge_buggy); | ||
29 | int pci_pci_problems; | ||
30 | EXPORT_SYMBOL(pci_pci_problems); | ||
31 | int pcie_mch_quirk; | ||
32 | EXPORT_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. |
@@ -62,8 +70,6 @@ DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82441, quirk_p | |||
62 | 70 | ||
63 | This appears to be BIOS not version dependent. So presumably there is a | 71 | This appears to be BIOS not version dependent. So presumably there is a |
64 | chipset level fix */ | 72 | chipset level fix */ |
65 | int isa_dma_bridge_buggy; | ||
66 | EXPORT_SYMBOL(isa_dma_bridge_buggy); | ||
67 | 73 | ||
68 | static void __devinit quirk_isa_dma_hangs(struct pci_dev *dev) | 74 | static void __devinit quirk_isa_dma_hangs(struct pci_dev *dev) |
69 | { | 75 | { |
@@ -84,9 +90,6 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_CBUS_1, quirk_isa_d | |||
84 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_CBUS_2, quirk_isa_dma_hangs); | 90 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_CBUS_2, quirk_isa_dma_hangs); |
85 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_CBUS_3, quirk_isa_dma_hangs); | 91 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_CBUS_3, quirk_isa_dma_hangs); |
86 | 92 | ||
87 | int pci_pci_problems; | ||
88 | EXPORT_SYMBOL(pci_pci_problems); | ||
89 | |||
90 | /* | 93 | /* |
91 | * Chipsets where PCI->PCI transfers vanish or hang | 94 | * Chipsets where PCI->PCI transfers vanish or hang |
92 | */ | 95 | */ |
@@ -1362,9 +1365,6 @@ static void __init quirk_alder_ioapic(struct pci_dev *pdev) | |||
1362 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_EESSC, quirk_alder_ioapic); | 1365 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_EESSC, quirk_alder_ioapic); |
1363 | #endif | 1366 | #endif |
1364 | 1367 | ||
1365 | int pcie_mch_quirk; | ||
1366 | EXPORT_SYMBOL(pcie_mch_quirk); | ||
1367 | |||
1368 | static void __devinit quirk_pcie_mch(struct pci_dev *pdev) | 1368 | static void __devinit quirk_pcie_mch(struct pci_dev *pdev) |
1369 | { | 1369 | { |
1370 | pcie_mch_quirk = 1; | 1370 | pcie_mch_quirk = 1; |
@@ -1555,84 +1555,6 @@ static void __devinit fixup_rev1_53c810(struct pci_dev* dev) | |||
1555 | } | 1555 | } |
1556 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NCR, PCI_DEVICE_ID_NCR_53C810, fixup_rev1_53c810); | 1556 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NCR, PCI_DEVICE_ID_NCR_53C810, fixup_rev1_53c810); |
1557 | 1557 | ||
1558 | static void pci_do_fixups(struct pci_dev *dev, struct pci_fixup *f, struct pci_fixup *end) | ||
1559 | { | ||
1560 | while (f < end) { | ||
1561 | if ((f->vendor == dev->vendor || f->vendor == (u16) PCI_ANY_ID) && | ||
1562 | (f->device == dev->device || f->device == (u16) PCI_ANY_ID)) { | ||
1563 | #ifdef DEBUG | ||
1564 | dev_dbg(&dev->dev, "calling %pF\n", f->hook); | ||
1565 | #endif | ||
1566 | f->hook(dev); | ||
1567 | } | ||
1568 | f++; | ||
1569 | } | ||
1570 | } | ||
1571 | |||
1572 | extern struct pci_fixup __start_pci_fixups_early[]; | ||
1573 | extern struct pci_fixup __end_pci_fixups_early[]; | ||
1574 | extern struct pci_fixup __start_pci_fixups_header[]; | ||
1575 | extern struct pci_fixup __end_pci_fixups_header[]; | ||
1576 | extern struct pci_fixup __start_pci_fixups_final[]; | ||
1577 | extern struct pci_fixup __end_pci_fixups_final[]; | ||
1578 | extern struct pci_fixup __start_pci_fixups_enable[]; | ||
1579 | extern struct pci_fixup __end_pci_fixups_enable[]; | ||
1580 | extern struct pci_fixup __start_pci_fixups_resume[]; | ||
1581 | extern struct pci_fixup __end_pci_fixups_resume[]; | ||
1582 | extern struct pci_fixup __start_pci_fixups_resume_early[]; | ||
1583 | extern struct pci_fixup __end_pci_fixups_resume_early[]; | ||
1584 | extern struct pci_fixup __start_pci_fixups_suspend[]; | ||
1585 | extern struct pci_fixup __end_pci_fixups_suspend[]; | ||
1586 | |||
1587 | |||
1588 | void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev) | ||
1589 | { | ||
1590 | struct pci_fixup *start, *end; | ||
1591 | |||
1592 | switch(pass) { | ||
1593 | case pci_fixup_early: | ||
1594 | start = __start_pci_fixups_early; | ||
1595 | end = __end_pci_fixups_early; | ||
1596 | break; | ||
1597 | |||
1598 | case pci_fixup_header: | ||
1599 | start = __start_pci_fixups_header; | ||
1600 | end = __end_pci_fixups_header; | ||
1601 | break; | ||
1602 | |||
1603 | case pci_fixup_final: | ||
1604 | start = __start_pci_fixups_final; | ||
1605 | end = __end_pci_fixups_final; | ||
1606 | break; | ||
1607 | |||
1608 | case pci_fixup_enable: | ||
1609 | start = __start_pci_fixups_enable; | ||
1610 | end = __end_pci_fixups_enable; | ||
1611 | break; | ||
1612 | |||
1613 | case pci_fixup_resume: | ||
1614 | start = __start_pci_fixups_resume; | ||
1615 | end = __end_pci_fixups_resume; | ||
1616 | break; | ||
1617 | |||
1618 | case pci_fixup_resume_early: | ||
1619 | start = __start_pci_fixups_resume_early; | ||
1620 | end = __end_pci_fixups_resume_early; | ||
1621 | break; | ||
1622 | |||
1623 | case pci_fixup_suspend: | ||
1624 | start = __start_pci_fixups_suspend; | ||
1625 | end = __end_pci_fixups_suspend; | ||
1626 | break; | ||
1627 | |||
1628 | default: | ||
1629 | /* stupid compiler warning, you would think with an enum... */ | ||
1630 | return; | ||
1631 | } | ||
1632 | pci_do_fixups(dev, start, end); | ||
1633 | } | ||
1634 | EXPORT_SYMBOL(pci_fixup_device); | ||
1635 | |||
1636 | /* Enable 1k I/O space granularity on the Intel P64H2 */ | 1558 | /* Enable 1k I/O space granularity on the Intel P64H2 */ |
1637 | static void __devinit quirk_p64h2_1k_io(struct pci_dev *dev) | 1559 | static void __devinit quirk_p64h2_1k_io(struct pci_dev *dev) |
1638 | { | 1560 | { |
@@ -2006,3 +1928,82 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4375, | |||
2006 | quirk_msi_intx_disable_bug); | 1928 | quirk_msi_intx_disable_bug); |
2007 | 1929 | ||
2008 | #endif /* CONFIG_PCI_MSI */ | 1930 | #endif /* CONFIG_PCI_MSI */ |
1931 | |||
1932 | static void pci_do_fixups(struct pci_dev *dev, struct pci_fixup *f, struct pci_fixup *end) | ||
1933 | { | ||
1934 | while (f < end) { | ||
1935 | if ((f->vendor == dev->vendor || f->vendor == (u16) PCI_ANY_ID) && | ||
1936 | (f->device == dev->device || f->device == (u16) PCI_ANY_ID)) { | ||
1937 | dev_dbg(&dev->dev, "calling %pF\n", f->hook); | ||
1938 | f->hook(dev); | ||
1939 | } | ||
1940 | f++; | ||
1941 | } | ||
1942 | } | ||
1943 | |||
1944 | extern struct pci_fixup __start_pci_fixups_early[]; | ||
1945 | extern struct pci_fixup __end_pci_fixups_early[]; | ||
1946 | extern struct pci_fixup __start_pci_fixups_header[]; | ||
1947 | extern struct pci_fixup __end_pci_fixups_header[]; | ||
1948 | extern struct pci_fixup __start_pci_fixups_final[]; | ||
1949 | extern struct pci_fixup __end_pci_fixups_final[]; | ||
1950 | extern struct pci_fixup __start_pci_fixups_enable[]; | ||
1951 | extern struct pci_fixup __end_pci_fixups_enable[]; | ||
1952 | extern struct pci_fixup __start_pci_fixups_resume[]; | ||
1953 | extern struct pci_fixup __end_pci_fixups_resume[]; | ||
1954 | extern struct pci_fixup __start_pci_fixups_resume_early[]; | ||
1955 | extern struct pci_fixup __end_pci_fixups_resume_early[]; | ||
1956 | extern struct pci_fixup __start_pci_fixups_suspend[]; | ||
1957 | extern struct pci_fixup __end_pci_fixups_suspend[]; | ||
1958 | |||
1959 | |||
1960 | void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev) | ||
1961 | { | ||
1962 | struct pci_fixup *start, *end; | ||
1963 | |||
1964 | switch(pass) { | ||
1965 | case pci_fixup_early: | ||
1966 | start = __start_pci_fixups_early; | ||
1967 | end = __end_pci_fixups_early; | ||
1968 | break; | ||
1969 | |||
1970 | case pci_fixup_header: | ||
1971 | start = __start_pci_fixups_header; | ||
1972 | end = __end_pci_fixups_header; | ||
1973 | break; | ||
1974 | |||
1975 | case pci_fixup_final: | ||
1976 | start = __start_pci_fixups_final; | ||
1977 | end = __end_pci_fixups_final; | ||
1978 | break; | ||
1979 | |||
1980 | case pci_fixup_enable: | ||
1981 | start = __start_pci_fixups_enable; | ||
1982 | end = __end_pci_fixups_enable; | ||
1983 | break; | ||
1984 | |||
1985 | case pci_fixup_resume: | ||
1986 | start = __start_pci_fixups_resume; | ||
1987 | end = __end_pci_fixups_resume; | ||
1988 | break; | ||
1989 | |||
1990 | case pci_fixup_resume_early: | ||
1991 | start = __start_pci_fixups_resume_early; | ||
1992 | end = __end_pci_fixups_resume_early; | ||
1993 | break; | ||
1994 | |||
1995 | case pci_fixup_suspend: | ||
1996 | start = __start_pci_fixups_suspend; | ||
1997 | end = __end_pci_fixups_suspend; | ||
1998 | break; | ||
1999 | |||
2000 | default: | ||
2001 | /* stupid compiler warning, you would think with an enum... */ | ||
2002 | return; | ||
2003 | } | ||
2004 | pci_do_fixups(dev, start, end); | ||
2005 | } | ||
2006 | #else | ||
2007 | void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev) {} | ||
2008 | #endif | ||
2009 | EXPORT_SYMBOL(pci_fixup_device); | ||