]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
PCI: nVidia quirk to make AER PCI-E extended capability visible
authorBrice Goglin <brice@myri.com>
Wed, 6 Dec 2006 19:15:55 +0000 (20:15 +0100)
committerAdrian Bunk <bunk@stusta.de>
Fri, 8 Dec 2006 15:53:48 +0000 (16:53 +0100)
The nVidia CK804 PCI-E chipset supports the AER extended capability
but sometimes fails to link it (with some BIOS or after a warm reboot).
It makes the AER cap invisible to pci_find_ext_capability().

The patch adds a quirk to set the missing bit that controls the
linking of the capability.
By the way, it removes the corresponding code in the myri10ge driver.

Signed-off-by: Brice Goglin <brice@myri.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
drivers/pci/quirks.c
include/linux/pci_ids.h

index 2195c844296843f5d00d6861e64677a7b717f2f4..53807b284848f11554f05ba5c4f86997d29eb95c 100644 (file)
@@ -1387,6 +1387,25 @@ static void __devinit quirk_p64h2_1k_io(struct pci_dev *dev)
 }
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,  0x1460,         quirk_p64h2_1k_io);
 
+/* Under some circumstances, AER is not linked with extended capabilities.
+ * Force it to be linked by setting the corresponding control bit in the
+ * config space.
+ */
+static void __devinit quirk_nvidia_ck804_pcie_aer_ext_cap(struct pci_dev *dev)
+{
+       uint8_t b;
+       if (pci_read_config_byte(dev, 0xf41, &b) == 0) {
+               if (!(b & 0x20)) {
+                       pci_write_config_byte(dev, 0xf41, b | 0x20);
+                       printk(KERN_INFO
+                              "PCI: Linking AER extended capability on %s\n",
+                              pci_name(dev));
+               }
+       }
+}
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NVIDIA,  PCI_DEVICE_ID_NVIDIA_CK804_PCIE,
+                       quirk_nvidia_ck804_pcie_aer_ext_cap);
+
 EXPORT_SYMBOL(pcie_mch_quirk);
 #ifdef CONFIG_HOTPLUG
 EXPORT_SYMBOL(pci_fixup_device);
index b465e69e8e8a08f222775b8aa886ced9d334a076..0f30405bc125f918880128cf9fc5cfbe8ee88a6a 100644 (file)
 #define PCI_DEVICE_ID_NVIDIA_NVENET_8          0x0056
 #define PCI_DEVICE_ID_NVIDIA_NVENET_9          0x0057
 #define PCI_DEVICE_ID_NVIDIA_CK804_AUDIO       0x0059
+#define PCI_DEVICE_ID_NVIDIA_CK804_PCIE                0x005d
 #define PCI_DEVICE_ID_NVIDIA_NFORCE2_SMBUS     0x0064
 #define PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE       0x0065
 #define PCI_DEVICE_ID_NVIDIA_NVENET_2          0x0066