From owner-freebsd-current@FreeBSD.ORG Thu Jul 1 22:07:20 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8649106566C; Thu, 1 Jul 2010 22:07:20 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 8A91B8FC1B; Thu, 1 Jul 2010 22:07:20 +0000 (UTC) Received: by pwj9 with SMTP id 9so385111pwj.13 for ; Thu, 01 Jul 2010 15:07:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=JGjGLj7pvf0SzjmW+HWI0Po+8Re7yumjVN7KnumRAwo=; b=DbAsT39cLEUCkVC5XxMxorRVz0eC2qAfrXUle+inm1xD4i7WxNtRDlRyhdHpV8TUG8 LvaXWcB3YYJKinbqi+ra/DSo4/fHFOtCwo6YzNqgn4bG0vA5yPgY9yu7qLnhuRLCQ6MF vX53/6wcUn+S0L2iklSIDzqOrYRq20oKRpmDw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=AcPByCnJ16DsFtfqpCZcnUqBmJL+TqPxTz+G1kc4ITLSNMFxphHU/N8caAwl0pX3hF p0rglPOAYzjxFXzfHllBNhp+puakC/uz4HPoon10Mjzqf9IppVAW4D95Q8h1rpFd3HNR IG5zQVlHHOq8eZ6uHEUE+IJZgF/90sePZuyGc= Received: by 10.142.232.21 with SMTP id e21mr198797wfh.92.1278022034202; Thu, 01 Jul 2010 15:07:14 -0700 (PDT) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id z1sm13447wfd.15.2010.07.01.15.07.12 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 01 Jul 2010 15:07:13 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Thu, 1 Jul 2010 15:06:46 -0700 From: Pyun YongHyeon Date: Thu, 1 Jul 2010 15:06:46 -0700 To: Norikatsu Shigemura Message-ID: <20100701220646.GD7090@michelle.cdnetworks.com> References: <20100613233723.ed2c3a30.nork@FreeBSD.org> <20100615180923.GH4257@michelle.cdnetworks.com> <20100620211500.c344b654.nork@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100620211500.c344b654.nork@FreeBSD.org> User-Agent: Mutt/1.4.2.3i Cc: Kristof Provost , freebsd-arm@freebsd.org, freebsd-current@freebsd.org, yongari@freebsd.org Subject: Re: [OpenRD Ultimate] e1000phy(88E1149/88E1121) has a initialize issue X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jul 2010 22:07:20 -0000 On Sun, Jun 20, 2010 at 09:15:00PM +0900, Norikatsu Shigemura wrote: > Hi yongari. > > On Tue, 15 Jun 2010 11:09:23 -0700 > Pyun YongHyeon wrote: > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > > Jun 13 05:02:14 sidearms kernel: mge1: watchdog timeout > > > Jun 13 05:02:14 sidearms kernel: mge1: Timeout on link-up > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > This part looks like a bug in mge(4). Driver does not know how long > > it would take to get a valid link. Waiting for valid link in driver > > initialization does not work(e.g Starting controller without UTP > > cable may always fail on mge(4)). I think mge(4) should implement > > correct link state change handling. > > Thanks for your pointed out. I didn't notice. > I'll fix this issue like following on mge_start_locked(). > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > - if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != > - IFF_DRV_RUNNING) > + if (IFM_SUBTYPE(sc->mii->mii_media_active) == IFM_NONE || > + (ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != IFF_DRV_RUNNING) No, that change may not enough to fix a missing link state handling. mge(4) needs a miibus_statchg KOBJ handler and it requires a lot of code changes in mge(4). > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > > > I found a initialize issue in e1000phy.c. > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > > --- sys/dev/mii/e1000phy.c.orig 2010-05-01 10:17:15.282196000 +0900 > > > +++ sys/dev/mii/e1000phy.c 2010-06-13 16:19:46.616650536 +0900 > > > @@ -278,6 +278,7 @@ > > > case MII_MODEL_MARVELL_E1118: > > > break; > > > case MII_MODEL_MARVELL_E1116: > > > + case MII_MODEL_MARVELL_E1149: > > > page = PHY_READ(sc, E1000_EADR); > > > /* Select page 3, LED control register. */ > > > PHY_WRITE(sc, E1000_EADR, 3); > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > > I confirmed OK on my environment, OpenRD Ultimate has a 88E1121(I > > > saw it, physically): > > Once it was there but I removed it due to some other issues seen on > > Yukon Ultra. That part will program LED access so I guess it > > wouldn't affect normal network activity. > > Hum..., like following? At least, by current way, second NIC > doesn't link-up if link connected. > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > case MII_MODEL_MARVELL_E1118: > + case MII_MODEL_MARVELL_E1149: > break; This change was also backed out due to 88E8072 issue on establishing 100Mbps link. e1000phy(4)'s 88E1149 PHY handling seems to require more work as some Yukon Ultra/Ultra II still have problems. ATM I have no idea whether this issue comes from MAC controller or not. > case MII_MODEL_MARVELL_E1116: > page = PHY_READ(sc, E1000_EADR); > /* Select page 3, LED control register. */ > PHY_WRITE(sc, E1000_EADR, 3); > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > > > 88E1116R might be RGMII variant of 88E1116. Because I don't have > > controller that has 88E1116R I didn't treat it as 88E1116. With > > that change could you use straight cable without help of MDI/MDI-X > > converter? > > Sorry, I don't have 88E1116R machine, so I don't know. Ok.