lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 17 Aug 2015 07:48:32 +0000
From:	Shaohui Xie <Shaohui.Xie@...escale.com>
To:	Florian Fainelli <f.fainelli@...il.com>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"davem@...emloft.net" <davem@...emloft.net>
Subject: RE: [PATCH] net: phy: fix PHY_RUNNING in phy_state_machine

> -----Original Message-----
> From: Florian Fainelli [mailto:f.fainelli@...il.com]
> Sent: Saturday, August 15, 2015 1:02 AM
> To: shh.xie@...il.com; netdev@...r.kernel.org; davem@...emloft.net
> Cc: Xie Shaohui-B21989
> Subject: Re: [PATCH] net: phy: fix PHY_RUNNING in phy_state_machine
> 
> Le 08/13/15 21:23, shh.xie@...il.com a écrit :
> > From: Shaohui Xie <Shaohui.Xie@...escale.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), 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] How about put the link checking in state PHY_CHANGELINK, if the link did changed,
Continue to original handle, if the link did not changed, modify the state to PHY_RUNNING?

        case PHY_CHANGELINK:
+               old_link = phydev->link;
                err = phy_read_status(phydev);
                if (err)
                        break;
 
+               if (old_link == phydev->link) {
+                       phydev->state = PHY_RUNNING;
+                       break;
+               }
+

Thanks!
Shaohui

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ