]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/pci/pcie/aer/aerdrv_core.c
PCI aer: add pci_cleanup_aer_correct_aer_status
[mv-sheeva.git] / drivers / pci / pcie / aer / aerdrv_core.c
index 1c7e660d6535152272782ab8ce9f876de76aed17..92a8469b21bacecc2f161621553029ea99222d1e 100644 (file)
@@ -22,8 +22,6 @@
 #include <linux/errno.h>
 #include <linux/pm.h>
 #include <linux/suspend.h>
-#include <linux/acpi.h>
-#include <linux/pci-acpi.h>
 #include <linux/delay.h>
 #include "aerdrv.h"
 
@@ -119,6 +117,21 @@ int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev)
        return 0;
 }
 
+int pci_cleanup_aer_correct_error_status(struct pci_dev *dev)
+{
+       int pos;
+       u32 status;
+
+       pos = pci_find_aer_capability(dev);
+       if (!pos)
+               return -EIO;
+
+       pci_read_config_dword(dev, pos + PCI_ERR_COR_STATUS, &status);
+       pci_write_config_dword(dev, pos + PCI_ERR_COR_STATUS, status);
+
+       return 0;
+}
+
 static int find_device_iter(struct device *device, void *data)
 {
        struct pci_dev *dev;
@@ -690,14 +703,14 @@ static void aer_isr_one_error(struct pcie_device *p_device,
 
 /**
  * aer_isr - consume errors detected by root port
- * @context: pointer to a private data of pcie device
+ * @work: definition of this work item
  *
  * Invoked, as DPC, when root port records new detected error
  **/
-void aer_isr(void *context)
+void aer_isr(struct work_struct *work)
 {
-       struct pcie_device *p_device = (struct pcie_device *) context;
-       struct aer_rpc *rpc = get_service_data(p_device);
+       struct aer_rpc *rpc = container_of(work, struct aer_rpc, dpc_handler);
+       struct pcie_device *p_device = rpc->rpd;
        struct aer_err_source *e_src;
 
        mutex_lock(&rpc->rpc_mutex);
@@ -733,20 +746,8 @@ void aer_delete_rootport(struct aer_rpc *rpc)
  **/
 int aer_init(struct pcie_device *dev)
 {
-       int status;
-
-       /* Run _OSC Method */
-       status = aer_osc_setup(dev->port);
-
-       if(status != OSC_METHOD_RUN_SUCCESS) {
-               printk(KERN_DEBUG "%s: AER service init fails - %s\n",
-               __FUNCTION__,
-               (status == OSC_METHOD_NOT_SUPPORTED) ?
-                       "No ACPI _OSC support" : "Run ACPI _OSC fails");
-
-               if (!forceload)
-                       return status;
-       }
+       if (aer_osc_setup(dev) && !forceload)
+               return -ENXIO;
 
        return AER_SUCCESS;
 }
@@ -755,4 +756,5 @@ EXPORT_SYMBOL_GPL(pci_find_aer_capability);
 EXPORT_SYMBOL_GPL(pci_enable_pcie_error_reporting);
 EXPORT_SYMBOL_GPL(pci_disable_pcie_error_reporting);
 EXPORT_SYMBOL_GPL(pci_cleanup_aer_uncorrect_error_status);
+EXPORT_SYMBOL_GPL(pci_cleanup_aer_correct_error_status);