Skip to content

Commit 3bff63e

Browse files
maciej-w-rozyckibjorn-helgaas
authored andcommitted
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/[email protected] Signed-off-by: Maciej W. Rozycki <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
1 parent 1541a21 commit 3bff63e

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,6 @@ static int mlx5_pci_link_toggle(struct mlx5_core_dev *dev)
307307
unsigned long timeout;
308308
struct pci_dev *sdev;
309309
int cap, err;
310-
u32 reg32;
311310

312311
/* Check that all functions under the pci bridge are PFs of
313312
* this device otherwise fail this function.
@@ -346,11 +345,8 @@ static int mlx5_pci_link_toggle(struct mlx5_core_dev *dev)
346345
return err;
347346

348347
/* Check link */
349-
err = pci_read_config_dword(bridge, cap + PCI_EXP_LNKCAP, &reg32);
350-
if (err)
351-
return err;
352-
if (!(reg32 & PCI_EXP_LNKCAP_DLLLARC)) {
353-
mlx5_core_warn(dev, "No PCI link reporting capability (0x%08x)\n", reg32);
348+
if (!bridge->link_active_reporting) {
349+
mlx5_core_warn(dev, "No PCI link reporting capability\n");
354350
msleep(1000);
355351
goto restore;
356352
}

0 commit comments

Comments
 (0)