Commit 5e2a911c authored by Steve Hodgson's avatar Steve Hodgson Committed by David S. Miller

sfc: Fix SFE4002 initialisation

From: Steve Hodgson <shodgson@solarflare.com>

Commit 357d46a1 "sfc: QT202x: Remove
unreliable MMD check at initialisation" broke initialisation of the
SFE4002.  efx_mdio_reset_mmd() returns a positive value rather than 0
on success.  The above commit causes this value to be propagated up
by qt202x_reset_phy(), which is treated as a failure by its callers.
Change qt202x_reset_phy() to return 0 if successful.

The PCI layer treats >0 as "fail, but please call remove() anyway",
which means that unloading the driver would cause a crash.  Add a
WARN_ON() on the failure path of efx_pci_probe() to provide early
warning if there are any other cases where we do this.
Signed-off-by: default avatarBen Hutchings <bhutchings@solarflare.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c6b471e6
...@@ -2284,6 +2284,7 @@ static int __devinit efx_pci_probe(struct pci_dev *pci_dev, ...@@ -2284,6 +2284,7 @@ static int __devinit efx_pci_probe(struct pci_dev *pci_dev,
fail2: fail2:
efx_fini_struct(efx); efx_fini_struct(efx);
fail1: fail1:
WARN_ON(rc > 0);
EFX_LOG(efx, "initialisation failed. rc=%d\n", rc); EFX_LOG(efx, "initialisation failed. rc=%d\n", rc);
free_netdev(net_dev); free_netdev(net_dev);
return rc; return rc;
......
...@@ -320,7 +320,7 @@ static int qt202x_reset_phy(struct efx_nic *efx) ...@@ -320,7 +320,7 @@ static int qt202x_reset_phy(struct efx_nic *efx)
falcon_board(efx)->type->init_phy(efx); falcon_board(efx)->type->init_phy(efx);
return rc; return 0;
fail: fail:
EFX_ERR(efx, "PHY reset timed out\n"); EFX_ERR(efx, "PHY reset timed out\n");
......
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