[PATCH 1/1] phy: phy_update_status wait auto neg done when enabled

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Wed Nov 14 12:24:17 EST 2012


On 13:04 Wed 14 Nov     , Sascha Hauer wrote:
> On Wed, Nov 14, 2012 at 10:34:58AM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > On 09:05 Wed 14 Nov     , Sascha Hauer wrote:
> > > On Tue, Nov 13, 2012 at 10:14:05PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > > >  
> > > >  int phy_update_status(struct phy_device *dev)
> > > >  {
> > > > @@ -35,11 +54,18 @@ int phy_update_status(struct phy_device *dev)
> > > >  	struct eth_device *edev = dev->attached_dev;
> > > >  	int ret;
> > > >  	int oldspeed = dev->speed, oldduplex = dev->duplex;
> > > > +	int old_link = dev->link;
> > > >  
> > > >  	ret = drv->read_status(dev);
> > > >  	if (ret)
> > > >  		return ret;
> > > >  
> > > > +	if (dev->link && !old_link) {
> > > > +		ret = phy_wait_aneg_read_status(dev, drv);
> > > > +		if (ret)
> > > > +			return ret;
> > > > +	}
> > > 
> > > This does not help. dev->link is false after reset, so we never get into
> > > phy_wait_aneg_read_status() which waits for a link.
> > read_status update the dev->link as we call update_link
> > 
> > if !dev->link means no cable detected
> 
> How should the phy detect the cable if we do not wait for it being
> detected?
we do not have too

I'm going to try on the loco

Best Regards,
J.



More information about the barebox mailing list