qed: Enable device error reporting capability.
authorSudarsana Reddy Kalluru <skalluru@marvell.com>
Wed, 22 Apr 2020 13:16:06 +0000 (06:16 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 23 Apr 2020 19:37:11 +0000 (12:37 -0700)
The patch enables the device to send error messages to root port when
an error is detected.

Signed-off-by: Sudarsana Reddy Kalluru <skalluru@marvell.com>
Signed-off-by: Ariel Elior <aelior@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qed/qed_main.c

index 96356e897c80ea86c232890fd2d0b61fca9a327d..38a1d26ca9db38792082ca0855c336bc8102e793 100644 (file)
@@ -49,6 +49,7 @@
 #include <linux/qed/qed_if.h>
 #include <linux/qed/qed_ll2_if.h>
 #include <net/devlink.h>
+#include <linux/aer.h>
 
 #include "qed.h"
 #include "qed_sriov.h"
@@ -129,6 +130,8 @@ static void qed_free_pci(struct qed_dev *cdev)
 {
        struct pci_dev *pdev = cdev->pdev;
 
+       pci_disable_pcie_error_reporting(pdev);
+
        if (cdev->doorbells && cdev->db_size)
                iounmap(cdev->doorbells);
        if (cdev->regview)
@@ -231,6 +234,12 @@ static int qed_init_pci(struct qed_dev *cdev, struct pci_dev *pdev)
                return -ENOMEM;
        }
 
+       /* AER (Advanced Error reporting) configuration */
+       rc = pci_enable_pcie_error_reporting(pdev);
+       if (rc)
+               DP_VERBOSE(cdev, NETIF_MSG_DRV,
+                          "Failed to configure PCIe AER [%d]\n", rc);
+
        return 0;
 
 err2: