> -----Original Message----- > From: Florian Fainelli [mailto:f.faine...@gmail.com] > Sent: Saturday, August 15, 2015 1:02 AM > To: shh....@gmail.com; netdev@vger.kernel.org; da...@davemloft.net > Cc: Xie Shaohui-B21989 > Subject: Re: [PATCH] net: phy: fix PHY_RUNNING in phy_state_machine > > Le 08/13/15 21:23, shh....@gmail.com a écrit : > > From: Shaohui Xie <shaohui....@freescale.com> > > > > Currently, if phy state is PHY_RUNNING, we always register a CHANGE > > when phy works in polling or interrupt ignored, this will make the > > adjust_link being called even the phy link did Not changed. > > Right, which is why most drivers do implement a caching scheme. > > > > > checking the phy link to make sure the link did changed before we > > register a CHANGE, if link did not changed, we do nothing. > > With your change we will end-up with virtually polling a PHY twice as fast as > we > used to with the RUNNING -> CHANGELINK -> RUNNING transition (current state > transitions), [S.H] Yes. If the link did changed, we'll polling the PHY status twice with my change, but if the link did not changed, we'll only need polling the PHY status without calling adjust_link, for phy_state_machine works in polling mode at frequency of HZ, many adjust_link can be saved.
> which is probably fine, but puts a bit more pressure on the (slow) > MDIO bus since we end-up with two additional reads to latch the link status > register. [S.H] Yes, but adjust_link in most driver is more complex than reading PHY status. And the link won't be changed very frequently. > > PS: I would appreciate if you could CC me on future libphy submissions. [S.H] OK. Thanks for reviewing! Shaohui