From: kettenis Date: Mon, 26 Jul 2010 19:21:24 +0000 (+0000) Subject: Make sure we stop DMA before suspend instead of doing it as the first thing X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=af57d6d73313558fa75505fc5efd0f78baccdc25;p=openbsd 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@ --- 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);