From af57d6d73313558fa75505fc5efd0f78baccdc25 Mon Sep 17 00:00:00 2001 From: kettenis Date: Mon, 26 Jul 2010 19:21:24 +0000 Subject: [PATCH] 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@ --- sys/dev/pci/if_em.c | 5 +++-- 1 file 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 @@ -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); -- 2.20.1