diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2010-08-12 14:21:56 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2010-08-12 14:21:56 +0000 |
commit | fd743ecb5be1a7d2b407ccde45bb6acddd44be69 (patch) | |
tree | 7866284180010eba58b1d122120152b9ca1420db /sys | |
parent | e6c2e2c930ae1c183b1a0264f6d6f9506aa603f5 (diff) |
Reset the chip upon suspend, to make sure it stops DMA. Reset it again upon
resume to make sure the chip is initialized the same way as upon attach.
Fixes memory corruption after resume on the Dell Inspirion 4150.
ok deraadt@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ic/xl.c | 3 | ||||
-rw-r--r-- | sys/dev/ic/xlreg.h | 3 | ||||
-rw-r--r-- | sys/dev/pci/if_xl_pci.c | 7 |
3 files changed, 8 insertions, 5 deletions
diff --git a/sys/dev/ic/xl.c b/sys/dev/ic/xl.c index c2e7b172870..ad2a1c1ede4 100644 --- a/sys/dev/ic/xl.c +++ b/sys/dev/ic/xl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xl.c,v 1.90 2010/08/06 02:45:53 deraadt Exp $ */ +/* $OpenBSD: xl.c,v 1.91 2010/08/12 14:21:55 kettenis Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -179,7 +179,6 @@ void xl_setmode(struct xl_softc *, int); void xl_iff(struct xl_softc *); void xl_iff_90x(struct xl_softc *); void xl_iff_905b(struct xl_softc *); -void xl_reset(struct xl_softc *); int xl_list_rx_init(struct xl_softc *); int xl_list_tx_init(struct xl_softc *); int xl_list_tx_init_90xB(struct xl_softc *); diff --git a/sys/dev/ic/xlreg.h b/sys/dev/ic/xlreg.h index 77949edd418..9939cebe734 100644 --- a/sys/dev/ic/xlreg.h +++ b/sys/dev/ic/xlreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: xlreg.h,v 1.21 2010/08/06 02:45:53 deraadt Exp $ */ +/* $OpenBSD: xlreg.h,v 1.22 2010/08/12 14:21:55 kettenis Exp $ */ /* * Copyright (c) 1997, 1998 @@ -745,3 +745,4 @@ extern void xl_attach(struct xl_softc *); extern int xl_detach(struct xl_softc *); void xl_init(void *); void xl_stop(struct xl_softc *); +void xl_reset(struct xl_softc *); diff --git a/sys/dev/pci/if_xl_pci.c b/sys/dev/pci/if_xl_pci.c index c01e9ea77c4..15bc79c4700 100644 --- a/sys/dev/pci/if_xl_pci.c +++ b/sys/dev/pci/if_xl_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_xl_pci.c,v 1.30 2010/08/06 02:45:54 deraadt Exp $ */ +/* $OpenBSD: if_xl_pci.c,v 1.31 2010/08/12 14:21:55 kettenis Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -346,11 +346,14 @@ xl_pci_activate(struct device *self, int act) switch (act) { case DVACT_SUSPEND: - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_flags & IFF_RUNNING) { + xl_reset(sc); xl_stop(sc); + } config_activate_children(self, act); break; case DVACT_RESUME: + xl_reset(sc); config_activate_children(self, act); if (ifp->if_flags & IFF_UP) xl_init(sc); |