summaryrefslogtreecommitdiffstats
path: root/sys/dev/ed
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>1999-12-01 07:38:54 +0000
committerimp <imp@FreeBSD.org>1999-12-01 07:38:54 +0000
commit737361b49b1d4f61109a883539d69e85ed2ccbc3 (patch)
tree9e08c340cddbf5bd0598f71b4907763bb7026d68 /sys/dev/ed
parentb8799773608c6c088346b7cb09851b9b556a2cb4 (diff)
downloadFreeBSD-src-737361b49b1d4f61109a883539d69e85ed2ccbc3.zip
FreeBSD-src-737361b49b1d4f61109a883539d69e85ed2ccbc3.tar.gz
Fix the hang on card eject problem and maybe the hang on suspend
problem. o Create new timeout routine so we don't detach the card inside a ISR but instead drop back to spl0 via a timeout of 0. o Actually delete the child of the pccard device rather than just faking it badly. o Fix sio, ed and ep to have pccard detach routines that are int rather than void. o Fix ep and ed pccard detach routines to use if_detach rather than just if_down. if_detach destroys the device, while if_down just marks it down. In this incarnation of the pccard things, we map the disable the slot action to detach the driver, which removes the driver from the device tree. When that is done, a panic would soon follow as the ifconfig tried to down the device. Didn't fix: o Should cache the pccard dev child's pointer in struct slot o remove now unused parts of struct slot o Any driver using softc after detach has been called. sio's softc used to be statically allocated, so you could check sc->gone, but that is now gone. o Didn't remove gone from softc of drivers that use the old pccard method. Didn't test: o ed driver changes o sio driver changes on pccards o suspend (no laptop or apm support on my desktop)
Diffstat (limited to 'sys/dev/ed')
-rw-r--r--sys/dev/ed/if_ed_pccard.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/dev/ed/if_ed_pccard.c b/sys/dev/ed/if_ed_pccard.c
index df47ae5..549a9a3 100644
--- a/sys/dev/ed/if_ed_pccard.c
+++ b/sys/dev/ed/if_ed_pccard.c
@@ -48,7 +48,7 @@
*/
static int ed_pccard_probe(device_t);
static int ed_pccard_attach(device_t);
-static void ed_pccard_detach(device_t);
+static int ed_pccard_detach(device_t);
static device_method_t ed_pccard_methods[] = {
/* Device interface */
@@ -78,7 +78,7 @@ DRIVER_MODULE(ed, pccard, ed_pccard_driver, ed_pccard_devclass, 0, 0);
* and ensure that any driver entry points such as
* read and write do not hang.
*/
-static void
+static int
ed_pccard_detach(device_t dev)
{
struct ed_softc *sc = device_get_softc(dev);
@@ -86,13 +86,14 @@ ed_pccard_detach(device_t dev)
if (sc->gone) {
device_printf(dev, "already unloaded\n");
- return;
+ return (0);
}
ifp->if_flags &= ~IFF_RUNNING;
- if_down(ifp);
+ if_detach(ifp);
bus_teardown_intr(dev, sc->irq_res, &sc->irq_handle);
sc->gone = 1;
device_printf(dev, "unload\n");
+ return (0);
}
/*
OpenPOWER on IntegriCloud