Use newly minted device_is_attached rather than device_is_alive to see
if attach succeeded. device_is_alive just tells us that probe succeeded. Since we were using it to do things like detach net interfaces, this caused problems when there were errors in the attach routine. Symptoms of problem reported by: martin blapp
This commit is contained in:
parent
68d1cc4cc5
commit
55161dbc66
@ -2316,7 +2316,7 @@ dc_detach(dev)
|
||||
ifp = &sc->arpcom.ac_if;
|
||||
|
||||
/* These should only be active if attach succeeded */
|
||||
if (device_is_alive(dev)) {
|
||||
if (device_is_attached(dev)) {
|
||||
dc_stop(sc);
|
||||
ether_ifdetach(ifp);
|
||||
}
|
||||
|
@ -829,7 +829,7 @@ sf_detach(dev)
|
||||
ifp = &sc->arpcom.ac_if;
|
||||
|
||||
/* These should only be active if attach succeeded */
|
||||
if (device_is_alive(dev)) {
|
||||
if (device_is_attached(dev)) {
|
||||
sf_stop(sc);
|
||||
ether_ifdetach(ifp);
|
||||
}
|
||||
|
@ -1375,7 +1375,7 @@ sk_detach_xmac(dev)
|
||||
|
||||
ifp = &sc_if->arpcom.ac_if;
|
||||
/* These should only be active if attach_xmac succeeded */
|
||||
if (device_is_alive(dev)) {
|
||||
if (device_is_attached(dev)) {
|
||||
sk_stop(sc_if);
|
||||
ether_ifdetach(ifp);
|
||||
}
|
||||
|
@ -2377,7 +2377,7 @@ ti_detach(dev)
|
||||
ifp = &sc->arpcom.ac_if;
|
||||
|
||||
/* These should only be active if attach succeeded */
|
||||
if (device_is_alive(dev)) {
|
||||
if (device_is_attached(dev)) {
|
||||
ti_stop(sc);
|
||||
ether_ifdetach(ifp);
|
||||
bus_generic_detach(dev);
|
||||
|
@ -915,7 +915,7 @@ vr_detach(dev)
|
||||
ifp = &sc->arpcom.ac_if;
|
||||
|
||||
/* These should only be active if attach succeeded */
|
||||
if (device_is_alive(dev)) {
|
||||
if (device_is_attached(dev)) {
|
||||
vr_stop(sc);
|
||||
ether_ifdetach(ifp);
|
||||
}
|
||||
|
@ -2316,7 +2316,7 @@ dc_detach(dev)
|
||||
ifp = &sc->arpcom.ac_if;
|
||||
|
||||
/* These should only be active if attach succeeded */
|
||||
if (device_is_alive(dev)) {
|
||||
if (device_is_attached(dev)) {
|
||||
dc_stop(sc);
|
||||
ether_ifdetach(ifp);
|
||||
}
|
||||
|
@ -665,7 +665,7 @@ pcn_detach(dev)
|
||||
PCN_LOCK(sc);
|
||||
|
||||
/* These should only be active if attach succeeded */
|
||||
if (device_is_alive(dev)) {
|
||||
if (device_is_attached(dev)) {
|
||||
pcn_reset(sc);
|
||||
pcn_stop(sc);
|
||||
ether_ifdetach(ifp);
|
||||
|
@ -1101,7 +1101,7 @@ rl_detach(dev)
|
||||
ifp = &sc->arpcom.ac_if;
|
||||
|
||||
/* These should only be active if attach succeeded */
|
||||
if (device_is_alive(dev)) {
|
||||
if (device_is_attached(dev)) {
|
||||
rl_stop(sc);
|
||||
ether_ifdetach(ifp);
|
||||
}
|
||||
|
@ -829,7 +829,7 @@ sf_detach(dev)
|
||||
ifp = &sc->arpcom.ac_if;
|
||||
|
||||
/* These should only be active if attach succeeded */
|
||||
if (device_is_alive(dev)) {
|
||||
if (device_is_attached(dev)) {
|
||||
sf_stop(sc);
|
||||
ether_ifdetach(ifp);
|
||||
}
|
||||
|
@ -1424,7 +1424,7 @@ sis_detach(dev)
|
||||
ifp = &sc->arpcom.ac_if;
|
||||
|
||||
/* These should only be active if attach succeeded */
|
||||
if (device_is_alive(dev)) {
|
||||
if (device_is_attached(dev)) {
|
||||
sis_reset(sc);
|
||||
sis_stop(sc);
|
||||
ether_ifdetach(ifp);
|
||||
|
@ -1375,7 +1375,7 @@ sk_detach_xmac(dev)
|
||||
|
||||
ifp = &sc_if->arpcom.ac_if;
|
||||
/* These should only be active if attach_xmac succeeded */
|
||||
if (device_is_alive(dev)) {
|
||||
if (device_is_attached(dev)) {
|
||||
sk_stop(sc_if);
|
||||
ether_ifdetach(ifp);
|
||||
}
|
||||
|
@ -1089,7 +1089,7 @@ ste_detach(dev)
|
||||
ifp = &sc->arpcom.ac_if;
|
||||
|
||||
/* These should only be active if attach succeeded */
|
||||
if (device_is_alive(dev)) {
|
||||
if (device_is_attached(dev)) {
|
||||
ste_stop(sc);
|
||||
ether_ifdetach(ifp);
|
||||
}
|
||||
|
@ -2377,7 +2377,7 @@ ti_detach(dev)
|
||||
ifp = &sc->arpcom.ac_if;
|
||||
|
||||
/* These should only be active if attach succeeded */
|
||||
if (device_is_alive(dev)) {
|
||||
if (device_is_attached(dev)) {
|
||||
ti_stop(sc);
|
||||
ether_ifdetach(ifp);
|
||||
bus_generic_detach(dev);
|
||||
|
@ -1349,7 +1349,7 @@ tl_detach(dev)
|
||||
ifp = &sc->arpcom.ac_if;
|
||||
|
||||
/* These should only be active if attach succeeded */
|
||||
if (device_is_alive(dev)) {
|
||||
if (device_is_attached(dev)) {
|
||||
tl_stop(sc);
|
||||
ether_ifdetach(ifp);
|
||||
}
|
||||
|
@ -915,7 +915,7 @@ vr_detach(dev)
|
||||
ifp = &sc->arpcom.ac_if;
|
||||
|
||||
/* These should only be active if attach succeeded */
|
||||
if (device_is_alive(dev)) {
|
||||
if (device_is_attached(dev)) {
|
||||
vr_stop(sc);
|
||||
ether_ifdetach(ifp);
|
||||
}
|
||||
|
@ -981,7 +981,7 @@ wb_detach(dev)
|
||||
* Delete any miibus and phy devices attached to this interface.
|
||||
* This should only be done if attach succeeded.
|
||||
*/
|
||||
if (device_is_alive(dev)) {
|
||||
if (device_is_attached(dev)) {
|
||||
wb_stop(sc);
|
||||
ether_ifdetach(ifp);
|
||||
}
|
||||
|
@ -1769,7 +1769,7 @@ xl_detach(dev)
|
||||
}
|
||||
|
||||
/* These should only be active if attach succeeded */
|
||||
if (device_is_alive(dev)) {
|
||||
if (device_is_attached(dev)) {
|
||||
xl_reset(sc);
|
||||
xl_stop(sc);
|
||||
ether_ifdetach(ifp);
|
||||
|
Loading…
Reference in New Issue
Block a user