diff options
author | Michael Knudsen <mk@cvs.openbsd.org> | 2007-04-23 19:29:04 +0000 |
---|---|---|
committer | Michael Knudsen <mk@cvs.openbsd.org> | 2007-04-23 19:29:04 +0000 |
commit | 6401fb951cd6e7fb8bcdefdec9097562b68e6054 (patch) | |
tree | 7b16077022e381a59512d387980b216fab6101ef /sys/dev | |
parent | 1e6bf41c78fa64fdb1148d37b9ba78b55a49bf5d (diff) |
When receiving an undock request, walk the list of dependant devices
and pull their _EJ0 knobs before undocking. This ejects any dependant
devices (if necessary) before actually undocking.
Without this, the usb hub in my X6 gets upset when it's suddenly kicked
off the system without warning, and upon redocking it attaches as uberry.
Now it's behaving as it should.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/acpi/acpidock.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/dev/acpi/acpidock.c b/sys/dev/acpi/acpidock.c index a94c72ffebd..f22a97fa8f6 100644 --- a/sys/dev/acpi/acpidock.c +++ b/sys/dev/acpi/acpidock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpidock.c,v 1.24 2007/04/23 18:34:42 mk Exp $ */ +/* $OpenBSD: acpidock.c,v 1.25 2007/04/23 19:29:03 mk Exp $ */ /* * Copyright (c) 2006,2007 Michael Knudsen <mk@openbsd.org> * @@ -233,7 +233,12 @@ acpidock_notify(struct aml_node *node, int notify_type, void *arg) acpidock_dockctl(sc, 1); break; - case ACPIDOCK_EVENT_EJECT: + case ACPIDOCK_EVENT_EJECT: { + struct aml_nodelist *n; + + TAILQ_FOREACH(n, &sc->sc_deps_h, entries) + acpidock_eject(sc, n->node); + acpidock_dockctl(sc, 0); acpidock_docklock(sc, 0); @@ -243,6 +248,7 @@ acpidock_notify(struct aml_node *node, int notify_type, void *arg) printf("%s: undock", DEVNAME(sc)); break; + } } acpidock_status(sc); |