diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2012-10-08 21:47:52 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2012-10-08 21:47:52 +0000 |
commit | 4a7a1f17c7d6f8e79f29d4fde2ba5faf09b7f5a8 (patch) | |
tree | fdc5670bf4d0a8cd810fe846698cb565f1f51cb9 /sys/dev/pcmcia | |
parent | c7f240fd53223122e6fe8cee52bb76b460263763 (diff) |
Revamp the sequences for suspend/hibernate -> resume so that the code
paths are reflexive. It is now possible to fail part-way through a
suspend sequence, and recover along the resume code path.
Split DVACT_SUSPEND by adding a new DVACT_POWERDOWN method is used
after hibernate (and suspend too) to finish the job. Some drivers
must be converted at the same time to use this instead of shutdown hooks
(the others will follow at a later time)
ok kettenis mlarkin
Diffstat (limited to 'sys/dev/pcmcia')
-rw-r--r-- | sys/dev/pcmcia/pcmcia.c | 3 | ||||
-rw-r--r-- | sys/dev/pcmcia/wdc_pcmcia.c | 5 |
2 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/pcmcia/pcmcia.c b/sys/dev/pcmcia/pcmcia.c index ef59a7e837f..2637c5e0a20 100644 --- a/sys/dev/pcmcia/pcmcia.c +++ b/sys/dev/pcmcia/pcmcia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pcmcia.c,v 1.45 2011/09/17 15:38:43 miod Exp $ */ +/* $OpenBSD: pcmcia.c,v 1.46 2012/10/08 21:47:50 deraadt Exp $ */ /* $NetBSD: pcmcia.c,v 1.9 1998/08/13 02:10:55 eeh Exp $ */ /* @@ -140,6 +140,7 @@ pcmcia_activate(struct device *self, int act) switch (act) { case DVACT_QUIESCE: case DVACT_SUSPEND: + case DVACT_POWERDOWN: case DVACT_RESUME: for (pf = SIMPLEQ_FIRST(&sc->card.pf_head); pf != NULL; pf = SIMPLEQ_NEXT(pf, pf_list)) { diff --git a/sys/dev/pcmcia/wdc_pcmcia.c b/sys/dev/pcmcia/wdc_pcmcia.c index 803419cc976..ac42b8a3a3e 100644 --- a/sys/dev/pcmcia/wdc_pcmcia.c +++ b/sys/dev/pcmcia/wdc_pcmcia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wdc_pcmcia.c,v 1.27 2011/07/03 15:47:17 matthew Exp $ */ +/* $OpenBSD: wdc_pcmcia.c,v 1.28 2012/10/08 21:47:50 deraadt Exp $ */ /* $NetBSD: wdc_pcmcia.c,v 1.19 1999/02/19 21:49:43 abs Exp $ */ /*- @@ -436,6 +436,9 @@ wdc_pcmcia_activate(self, act) break; case DVACT_SUSPEND: rv = config_activate_children(self, act); + break; + case DVACT_POWERDOWN: + rv = config_activate_children(self, act); if (sc->sc_ih) pcmcia_intr_disestablish(sc->sc_pf, sc->sc_ih); sc->sc_ih = NULL; |