瀏覽代碼

PCI: fix AER capability check

The 'use pci_find_ext_capability everywhere' cleanup brought a new bug,
which makes the AER stop working.  Fix it by actually using find_ext_cap
instead of just find_cap.  Drop the unused config space size define while
we're at it.

Signed-off-by: Yu Zhao <yu.zhao@intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Yu Zhao 16 年之前
父節點
當前提交
270c66be9b
共有 4 個文件被更改,包括 5 次插入12 次删除
  1. 3 8
      Documentation/PCI/pcieaer-howto.txt
  2. 2 2
      drivers/pci/pcie/aer/aerdrv_core.c
  3. 0 1
      drivers/pci/pcie/portdrv.h
  4. 0 1
      include/linux/aer.h

+ 3 - 8
Documentation/PCI/pcieaer-howto.txt

@@ -203,22 +203,17 @@ to mmio_enabled.
 
 
 3.3 helper functions
 3.3 helper functions
 
 
-3.3.1 int pci_find_aer_capability(struct pci_dev *dev);
-pci_find_aer_capability locates the PCI Express AER capability
-in the device configuration space. If the device doesn't support
-PCI-Express AER, the function returns 0.
-
-3.3.2 int pci_enable_pcie_error_reporting(struct pci_dev *dev);
+3.3.1 int pci_enable_pcie_error_reporting(struct pci_dev *dev);
 pci_enable_pcie_error_reporting enables the device to send error
 pci_enable_pcie_error_reporting enables the device to send error
 messages to root port when an error is detected. Note that devices
 messages to root port when an error is detected. Note that devices
 don't enable the error reporting by default, so device drivers need
 don't enable the error reporting by default, so device drivers need
 call this function to enable it.
 call this function to enable it.
 
 
-3.3.3 int pci_disable_pcie_error_reporting(struct pci_dev *dev);
+3.3.2 int pci_disable_pcie_error_reporting(struct pci_dev *dev);
 pci_disable_pcie_error_reporting disables the device to send error
 pci_disable_pcie_error_reporting disables the device to send error
 messages to root port when an error is detected.
 messages to root port when an error is detected.
 
 
-3.3.4 int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev);
+3.3.3 int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev);
 pci_cleanup_aer_uncorrect_error_status cleanups the uncorrectable
 pci_cleanup_aer_uncorrect_error_status cleanups the uncorrectable
 error status register.
 error status register.
 
 

+ 2 - 2
drivers/pci/pcie/aer/aerdrv_core.c

@@ -33,11 +33,11 @@ int pci_enable_pcie_error_reporting(struct pci_dev *dev)
 	u16 reg16 = 0;
 	u16 reg16 = 0;
 	int pos;
 	int pos;
 
 
-	pos = pci_find_capability(dev, PCI_CAP_ID_EXP);
+	pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR);
 	if (!pos)
 	if (!pos)
 		return -EIO;
 		return -EIO;
 
 
-	pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR);
+	pos = pci_find_capability(dev, PCI_CAP_ID_EXP);
 	if (!pos)
 	if (!pos)
 		return -EIO;
 		return -EIO;
 
 

+ 0 - 1
drivers/pci/pcie/portdrv.h

@@ -25,7 +25,6 @@
 #define PCIE_CAPABILITIES_REG		0x2
 #define PCIE_CAPABILITIES_REG		0x2
 #define PCIE_SLOT_CAPABILITIES_REG	0x14
 #define PCIE_SLOT_CAPABILITIES_REG	0x14
 #define PCIE_PORT_DEVICE_MAXSERVICES	4
 #define PCIE_PORT_DEVICE_MAXSERVICES	4
-#define PCI_CFG_SPACE_SIZE		256
 
 
 #define get_descriptor_id(type, service) (((type - 4) << 4) | service)
 #define get_descriptor_id(type, service) (((type - 4) << 4) | service)
 
 

+ 0 - 1
include/linux/aer.h

@@ -10,7 +10,6 @@
 #if defined(CONFIG_PCIEAER)
 #if defined(CONFIG_PCIEAER)
 /* pci-e port driver needs this function to enable aer */
 /* pci-e port driver needs this function to enable aer */
 extern int pci_enable_pcie_error_reporting(struct pci_dev *dev);
 extern int pci_enable_pcie_error_reporting(struct pci_dev *dev);
-extern int pci_find_aer_capability(struct pci_dev *dev);
 extern int pci_disable_pcie_error_reporting(struct pci_dev *dev);
 extern int pci_disable_pcie_error_reporting(struct pci_dev *dev);
 extern int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev);
 extern int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev);
 #else
 #else