diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-13 00:17:41 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-13 00:17:41 -0400 |
commit | d3745f46e32d86de188cf378f923b7a2ed5274f9 (patch) | |
tree | b6ad64cbd41644de503a15ce3669e00ec602db8f | |
parent | 70d002bccac5e107fafb95e83fcb7fc010a88695 (diff) | |
parent | ffadcc2ff42ecedf71ea67d9051ff028927aed08 (diff) |
Merge commit master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6 of HEAD
* HEAD:
[PATCH] PCI: PCIE power management quirk
[PATCH] PCI: add PCI Express AER register definitions to pci_regs.h
[PATCH] PCI: Clear abnormal poweroff flag on VIA southbridges, fix resume
[PATCH] PCI: poper prototype for arch/i386/pci/pcbios.c:pcibios_sort()
-rw-r--r-- | arch/i386/pci/common.c | 4 | ||||
-rw-r--r-- | arch/i386/pci/pci.h | 2 | ||||
-rw-r--r-- | drivers/pci/pci.c | 11 | ||||
-rw-r--r-- | drivers/pci/pci.h | 10 | ||||
-rw-r--r-- | drivers/pci/quirks.c | 58 | ||||
-rw-r--r-- | include/linux/pci.h | 1 | ||||
-rw-r--r-- | include/linux/pci_regs.h | 16 |
7 files changed, 95 insertions, 7 deletions
diff --git a/arch/i386/pci/common.c b/arch/i386/pci/common.c index c624b61e1104..0a362e3aeac5 100644 --- a/arch/i386/pci/common.c +++ b/arch/i386/pci/common.c | |||
@@ -17,10 +17,6 @@ | |||
17 | 17 | ||
18 | #include "pci.h" | 18 | #include "pci.h" |
19 | 19 | ||
20 | #ifdef CONFIG_PCI_BIOS | ||
21 | extern void pcibios_sort(void); | ||
22 | #endif | ||
23 | |||
24 | unsigned int pci_probe = PCI_PROBE_BIOS | PCI_PROBE_CONF1 | PCI_PROBE_CONF2 | | 20 | unsigned int pci_probe = PCI_PROBE_BIOS | PCI_PROBE_CONF1 | PCI_PROBE_CONF2 | |
25 | PCI_PROBE_MMCONF; | 21 | PCI_PROBE_MMCONF; |
26 | 22 | ||
diff --git a/arch/i386/pci/pci.h b/arch/i386/pci/pci.h index 12bf3d8dda29..bf4e79335388 100644 --- a/arch/i386/pci/pci.h +++ b/arch/i386/pci/pci.h | |||
@@ -84,4 +84,4 @@ extern int pci_conf1_read(unsigned int seg, unsigned int bus, | |||
84 | extern void pci_direct_init(void); | 84 | extern void pci_direct_init(void); |
85 | extern void pci_pcbios_init(void); | 85 | extern void pci_pcbios_init(void); |
86 | extern void pci_mmcfg_init(void); | 86 | extern void pci_mmcfg_init(void); |
87 | 87 | extern void pcibios_sort(void); | |
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index cf57d7de3765..9f79dd6d51ab 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <asm/dma.h> /* isa_dma_bridge_buggy */ | 19 | #include <asm/dma.h> /* isa_dma_bridge_buggy */ |
20 | #include "pci.h" | 20 | #include "pci.h" |
21 | 21 | ||
22 | unsigned int pci_pm_d3_delay = 10; | ||
22 | 23 | ||
23 | /** | 24 | /** |
24 | * pci_bus_max_busnr - returns maximum PCI bus number of given bus' children | 25 | * pci_bus_max_busnr - returns maximum PCI bus number of given bus' children |
@@ -313,6 +314,14 @@ pci_set_power_state(struct pci_dev *dev, pci_power_t state) | |||
313 | } else if (dev->current_state == state) | 314 | } else if (dev->current_state == state) |
314 | return 0; /* we're already there */ | 315 | return 0; /* we're already there */ |
315 | 316 | ||
317 | /* | ||
318 | * If the device or the parent bridge can't support PCI PM, ignore | ||
319 | * the request if we're doing anything besides putting it into D0 | ||
320 | * (which would only happen on boot). | ||
321 | */ | ||
322 | if ((state == PCI_D1 || state == PCI_D2) && pci_no_d1d2(dev)) | ||
323 | return 0; | ||
324 | |||
316 | /* find PCI PM capability in list */ | 325 | /* find PCI PM capability in list */ |
317 | pm = pci_find_capability(dev, PCI_CAP_ID_PM); | 326 | pm = pci_find_capability(dev, PCI_CAP_ID_PM); |
318 | 327 | ||
@@ -363,7 +372,7 @@ pci_set_power_state(struct pci_dev *dev, pci_power_t state) | |||
363 | /* Mandatory power management transition delays */ | 372 | /* Mandatory power management transition delays */ |
364 | /* see PCI PM 1.1 5.6.1 table 18 */ | 373 | /* see PCI PM 1.1 5.6.1 table 18 */ |
365 | if (state == PCI_D3hot || dev->current_state == PCI_D3hot) | 374 | if (state == PCI_D3hot || dev->current_state == PCI_D3hot) |
366 | msleep(10); | 375 | msleep(pci_pm_d3_delay); |
367 | else if (state == PCI_D2 || dev->current_state == PCI_D2) | 376 | else if (state == PCI_D2 || dev->current_state == PCI_D2) |
368 | udelay(200); | 377 | udelay(200); |
369 | 378 | ||
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index 9cc842b666eb..08d58fc78ee1 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h | |||
@@ -47,7 +47,7 @@ extern int pci_msi_quirk; | |||
47 | #else | 47 | #else |
48 | #define pci_msi_quirk 0 | 48 | #define pci_msi_quirk 0 |
49 | #endif | 49 | #endif |
50 | 50 | extern unsigned int pci_pm_d3_delay; | |
51 | #ifdef CONFIG_PCI_MSI | 51 | #ifdef CONFIG_PCI_MSI |
52 | void disable_msi_mode(struct pci_dev *dev, int pos, int type); | 52 | void disable_msi_mode(struct pci_dev *dev, int pos, int type); |
53 | void pci_no_msi(void); | 53 | void pci_no_msi(void); |
@@ -66,7 +66,15 @@ static inline int pci_save_msix_state(struct pci_dev *dev) { return 0; } | |||
66 | static inline void pci_restore_msi_state(struct pci_dev *dev) {} | 66 | static inline void pci_restore_msi_state(struct pci_dev *dev) {} |
67 | static inline void pci_restore_msix_state(struct pci_dev *dev) {} | 67 | static inline void pci_restore_msix_state(struct pci_dev *dev) {} |
68 | #endif | 68 | #endif |
69 | static inline int pci_no_d1d2(struct pci_dev *dev) | ||
70 | { | ||
71 | unsigned int parent_dstates = 0; | ||
69 | 72 | ||
73 | if (dev->bus->self) | ||
74 | parent_dstates = dev->bus->self->no_d1d2; | ||
75 | return (dev->no_d1d2 || parent_dstates); | ||
76 | |||
77 | } | ||
70 | extern int pcie_mch_quirk; | 78 | extern int pcie_mch_quirk; |
71 | extern struct device_attribute pci_dev_attrs[]; | 79 | extern struct device_attribute pci_dev_attrs[]; |
72 | extern struct class_device_attribute class_device_attr_cpuaffinity; | 80 | extern struct class_device_attribute class_device_attr_cpuaffinity; |
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index de3bbc88fb26..e3c78c39b7e4 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
@@ -683,6 +683,33 @@ static void __devinit quirk_vt82c598_id(struct pci_dev *dev) | |||
683 | } | 683 | } |
684 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C597_0, quirk_vt82c598_id ); | 684 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C597_0, quirk_vt82c598_id ); |
685 | 685 | ||
686 | #ifdef CONFIG_ACPI_SLEEP | ||
687 | |||
688 | /* | ||
689 | * Some VIA systems boot with the abnormal status flag set. This can cause | ||
690 | * the BIOS to re-POST the system on resume rather than passing control | ||
691 | * back to the OS. Clear the flag on boot | ||
692 | */ | ||
693 | static void __devinit quirk_via_abnormal_poweroff(struct pci_dev *dev) | ||
694 | { | ||
695 | u32 reg; | ||
696 | |||
697 | acpi_hw_register_read(ACPI_MTX_DO_NOT_LOCK, ACPI_REGISTER_PM1_STATUS, | ||
698 | ®); | ||
699 | |||
700 | if (reg & 0x800) { | ||
701 | printk("Clearing abnormal poweroff flag\n"); | ||
702 | acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK, | ||
703 | ACPI_REGISTER_PM1_STATUS, | ||
704 | (u16)0x800); | ||
705 | } | ||
706 | } | ||
707 | |||
708 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8235, quirk_via_abnormal_poweroff); | ||
709 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237, quirk_via_abnormal_poweroff); | ||
710 | |||
711 | #endif | ||
712 | |||
686 | /* | 713 | /* |
687 | * CardBus controllers have a legacy base address that enables them | 714 | * CardBus controllers have a legacy base address that enables them |
688 | * to respond as i82365 pcmcia controllers. We don't want them to | 715 | * to respond as i82365 pcmcia controllers. We don't want them to |
@@ -1391,6 +1418,37 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXH_0, quirk_pc | |||
1391 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXH_1, quirk_pcie_pxh); | 1418 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXH_1, quirk_pcie_pxh); |
1392 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXHV, quirk_pcie_pxh); | 1419 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXHV, quirk_pcie_pxh); |
1393 | 1420 | ||
1421 | /* | ||
1422 | * Some Intel PCI Express chipsets have trouble with downstream | ||
1423 | * device power management. | ||
1424 | */ | ||
1425 | static void quirk_intel_pcie_pm(struct pci_dev * dev) | ||
1426 | { | ||
1427 | pci_pm_d3_delay = 120; | ||
1428 | dev->no_d1d2 = 1; | ||
1429 | } | ||
1430 | |||
1431 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25e2, quirk_intel_pcie_pm); | ||
1432 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25e3, quirk_intel_pcie_pm); | ||
1433 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25e4, quirk_intel_pcie_pm); | ||
1434 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25e5, quirk_intel_pcie_pm); | ||
1435 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25e6, quirk_intel_pcie_pm); | ||
1436 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25e7, quirk_intel_pcie_pm); | ||
1437 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25f7, quirk_intel_pcie_pm); | ||
1438 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25f8, quirk_intel_pcie_pm); | ||
1439 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25f9, quirk_intel_pcie_pm); | ||
1440 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25fa, quirk_intel_pcie_pm); | ||
1441 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2601, quirk_intel_pcie_pm); | ||
1442 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2602, quirk_intel_pcie_pm); | ||
1443 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2603, quirk_intel_pcie_pm); | ||
1444 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2604, quirk_intel_pcie_pm); | ||
1445 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2605, quirk_intel_pcie_pm); | ||
1446 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2606, quirk_intel_pcie_pm); | ||
1447 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2607, quirk_intel_pcie_pm); | ||
1448 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2608, quirk_intel_pcie_pm); | ||
1449 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2609, quirk_intel_pcie_pm); | ||
1450 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x260a, quirk_intel_pcie_pm); | ||
1451 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x260b, quirk_intel_pcie_pm); | ||
1394 | 1452 | ||
1395 | /* | 1453 | /* |
1396 | * Fixup the cardbus bridges on the IBM Dock II docking station | 1454 | * Fixup the cardbus bridges on the IBM Dock II docking station |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 983fca251b25..8565b81d7fbc 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -161,6 +161,7 @@ struct pci_dev { | |||
161 | unsigned int is_enabled:1; /* pci_enable_device has been called */ | 161 | unsigned int is_enabled:1; /* pci_enable_device has been called */ |
162 | unsigned int is_busmaster:1; /* device is busmaster */ | 162 | unsigned int is_busmaster:1; /* device is busmaster */ |
163 | unsigned int no_msi:1; /* device may not use msi */ | 163 | unsigned int no_msi:1; /* device may not use msi */ |
164 | unsigned int no_d1d2:1; /* only allow d0 or d3 */ | ||
164 | unsigned int block_ucfg_access:1; /* userspace config space access is blocked */ | 165 | unsigned int block_ucfg_access:1; /* userspace config space access is blocked */ |
165 | unsigned int broken_parity_status:1; /* Device generates false positive parity */ | 166 | unsigned int broken_parity_status:1; /* Device generates false positive parity */ |
166 | unsigned int msi_enabled:1; | 167 | unsigned int msi_enabled:1; |
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h index 6bce4a240364..96930cb5927c 100644 --- a/include/linux/pci_regs.h +++ b/include/linux/pci_regs.h | |||
@@ -422,7 +422,23 @@ | |||
422 | #define PCI_ERR_CAP_ECRC_CHKE 0x00000100 /* ECRC Check Enable */ | 422 | #define PCI_ERR_CAP_ECRC_CHKE 0x00000100 /* ECRC Check Enable */ |
423 | #define PCI_ERR_HEADER_LOG 28 /* Header Log Register (16 bytes) */ | 423 | #define PCI_ERR_HEADER_LOG 28 /* Header Log Register (16 bytes) */ |
424 | #define PCI_ERR_ROOT_COMMAND 44 /* Root Error Command */ | 424 | #define PCI_ERR_ROOT_COMMAND 44 /* Root Error Command */ |
425 | /* Correctable Err Reporting Enable */ | ||
426 | #define PCI_ERR_ROOT_CMD_COR_EN 0x00000001 | ||
427 | /* Non-fatal Err Reporting Enable */ | ||
428 | #define PCI_ERR_ROOT_CMD_NONFATAL_EN 0x00000002 | ||
429 | /* Fatal Err Reporting Enable */ | ||
430 | #define PCI_ERR_ROOT_CMD_FATAL_EN 0x00000004 | ||
425 | #define PCI_ERR_ROOT_STATUS 48 | 431 | #define PCI_ERR_ROOT_STATUS 48 |
432 | #define PCI_ERR_ROOT_COR_RCV 0x00000001 /* ERR_COR Received */ | ||
433 | /* Multi ERR_COR Received */ | ||
434 | #define PCI_ERR_ROOT_MULTI_COR_RCV 0x00000002 | ||
435 | /* ERR_FATAL/NONFATAL Recevied */ | ||
436 | #define PCI_ERR_ROOT_UNCOR_RCV 0x00000004 | ||
437 | /* Multi ERR_FATAL/NONFATAL Recevied */ | ||
438 | #define PCI_ERR_ROOT_MULTI_UNCOR_RCV 0x00000008 | ||
439 | #define PCI_ERR_ROOT_FIRST_FATAL 0x00000010 /* First Fatal */ | ||
440 | #define PCI_ERR_ROOT_NONFATAL_RCV 0x00000020 /* Non-Fatal Received */ | ||
441 | #define PCI_ERR_ROOT_FATAL_RCV 0x00000040 /* Fatal Received */ | ||
426 | #define PCI_ERR_ROOT_COR_SRC 52 | 442 | #define PCI_ERR_ROOT_COR_SRC 52 |
427 | #define PCI_ERR_ROOT_SRC 54 | 443 | #define PCI_ERR_ROOT_SRC 54 |
428 | 444 | ||