kern/113406: [xl] Page fault in XL0 device driver (regression)

NORCOTT381 at aol.com NORCOTT381 at aol.com
Tue Sep 4 12:10:08 PDT 2007


The following reply was made to PR kern/113406; it has been noted by GNATS.

From: NORCOTT381 at aol.com
To: bug-followup at FreeBSD.org, rdls at 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
 
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 <HTML><HEAD>
 <META http-equiv=3DContent-Type content=3D"text/html; charset=3DUS-ASCII">
 <META content=3D"MSHTML 6.00.2900.2963" name=3DGENERATOR></HEAD>
 <BODY id=3Drole_body style=3D"FONT-SIZE: 10pt; COLOR: #000000; FONT-FAMILY:=20=
 Arial"=20
 bottomMargin=3D7 leftMargin=3D7 topMargin=3D7 rightMargin=3D7><FONT id=3Drol=
 e_document=20
 face=3DArial color=3D#000000 size=3D2>
 <DIV>Hi, On my pc running the ifconfig command 2 times&nbsp;recreates the er=
 ror.=20
 </DIV>
 <DIV>Looking at the code&nbsp;in if_xl.c:</DIV>
 <DIV>&nbsp;</DIV>
 <DIV>&nbsp;</DIV>
 <DIV>&nbsp;</DIV>
 <DIV>static int<BR>xl_ifmedia_upd(struct ifnet *ifp)<BR>{<BR>struct xl_softc=
  *sc=20
 =3D ifp-&gt;if_softc;<BR>struct ifmedia *ifm =3D NULL;<BR>struct mii_data *m=
 ii =3D=20
 NULL;<BR><BR>XL_LOCK(sc);<BR><BR>if (sc-&gt;xl_miibus !=3D NULL)<BR>mii =3D=20
 device_get_softc(sc-&gt;xl_miibus);<BR>if (mii =3D=3D NULL)<BR>ifm =3D=20
 &amp;sc-&gt;ifmedia;<BR>else<BR>ifm =3D &amp;mii-&gt;mii_media;<BR><BR>switc=
 h=20
 (IFM_SUBTYPE(ifm-&gt;ifm_media)) {<BR>case IFM_100_FX:<BR>case=20
 IFM_10_FL:<BR>case IFM_10_2:<BR>case IFM_10_5:<BR>xl_setmode(sc,=20
 ifm-&gt;ifm_media);<BR><STRONG>return (0);</STRONG>&nbsp;&nbsp;=20
 &lt;----------&nbsp;*** does not release lock=20
 ****<BR>break;<BR>default:<BR>break;<BR>}<BR><BR>if (sc-&gt;xl_media &amp;=20
 XL_MEDIAOPT_MII ||<BR>&nbsp;&nbsp;&nbsp; sc-&gt;xl_media &amp; XL_MEDIAOPT_B=
 TX=20
 ||<BR>&nbsp;&nbsp;&nbsp; sc-&gt;xl_media &amp; XL_MEDIAOPT_BT4)=20
 {<BR>xl_init_locked(sc);<BR>} else {<BR>xl_setmode(sc,=20
 ifm-&gt;ifm_media);<BR>}<BR><BR>XL_UNLOCK(sc);<BR><BR>return (0);<BR>}<BR></=
 DIV>
 <DIV>&nbsp;</DIV>
 <DIV>&nbsp;</DIV>
 <DIV>This return does not release the lock at the begining.</DIV>
 <DIV>&nbsp;</DIV>
 <DIV>I removed the 'return(0);' and the pc does not produce the error and al=
 lows=20
 me to change the media.</DIV>
 <DIV>&nbsp;</DIV>
 <DIV>At the moment I cannot test the BNC part.</DIV>
 <DIV>&nbsp;</DIV>
 <DIV>&nbsp;</DIV>
 <DIV>&nbsp;</DIV>
 <DIV>pn.</DIV></FONT>   </BODY></HTML>
 
 -------------------------------1188931894--


More information about the freebsd-bugs mailing list