net/mlx5: Rely on dev->link_active_reporting
authorMaciej W. Rozycki <macro@orcam.me.uk>
Sun, 11 Jun 2023 17:19:36 +0000 (18:19 +0100)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 14 Jun 2023 22:58:12 +0000 (17:58 -0500)
Use dev->link_active_reporting to determine whether Data Link Layer Link
Active Reporting is available rather than re-retrieving the capability.

Link: https://lore.kernel.org/r/alpine.DEB.2.21.2305310125370.59226@angie.orcam.me.uk
Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c

index 50022e7565f14303937672f33332677e359dde14..9ebebd963dabc7ec8940c11933b89fc7ba481beb 100644 (file)
@@ -307,7 +307,6 @@ static int mlx5_pci_link_toggle(struct mlx5_core_dev *dev)
        unsigned long timeout;
        struct pci_dev *sdev;
        int cap, err;
-       u32 reg32;
 
        /* Check that all functions under the pci bridge are PFs of
         * this device otherwise fail this function.
@@ -346,11 +345,8 @@ static int mlx5_pci_link_toggle(struct mlx5_core_dev *dev)
                return err;
 
        /* Check link */
-       err = pci_read_config_dword(bridge, cap + PCI_EXP_LNKCAP, &reg32);
-       if (err)
-               return err;
-       if (!(reg32 & PCI_EXP_LNKCAP_DLLLARC)) {
-               mlx5_core_warn(dev, "No PCI link reporting capability (0x%08x)\n", reg32);
+       if (!bridge->link_active_reporting) {
+               mlx5_core_warn(dev, "No PCI link reporting capability\n");
                msleep(1000);
                goto restore;
        }