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

sfc: Treat probe as unsuccessful if it scheduled a reset

From: Steve Hodgson <shodgson@solarflare.com>

efx_pci_probe_main() can return success despite a reset being scheduled.
Catch this and retry or abort probe depending on the reset type.
Signed-off-by: default avatarBen Hutchings <bhutchings@solarflare.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ab377358
...@@ -2112,8 +2112,6 @@ static int __devinit efx_pci_probe(struct pci_dev *pci_dev, ...@@ -2112,8 +2112,6 @@ static int __devinit efx_pci_probe(struct pci_dev *pci_dev,
* we're in STATE_INIT. */ * we're in STATE_INIT. */
for (i = 0; i < 5; i++) { for (i = 0; i < 5; i++) {
rc = efx_pci_probe_main(efx); rc = efx_pci_probe_main(efx);
if (rc == 0)
break;
/* Serialise against efx_reset(). No more resets will be /* Serialise against efx_reset(). No more resets will be
* scheduled since efx_stop_all() has been called, and we * scheduled since efx_stop_all() has been called, and we
...@@ -2121,6 +2119,17 @@ static int __devinit efx_pci_probe(struct pci_dev *pci_dev, ...@@ -2121,6 +2119,17 @@ static int __devinit efx_pci_probe(struct pci_dev *pci_dev,
* the rtnetlink or driverlink layers. */ * the rtnetlink or driverlink layers. */
cancel_work_sync(&efx->reset_work); cancel_work_sync(&efx->reset_work);
if (rc == 0) {
if (efx->reset_pending != RESET_TYPE_NONE) {
/* If there was a scheduled reset during
* probe, the NIC is probably hosed anyway */
efx_pci_remove_main(efx);
rc = -EIO;
} else {
break;
}
}
/* Retry if a recoverably reset event has been scheduled */ /* Retry if a recoverably reset event has been scheduled */
if ((efx->reset_pending != RESET_TYPE_INVISIBLE) && if ((efx->reset_pending != RESET_TYPE_INVISIBLE) &&
(efx->reset_pending != RESET_TYPE_ALL)) (efx->reset_pending != RESET_TYPE_ALL))
......
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