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]
Message-ID: <65d22ad5-4db2-4e7d-b314-7cd3cd387335@lunn.ch>
Date: Fri, 12 Jan 2024 02:30:30 +0100
From: Andrew Lunn <andrew@...n.ch>
To: claudiu beznea <claudiu.beznea@...on.dev>
Cc: "Russell King (Oracle)" <linux@...linux.org.uk>, hkallweit1@...il.com,
	davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
	pabeni@...hat.com, yuiko.oshino@...rochip.com,
	netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
	Claudiu Beznea <claudiu.beznea.uj@...renesas.com>
Subject: Re: [PATCH net] net: phy: micrel: populate .soft_reset for KSZ9131

On Wed, Jan 10, 2024 at 03:20:19PM +0200, claudiu beznea wrote:
> Hi, Andrew, Russell,
> 
> On 05.01.2024 16:36, Andrew Lunn wrote:
> > On Fri, Jan 05, 2024 at 09:43:22AM +0000, Russell King (Oracle) wrote:
> >> On Fri, Jan 05, 2024 at 10:52:42AM +0200, Claudiu wrote:
> >>> The order of PHY-related operations in ravb_open() is as follows:
> >>> ravb_open() ->
> >>>   ravb_phy_start() ->
> >>>     ravb_phy_init() ->
> >>>       of_phy_connect() ->
> >>>         phy_connect_direct() ->
> >>> 	  phy_attach_direct() ->
> >>> 	    phy_init_hw() ->
> >>> 	      phydev->drv->soft_reset()
> >>> 	      phydev->drv->config_init()
> >>> 	      phydev->drv->config_intr()
> >>> 	    phy_resume()
> >>> 	      kszphy_resume()
> >>>
> >>> The order of PHY-related operations in ravb_close is as follows:
> >>> ravb_close() ->
> >>>   phy_stop() ->
> >>>     phy_suspend() ->
> >>>       kszphy_suspend() ->
> >>>         genphy_suspend()
> >>> 	  // set BMCR_PDOWN bit in MII_BMCR
> >>
> >> Andrew,
> >>
> >> This looks wrong to me - shouldn't we be resuming the PHY before
> >> attempting to configure it?
> > 
> > Hummm. The opposite of phy_stop() is phy_start(). So it would be the
> > logical order to perform the resume as the first action of
> > phy_start(), not phy_attach_direct().
> > 
> > In phy_connect_direct(), we don't need the PHY to be operational
> > yet. That happens with phy_start().
> > 
> > The standard says:
> > 
> >   22.2.4.1.5 Power down
> > 
> >   The PHY may be placed in a low-power consumption state by setting
> >   bit 0.11 to a logic one. Clearing bit 0.11 to zero allows normal
> >   operation. The specific behavior of a PHY in the power-down state is
> >   implementation specific. While in the power-down state, the PHY
> >   shall respond to management transactions.
> > 
> > So i would say this PHY is broken, its not responding to all
> > management transactions. So in that respect, Claudiu fix is correct.
> > 
> > But i also somewhat agree with you, this looks wrong, but in a
> > different way to how you see it. However, moving the phy_resume() to
> > phy_start() seems a bit risky. So i'm not sure we should actually do
> > that.
> 
> It's not clear to me if you both agree with this fix. Could you please let
> me know?

Hi Claudiu

I think this is a valid workaround for the broken hardware.

Reviewed-by: Andrew Lunn <andrew@...n.ch>

There might be further discussion about if suspend and resume are
being done at the correct time, but i think that is orthogonal.

    Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ