From 2ea36df8062f1a01cbfd8be7a706498fa0e30a0d Mon Sep 17 00:00:00 2001 From: Ian Dowse Date: Thu, 17 Apr 2003 08:36:52 +0000 Subject: [PATCH] Revert part of revision 1.97 by calling dc_stop() unconditionally in dc_detach() instead of only calling it if the hardware is preset. This is a workaround for page faults in softclock() after a `dc' device was detached, caused by not disabling a timer before freeing its memory. The bus_child_present() checks should probably be re-added later, but only to avoid the hardware accesses and not the other resource cleanups in dc_stop(). Approved by: njl --- sys/dev/dc/if_dc.c | 3 +-- sys/pci/if_dc.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/dev/dc/if_dc.c b/sys/dev/dc/if_dc.c index f39e612c413..15acd86bf25 100644 --- a/sys/dev/dc/if_dc.c +++ b/sys/dev/dc/if_dc.c @@ -2306,8 +2306,7 @@ dc_detach(dev) ifp = &sc->arpcom.ac_if; if (device_is_alive(dev)) { - if (bus_child_present(dev)) - dc_stop(sc); + dc_stop(sc); ether_ifdetach(ifp); device_delete_child(dev, sc->dc_miibus); bus_generic_detach(dev); diff --git a/sys/pci/if_dc.c b/sys/pci/if_dc.c index f39e612c413..15acd86bf25 100644 --- a/sys/pci/if_dc.c +++ b/sys/pci/if_dc.c @@ -2306,8 +2306,7 @@ dc_detach(dev) ifp = &sc->arpcom.ac_if; if (device_is_alive(dev)) { - if (bus_child_present(dev)) - dc_stop(sc); + dc_stop(sc); ether_ifdetach(ifp); device_delete_child(dev, sc->dc_miibus); bus_generic_detach(dev);