Commit 197cccc7 authored by Bjorn Helgaas's avatar Bjorn Helgaas Committed by Herbert Xu

crypto: qat - drop redundant adf_enable_aer()

pci_enable_pcie_error_reporting() enables the device to send ERR_*
Messages.  Since f26e58bf ("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: default avatarBjorn Helgaas <bhelgaas@google.com>
Cc: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Cc: qat-linux@intel.com
Acked-by: default avatarGiovanni Cabiddu <giovanni.cabiddu@intel.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 118dbccc
......@@ -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);
}
......
......@@ -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);
......
......@@ -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);
......
......@@ -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",
......
......@@ -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);
......
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment