aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruce M Simpson <bms@FreeBSD.org>2004-10-28 17:51:33 +0000
committerBruce M Simpson <bms@FreeBSD.org>2004-10-28 17:51:33 +0000
commit2cadbb916ef4f0a2ec050e10d2da2e46d7ef2fa5 (patch)
tree67c3434f1aba1bbe122ec47401362a1a499200ea
parent2b44df41d5b187932f6a466e182f6e18051d19b7 (diff)
downloadsrc-2cadbb916ef4f0a2ec050e10d2da2e46d7ef2fa5.tar.gz
src-2cadbb916ef4f0a2ec050e10d2da2e46d7ef2fa5.zip
MFC of rev 1.99:
Fix a panic during shutdown on SMP machines, by forcing interrupts to be disabled, and avoiding recursive acquisition of the driver mutex. CVS tag slip pending by kensmith@. Approved by: re@ Tested by: seb at struchtrup dot com PR: kern/62889
Notes
Notes: svn path=/releng/5.3/; revision=137021
-rw-r--r--sys/pci/if_vr.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/sys/pci/if_vr.c b/sys/pci/if_vr.c
index b1eeebbea52f..6febeaf05d73 100644
--- a/sys/pci/if_vr.c
+++ b/sys/pci/if_vr.c
@@ -798,7 +798,9 @@ vr_detach(device_t dev)
/* These should only be active if attach succeeded */
if (device_is_attached(dev)) {
vr_stop(sc);
+ VR_UNLOCK(sc); /* XXX: Avoid recursive acquire. */
ether_ifdetach(ifp);
+ VR_LOCK(sc);
}
if (sc->vr_miibus)
device_delete_child(dev, sc->vr_miibus);
@@ -1231,8 +1233,15 @@ vr_intr(void *arg)
VR_LOCK(sc);
- if (sc->suspended)
+ if (sc->suspended) {
+ /*
+ * Forcibly disable interrupts.
+ * XXX: Mobile VIA based platforms may need
+ * interrupt re-enable on resume.
+ */
+ CSR_WRITE_2(sc, VR_IMR, 0x0000);
goto done_locked;
+ }
#ifdef DEVICE_POLLING
if (ifp->if_flags & IFF_POLLING)
@@ -1690,9 +1699,6 @@ vr_stop(struct vr_softc *sc)
static void
vr_shutdown(device_t dev)
{
- struct vr_softc *sc = device_get_softc(dev);
- VR_LOCK(sc);
- vr_stop(sc);
- VR_UNLOCK(sc);
+ vr_detach(dev);
}