From owner-freebsd-bugs@FreeBSD.ORG Tue Sep 4 19:10:08 2007 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3428216A419 for ; Tue, 4 Sep 2007 19:10:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 21A3713C461 for ; Tue, 4 Sep 2007 19:10:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l84JA7Wi002987 for ; Tue, 4 Sep 2007 19:10:07 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l84JA7hT002986; Tue, 4 Sep 2007 19:10:07 GMT (envelope-from gnats) Date: Tue, 4 Sep 2007 19:10:07 GMT Message-Id: <200709041910.l84JA7hT002986@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: NORCOTT381@aol.com Cc: Subject: Re: kern/113406: [xl] Page fault in XL0 device driver (regression) X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: NORCOTT381@aol.com List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2007 19:10:08 -0000 The following reply was made to PR kern/113406; it has been noted by GNATS. From: NORCOTT381@aol.com To: bug-followup@FreeBSD.org, rdls@satamatics.com Cc: Subject: Re: kern/113406: [xl] Page fault in XL0 device driver (regression) Date: Tue, 4 Sep 2007 14:51:34 EDT -------------------------------1188931894 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Hi, On my pc running the ifconfig command 2 times recreates the error. Looking at the code in if_xl.c: static int xl_ifmedia_upd(struct ifnet *ifp) { struct xl_softc *sc = ifp->if_softc; struct ifmedia *ifm = NULL; struct mii_data *mii = NULL; XL_LOCK(sc); if (sc->xl_miibus != NULL) mii = device_get_softc(sc->xl_miibus); if (mii == NULL) ifm = &sc->ifmedia; else ifm = &mii->mii_media; switch (IFM_SUBTYPE(ifm->ifm_media)) { case IFM_100_FX: case IFM_10_FL: case IFM_10_2: case IFM_10_5: xl_setmode(sc, ifm->ifm_media); return (0); <---------- *** does not release lock **** break; default: break; } if (sc->xl_media & XL_MEDIAOPT_MII || sc->xl_media & XL_MEDIAOPT_BTX || sc->xl_media & XL_MEDIAOPT_BT4) { xl_init_locked(sc); } else { xl_setmode(sc, ifm->ifm_media); } XL_UNLOCK(sc); return (0); } This return does not release the lock at the begining. I removed the 'return(0);' and the pc does not produce the error and allows me to change the media. At the moment I cannot test the BNC part. pn. -------------------------------1188931894 Content-Type: text/html; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable
Hi, On my pc running the ifconfig command 2 times recreates the er= ror.=20
Looking at the code in if_xl.c:
 
 
 
static int
xl_ifmedia_upd(struct ifnet *ifp)
{
struct xl_softc= *sc=20 =3D ifp->if_softc;
struct ifmedia *ifm =3D NULL;
struct mii_data *m= ii =3D=20 NULL;

XL_LOCK(sc);

if (sc->xl_miibus !=3D NULL)
mii =3D=20 device_get_softc(sc->xl_miibus);
if (mii =3D=3D NULL)
ifm =3D=20 &sc->ifmedia;
else
ifm =3D &mii->mii_media;

switc= h=20 (IFM_SUBTYPE(ifm->ifm_media)) {
case IFM_100_FX:
case=20 IFM_10_FL:
case IFM_10_2:
case IFM_10_5:
xl_setmode(sc,=20 ifm->ifm_media);
return (0);  =20 <---------- *** does not release lock=20 ****
break;
default:
break;
}

if (sc->xl_media &=20 XL_MEDIAOPT_MII ||
    sc->xl_media & XL_MEDIAOPT_B= TX=20 ||
    sc->xl_media & XL_MEDIAOPT_BT4)=20 {
xl_init_locked(sc);
} else {
xl_setmode(sc,=20 ifm->ifm_media);
}

XL_UNLOCK(sc);

return (0);
}
 
 
This return does not release the lock at the begining.
 
I removed the 'return(0);' and the pc does not produce the error and al= lows=20 me to change the media.
 
At the moment I cannot test the BNC part.
 
 
 
pn.
-------------------------------1188931894--