From owner-freebsd-current@FreeBSD.ORG Mon Aug 28 12:08:31 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3F2C316A4F3; Mon, 28 Aug 2006 12:08:31 +0000 (UTC) (envelope-from lavalamp@spiritual-machines.org) Received: from mail.digitalfreaks.org (arbitor.digitalfreaks.org [216.151.95.158]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5E27343D7D; Mon, 28 Aug 2006 12:08:30 +0000 (GMT) (envelope-from lavalamp@spiritual-machines.org) Received: by mail.digitalfreaks.org (Postfix, from userid 1022) id B572C17A22; Mon, 28 Aug 2006 08:08:27 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.digitalfreaks.org (Postfix) with ESMTP id B44AE17A0F; Mon, 28 Aug 2006 08:08:27 -0400 (EDT) Date: Mon, 28 Aug 2006 08:08:27 -0400 (EDT) From: "Brian A. Seklecki" X-X-Sender: lavalamp@arbitor.digitalfreaks.org To: Oleg Bulyzhin In-Reply-To: <20060818065340.GA42776@lath.rinet.ru> Message-ID: <20060828080516.A65578@arbitor.digitalfreaks.org> References: <43767.150.101.159.26.1140420612.squirrel@mailbox.TU-Berlin.DE> <20060720104238.L8726@arbitor.digitalfreaks.org> <20060807100622.GY96644@cell.sick.ru> <20060810160126.E55918@arbitor.digitalfreaks.org> <20060816191152.J69548@arbitor.digitalfreaks.org> <20060818065340.GA42776@lath.rinet.ru> MIME-Version: 1.0 Content-Type: MULTIPART/Mixed; BOUNDARY=AqsLC8rIMeq19msA Content-ID: <20060828080516.Q65578@arbitor.digitalfreaks.org> Content-Disposition: INLINE Cc: netops@collaborativefusion.com, Gleb Smirnoff , freebsd-current@freebsd.org Subject: Re: Dell PowerEdge 850 bge(4) RELENG_6 (WAS: Re: bge(4) problem) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Aug 2006 12:08:31 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --AqsLC8rIMeq19msA Content-Type: TEXT/PLAIN; CHARSET=US-ASCII; format=flowed Content-ID: <20060828080516.E65578@arbitor.digitalfreaks.org> Content-Disposition: INLINE >>> >>> ~BAS >>> > > Could you please try attached patch? (can be applied to -current or releng_6). > Yes I confirm that this seems to facilitate proper speed/duplex negotiation. I will beat up the driver a bit now with some aggressive NFS work. ~BAS --AqsLC8rIMeq19msA Content-Type: TEXT/PLAIN; CHARSET=us-ascii Content-ID: <20060828080516.P65578@arbitor.digitalfreaks.org> Content-Description: Content-Disposition: ATTACHMENT; FILENAME=bge_lock_ifmcallbacks.diff Index: if_bge.c =================================================================== RCS file: /home/ncvs/src/sys/dev/bge/if_bge.c,v retrieving revision 1.137 diff -u -r1.137 if_bge.c --- if_bge.c 17 Aug 2006 09:53:04 -0000 1.137 +++ if_bge.c 18 Aug 2006 06:41:18 -0000 @@ -3226,17 +3226,19 @@ static int bge_ifmedia_upd(struct ifnet *ifp) { - struct bge_softc *sc; + struct bge_softc *sc = ifp->if_softc; struct mii_data *mii; struct ifmedia *ifm; - sc = ifp->if_softc; + BGE_LOCK(sc); ifm = &sc->bge_ifmedia; /* If this is a 1000baseX NIC, enable the TBI port. */ if (sc->bge_tbi) { - if (IFM_TYPE(ifm->ifm_media) != IFM_ETHER) + if (IFM_TYPE(ifm->ifm_media) != IFM_ETHER) { + BGE_UNLOCK(sc); return (EINVAL); + } switch(IFM_SUBTYPE(ifm->ifm_media)) { case IFM_AUTO: /* @@ -3268,8 +3270,10 @@ } break; default: + BGE_UNLOCK(sc); return (EINVAL); } + BGE_UNLOCK(sc); return (0); } @@ -3283,6 +3287,7 @@ } mii_mediachg(mii); + BGE_UNLOCK(sc); return (0); } @@ -3292,11 +3297,10 @@ static void bge_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr) { - struct bge_softc *sc; + struct bge_softc *sc = ifp->if_softc; struct mii_data *mii; - sc = ifp->if_softc; - + BGE_LOCK(sc); if (sc->bge_tbi) { ifmr->ifm_status = IFM_AVALID; ifmr->ifm_active = IFM_ETHER; @@ -3305,6 +3309,7 @@ ifmr->ifm_status |= IFM_ACTIVE; else { ifmr->ifm_active |= IFM_NONE; + BGE_UNLOCK(sc); return; } ifmr->ifm_active |= IFM_1000_SX; @@ -3312,6 +3317,7 @@ ifmr->ifm_active |= IFM_HDX; else ifmr->ifm_active |= IFM_FDX; + BGE_UNLOCK(sc); return; } @@ -3319,6 +3325,8 @@ mii_pollstat(mii); ifmr->ifm_active = mii->mii_media_active; ifmr->ifm_status = mii->mii_media_status; + + BGE_UNLOCK(sc); } static int --AqsLC8rIMeq19msA--