From 8ab79fb0e1b6d090e76d1492b98238fb768491e7 Mon Sep 17 00:00:00 2001 From: Scott Long Date: Wed, 11 Aug 2004 04:30:49 +0000 Subject: [PATCH] Revert rev 1.93 and replace it by grabbing the vr lock before calling mii_pollstat(). The previous was causing the vr lock to recurse. PR: kern/70189 --- sys/dev/vr/if_vr.c | 4 ++-- sys/pci/if_vr.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/dev/vr/if_vr.c b/sys/dev/vr/if_vr.c index 9f7025b86890..b1eeebbea52f 100644 --- a/sys/dev/vr/if_vr.c +++ b/sys/dev/vr/if_vr.c @@ -503,9 +503,7 @@ vr_miibus_statchg(device_t dev) struct vr_softc *sc = device_get_softc(dev); mii = device_get_softc(sc->vr_miibus); - VR_LOCK(sc); vr_setcfg(sc, mii->mii_media_active); - VR_UNLOCK(sc); } /* @@ -1563,7 +1561,9 @@ vr_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr) struct mii_data *mii; mii = device_get_softc(sc->vr_miibus); + VR_LOCK(sc); mii_pollstat(mii); + VR_UNLOCK(sc); ifmr->ifm_active = mii->mii_media_active; ifmr->ifm_status = mii->mii_media_status; } diff --git a/sys/pci/if_vr.c b/sys/pci/if_vr.c index 9f7025b86890..b1eeebbea52f 100644 --- a/sys/pci/if_vr.c +++ b/sys/pci/if_vr.c @@ -503,9 +503,7 @@ vr_miibus_statchg(device_t dev) struct vr_softc *sc = device_get_softc(dev); mii = device_get_softc(sc->vr_miibus); - VR_LOCK(sc); vr_setcfg(sc, mii->mii_media_active); - VR_UNLOCK(sc); } /* @@ -1563,7 +1561,9 @@ vr_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr) struct mii_data *mii; mii = device_get_softc(sc->vr_miibus); + VR_LOCK(sc); mii_pollstat(mii); + VR_UNLOCK(sc); ifmr->ifm_active = mii->mii_media_active; ifmr->ifm_status = mii->mii_media_status; }