Commit 3bff63ee authored by Maciej W. Rozycki's avatar Maciej W. Rozycki Committed by Bjorn Helgaas

net/mlx5: Rely on dev->link_active_reporting

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.ukSigned-off-by: default avatarMaciej W. Rozycki <macro@orcam.me.uk>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent 1541a213
...@@ -307,7 +307,6 @@ static int mlx5_pci_link_toggle(struct mlx5_core_dev *dev) ...@@ -307,7 +307,6 @@ static int mlx5_pci_link_toggle(struct mlx5_core_dev *dev)
unsigned long timeout; unsigned long timeout;
struct pci_dev *sdev; struct pci_dev *sdev;
int cap, err; int cap, err;
u32 reg32;
/* Check that all functions under the pci bridge are PFs of /* Check that all functions under the pci bridge are PFs of
* this device otherwise fail this function. * this device otherwise fail this function.
...@@ -346,11 +345,8 @@ static int mlx5_pci_link_toggle(struct mlx5_core_dev *dev) ...@@ -346,11 +345,8 @@ static int mlx5_pci_link_toggle(struct mlx5_core_dev *dev)
return err; return err;
/* Check link */ /* Check link */
err = pci_read_config_dword(bridge, cap + PCI_EXP_LNKCAP, &reg32); if (!bridge->link_active_reporting) {
if (err) mlx5_core_warn(dev, "No PCI link reporting capability\n");
return err;
if (!(reg32 & PCI_EXP_LNKCAP_DLLLARC)) {
mlx5_core_warn(dev, "No PCI link reporting capability (0x%08x)\n", reg32);
msleep(1000); msleep(1000);
goto restore; goto restore;
} }
......
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