From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from 12.mo5.mail-out.ovh.net ([46.105.39.65] helo=mo5.mail-out.ovh.net) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T9tLY-0001qK-FG for barebox@lists.infradead.org; Fri, 07 Sep 2012 07:51:25 +0000 Received: from mail434.ha.ovh.net (b9.ovh.net [213.186.33.59]) by mo5.mail-out.ovh.net (Postfix) with SMTP id B5542FFA89A for ; Fri, 7 Sep 2012 09:56:40 +0200 (CEST) Date: Fri, 7 Sep 2012 09:51:13 +0200 From: Eric =?ISO-8859-1?B?QuluYXJk?= Message-ID: <20120907095113.02bdc12e@eb-e6520> In-Reply-To: <20120907074734.GO26594@pengutronix.de> References: <1346960371-4129-1-git-send-email-eric@eukrea.com> <20120907065703.GM26594@pengutronix.de> <20120907093000.35f2227d@eb-e6520> <20120907074734.GO26594@pengutronix.de> Mime-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: barebox-bounces@lists.infradead.org Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: Re: [PATCH 1/3] fec: restart autoneg at open instead of init To: Sascha Hauer Cc: barebox@lists.infradead.org Hi Sascha, Le Fri, 7 Sep 2012 09:47:34 +0200, Sascha Hauer a =E9crit : > On Fri, Sep 07, 2012 at 09:30:00AM +0200, Eric B=E9nard wrote: > > Hi Sascha, > > = > > Le Fri, 7 Sep 2012 08:57:03 +0200, > > Sascha Hauer a =E9crit : > > = > > > Hi Eric, > > > = > > > On Thu, Sep 06, 2012 at 09:39:29PM +0200, Eric B=E9nard wrote: > > > > this saves some time during boot when ethernet is not needed in bar= ebox > > > = > > > Is this really significant on your hardware? I made a measurement here > > > and the miidev_restart_aneg() takes 130us on an i.MX27 board. > > > = > > > The original intention of doing it at init time was that autonegotati= on > > > is already completed when we actually use the network. And this time > > > really is significant: > > > = > > > without the patch: > > > = > > > barebox@Phytec phyCORE-i.MX27:/ time ping 192.168.23.4 > > > warning: No MAC address set. Using random address 62:FE:FE:0B:09:A8 > > > phy0: Link is up - 100/Full > > > host 192.168.23.4 is alive > > > time: 10ms > > > = > > > with the patch: > > > = > > > barebox@Phytec phyCORE-i.MX27:/ time ping 192.168.23.4 > > > warning: No MAC address set. Using random address A6:1B:AB:80:FA:E7 > > > phy0: Link is up - 100/Full > > > host 192.168.23.4 is alive > > > time: 2040ms > > > = > > that strange. I don't see why miidev_restart_aneg() would take less > > time at boot than at open. > = > Well, it does not really take longer. The difference is that if you are > sitting before your board it usually takes a few seconds to interrupt > autoboot, think what you want to do, and finally enter some network > command. In the meantime autonegotiation will be complete. If we start > autonegotiation at open time, we will always have to wait for the full > autonegotiation time after starting the first network command. > = I didn't check but on my board, the problem may be similar to the 1G wrong detection : if miidev_restart_aneg is trying to acess the phy when the MII link is not yet initialized, then it would wait 1s for the reset to timeout in miidev_restart_aneg which would explain why I save 1s with this patch. Eric _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox