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.uk Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
This commit is contained in:
parent
1541a21305
commit
3bff63ee03
@ -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, ®32);
|
||||
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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user