From: Sepherosa Ziehau Date: Mon, 23 Sep 2013 01:41:34 +0000 (+0800) Subject: em/emx: On attach path, perform another reset if the first one fails X-Git-Tag: v3.7.0~316 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/bacca38f64d8c73bd1b7eca7243703009daf23dd em/emx: On attach path, perform another reset if the first one fails The second reset fixes the 82573L attaching failure. Reported-and-Tested-by: Johannes Hofmann --- diff --git a/sys/dev/netif/em/if_em.c b/sys/dev/netif/em/if_em.c index 456fdf105c..845aa587f2 100644 --- a/sys/dev/netif/em/if_em.c +++ b/sys/dev/netif/em/if_em.c @@ -790,9 +790,16 @@ em_attach(device_t dev) /* Reset the hardware */ error = em_reset(adapter); if (error) { - device_printf(dev, "Unable to reset the hardware\n"); - ether_ifdetach(ifp); - goto fail; + /* + * Some 82573 parts fail the first reset, call it again, + * if it fails a second time its a real issue. + */ + error = em_reset(adapter); + if (error) { + device_printf(dev, "Unable to reset the hardware\n"); + ether_ifdetach(ifp); + goto fail; + } } /* Initialize statistics */ diff --git a/sys/dev/netif/emx/if_emx.c b/sys/dev/netif/emx/if_emx.c index 8ee505bd58..733cbe6caf 100644 --- a/sys/dev/netif/emx/if_emx.c +++ b/sys/dev/netif/emx/if_emx.c @@ -825,9 +825,16 @@ emx_attach(device_t dev) /* Reset the hardware */ error = emx_reset(sc); if (error) { - device_printf(dev, "Unable to reset the hardware\n"); - ether_ifdetach(&sc->arpcom.ac_if); - goto fail; + /* + * Some 82573 parts fail the first reset, call it again, + * if it fails a second time its a real issue. + */ + error = emx_reset(sc); + if (error) { + device_printf(dev, "Unable to reset the hardware\n"); + ether_ifdetach(&sc->arpcom.ac_if); + goto fail; + } } /* Initialize statistics */