crypto: qat - drop redundant adf_enable_aer()
authorBjorn Helgaas <bhelgaas@google.com>
Tue, 7 Mar 2023 16:19:42 +0000 (10:19 -0600)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 17 Mar 2023 03:16:43 +0000 (11:16 +0800)
pci_enable_pcie_error_reporting() enables the device to send ERR_*
Messages.  Since f26e58bf6f54 ("PCI/AER: Enable error reporting when AER is
native"), the PCI core does this for all devices during enumeration, so the
driver doesn't need to do it itself.

Remove the redundant pci_enable_pcie_error_reporting() call from the
driver.  Also remove the corresponding pci_disable_pcie_error_reporting()
from the driver .remove() path.

Note that this only controls ERR_* Messages from the device.  An ERR_*
Message may cause the Root Port to generate an interrupt, depending on the
AER Root Error Command register managed by the AER service driver.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Cc: qat-linux@intel.com
Acked-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/qat/qat_4xxx/adf_drv.c
drivers/crypto/qat/qat_c3xxx/adf_drv.c
drivers/crypto/qat/qat_c62x/adf_drv.c
drivers/crypto/qat/qat_common/adf_aer.c
drivers/crypto/qat/qat_common/adf_common_drv.h
drivers/crypto/qat/qat_dh895xcc/adf_drv.c

index 1b8ccd43d6ee44f0ca19cad872d4889a2faa0464..ceb87327a5fe0f8cfdaf24c972c8192165c20a7e 100644 (file)
@@ -404,12 +404,10 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
        pci_set_master(pdev);
 
-       adf_enable_aer(accel_dev);
-
        if (pci_save_state(pdev)) {
                dev_err(&pdev->dev, "Failed to save pci state.\n");
                ret = -ENOMEM;
-               goto out_err_disable_aer;
+               goto out_err;
        }
 
        ret = adf_dev_up(accel_dev, true);
@@ -424,8 +422,6 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 out_err_dev_stop:
        adf_dev_down(accel_dev, false);
-out_err_disable_aer:
-       adf_disable_aer(accel_dev);
 out_err:
        adf_cleanup_accel(accel_dev);
        return ret;
@@ -440,7 +436,6 @@ static void adf_remove(struct pci_dev *pdev)
                return;
        }
        adf_dev_down(accel_dev, false);
-       adf_disable_aer(accel_dev);
        adf_cleanup_accel(accel_dev);
 }
 
index 4c00c49338050d92ec000becb8bf02f82839e702..bb4dca735ab5ad8894b961301d969e8e56c07e5d 100644 (file)
@@ -193,12 +193,10 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        }
        pci_set_master(pdev);
 
-       adf_enable_aer(accel_dev);
-
        if (pci_save_state(pdev)) {
                dev_err(&pdev->dev, "Failed to save pci state\n");
                ret = -ENOMEM;
-               goto out_err_disable_aer;
+               goto out_err_free_reg;
        }
 
        ret = adf_dev_up(accel_dev, true);
@@ -209,8 +207,6 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 out_err_dev_stop:
        adf_dev_down(accel_dev, false);
-out_err_disable_aer:
-       adf_disable_aer(accel_dev);
 out_err_free_reg:
        pci_release_regions(accel_pci_dev->pci_dev);
 out_err_disable:
@@ -230,7 +226,6 @@ static void adf_remove(struct pci_dev *pdev)
                return;
        }
        adf_dev_down(accel_dev, false);
-       adf_disable_aer(accel_dev);
        adf_cleanup_accel(accel_dev);
        adf_cleanup_pci_dev(accel_dev);
        kfree(accel_dev);
index fcb2f5b8e053b0054f79610fbf81cdfb99565abd..ca18ae14c09972d33b07f49a99ce11173b5d9cd9 100644 (file)
@@ -193,12 +193,10 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        }
        pci_set_master(pdev);
 
-       adf_enable_aer(accel_dev);
-
        if (pci_save_state(pdev)) {
                dev_err(&pdev->dev, "Failed to save pci state\n");
                ret = -ENOMEM;
-               goto out_err_disable_aer;
+               goto out_err_free_reg;
        }
 
        ret = adf_dev_up(accel_dev, true);
@@ -209,8 +207,6 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 out_err_dev_stop:
        adf_dev_down(accel_dev, false);
-out_err_disable_aer:
-       adf_disable_aer(accel_dev);
 out_err_free_reg:
        pci_release_regions(accel_pci_dev->pci_dev);
 out_err_disable:
@@ -230,7 +226,6 @@ static void adf_remove(struct pci_dev *pdev)
                return;
        }
        adf_dev_down(accel_dev, false);
-       adf_disable_aer(accel_dev);
        adf_cleanup_accel(accel_dev);
        adf_cleanup_pci_dev(accel_dev);
        kfree(accel_dev);
index 9fa76c52705117f5e8f3da92c406bf4b0f7eb4a9..04af32a2811c8f77b438a375fac184f63de48ed1 100644 (file)
@@ -2,7 +2,6 @@
 /* Copyright(c) 2014 - 2020 Intel Corporation */
 #include <linux/kernel.h>
 #include <linux/pci.h>
-#include <linux/aer.h>
 #include <linux/completion.h>
 #include <linux/workqueue.h>
 #include <linux/delay.h>
@@ -171,40 +170,6 @@ const struct pci_error_handlers adf_err_handler = {
 };
 EXPORT_SYMBOL_GPL(adf_err_handler);
 
-/**
- * adf_enable_aer() - Enable Advance Error Reporting for acceleration device
- * @accel_dev:  Pointer to acceleration device.
- *
- * Function enables PCI Advance Error Reporting for the
- * QAT acceleration device accel_dev.
- * To be used by QAT device specific drivers.
- */
-void adf_enable_aer(struct adf_accel_dev *accel_dev)
-{
-       struct pci_dev *pdev = accel_to_pci_dev(accel_dev);
-
-       pci_enable_pcie_error_reporting(pdev);
-}
-EXPORT_SYMBOL_GPL(adf_enable_aer);
-
-/**
- * adf_disable_aer() - Disable Advance Error Reporting for acceleration device
- * @accel_dev:  Pointer to acceleration device.
- *
- * Function disables PCI Advance Error Reporting for the
- * QAT acceleration device accel_dev.
- * To be used by QAT device specific drivers.
- *
- * Return: void
- */
-void adf_disable_aer(struct adf_accel_dev *accel_dev)
-{
-       struct pci_dev *pdev = accel_to_pci_dev(accel_dev);
-
-       pci_disable_pcie_error_reporting(pdev);
-}
-EXPORT_SYMBOL_GPL(adf_disable_aer);
-
 int adf_init_aer(void)
 {
        device_reset_wq = alloc_workqueue("qat_device_reset_wq",
index b2f14aaf69505b024ababe9377e4ea708c082aae..db79759bee6175e1ed7716f743ff9697ffc6f6c0 100644 (file)
@@ -86,8 +86,6 @@ int adf_ae_start(struct adf_accel_dev *accel_dev);
 int adf_ae_stop(struct adf_accel_dev *accel_dev);
 
 extern const struct pci_error_handlers adf_err_handler;
-void adf_enable_aer(struct adf_accel_dev *accel_dev);
-void adf_disable_aer(struct adf_accel_dev *accel_dev);
 void adf_reset_sbr(struct adf_accel_dev *accel_dev);
 void adf_reset_flr(struct adf_accel_dev *accel_dev);
 void adf_dev_restore(struct adf_accel_dev *accel_dev);
index 4d27e4e436420a16311183f5aaa5dbfb7c2324bd..e18860ab5c8e4d8f863f013e3a419f831e72ec88 100644 (file)
@@ -193,12 +193,10 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        }
        pci_set_master(pdev);
 
-       adf_enable_aer(accel_dev);
-
        if (pci_save_state(pdev)) {
                dev_err(&pdev->dev, "Failed to save pci state\n");
                ret = -ENOMEM;
-               goto out_err_disable_aer;
+               goto out_err_free_reg;
        }
 
        ret = adf_dev_up(accel_dev, true);
@@ -209,8 +207,6 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 out_err_dev_stop:
        adf_dev_down(accel_dev, false);
-out_err_disable_aer:
-       adf_disable_aer(accel_dev);
 out_err_free_reg:
        pci_release_regions(accel_pci_dev->pci_dev);
 out_err_disable:
@@ -230,7 +226,6 @@ static void adf_remove(struct pci_dev *pdev)
                return;
        }
        adf_dev_down(accel_dev, false);
-       adf_disable_aer(accel_dev);
        adf_cleanup_accel(accel_dev);
        adf_cleanup_pci_dev(accel_dev);
        kfree(accel_dev);