From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from 7.mo5.mail-out.ovh.net ([178.32.124.100] helo=mo5.mail-out.ovh.net) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TYkAL-0003op-E8 for barebox@lists.infradead.org; Wed, 14 Nov 2012 21:06:35 +0000 Received: from mail609.ha.ovh.net (b6.ovh.net [213.186.33.56]) by mo5.mail-out.ovh.net (Postfix) with SMTP id 9B16FFFA2CF for ; Wed, 14 Nov 2012 22:14:10 +0100 (CET) Date: Wed, 14 Nov 2012 22:04:30 +0100 From: Jean-Christophe PLAGNIOL-VILLARD Message-ID: <20121114210430.GB31820@game.jcrosoft.org> References: <1352926999-14981-1-git-send-email-plagnioj@jcrosoft.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1352926999-14981-1-git-send-email-plagnioj@jcrosoft.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: barebox-bounces@lists.infradead.org Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: Re: [PATCH 1/1] phy: if the link partner just ack us wait the end of the autoneg To: barebox@lists.infradead.org On 22:03 Wed 14 Nov , Jean-Christophe PLAGNIOL-VILLARD wrote: > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD > --- this will detect that the phy was jsut notified that the link is up Best Regards, J. > drivers/net/phy/phy.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c > index 43738c2..daa657f 100644 > --- a/drivers/net/phy/phy.c > +++ b/drivers/net/phy/phy.c > @@ -578,6 +578,18 @@ int genphy_read_status(struct phy_device *phydev) > if (lpa < 0) > return lpa; > > + if (lpa & LPA_LPACK) { > + int ret; > + > + ret = phy_aneg_done(phydev); > + if (ret) > + return ret; > + > + lpa = phy_read(phydev, MII_LPA); > + if (lpa < 0) > + return lpa; > + } > + > adv = phy_read(phydev, MII_ADVERTISE); > > if (adv < 0) > -- > 1.7.10.4 > _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox