summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2010-07-26 19:21:25 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2010-07-26 19:21:25 +0000
commit37def8959d7d7dc3b3577550dc1f45712c3646b2 (patch)
tree1df9eece6aa0bae72726c2daefd4886340c3926f /sys
parent4087d1b05a57cc379d3a244379b2e3d9e2b370a4 (diff)
Make sure we stop DMA before suspend instead of doing it as the first thing
we do upon resume and failing to cope with the fact that the state has changed under our feet. Fixes watchdog timeout issues in at least one case. ok deraadt@, tested by thib@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/if_em.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/pci/if_em.c b/sys/dev/pci/if_em.c
index 58bbb633025..5de45f7fdde 100644
--- a/sys/dev/pci/if_em.c
+++ b/sys/dev/pci/if_em.c
@@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE.
***************************************************************************/
-/* $OpenBSD: if_em.c,v 1.240 2010/06/28 20:24:39 jsg Exp $ */
+/* $OpenBSD: if_em.c,v 1.241 2010/07/26 19:21:24 kettenis Exp $ */
/* $FreeBSD: if_em.c,v 1.46 2004/09/29 18:28:28 mlaier Exp $ */
#include <dev/pci/if_em.h>
@@ -1895,11 +1895,12 @@ em_activate(struct device *self, int act)
switch (act) {
case DVACT_SUSPEND:
+ if (ifp->if_flags & IFF_RUNNING)
+ em_stop(sc, 0);
/* We have no children atm, but we will soon */
rv = config_activate_children(self, act);
break;
case DVACT_RESUME:
- em_stop(sc, 0);
rv = config_activate_children(self, act);
if (ifp->if_flags & IFF_UP)
em_init(sc);