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, 12 Dec 2022 15:54:08 +0200
From:   Vladimir Oltean <olteanv@...il.com>
To:     Claudiu Beznea <claudiu.beznea@...rochip.com>
Cc:     nicolas.ferre@...rochip.com, davem@...emloft.net,
        edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
        linux@...linux.org.uk, andrew@...n.ch, hkallweit1@...il.com,
        sergiu.moga@...rochip.com, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 1/2] net: phylink: init phydev on phylink_resume()

Hi Claudiu,

On Mon, Dec 12, 2022 at 01:28:44PM +0200, Claudiu Beznea wrote:
> There are scenarios where PHY power is cut off on system suspend.
> There are also MAC drivers which handles themselves the PHY on
> suspend/resume path. For such drivers the
> struct phy_device::mac_managed_phy is set to true and thus the
> mdio_bus_phy_suspend()/mdio_bus_phy_resume() wouldn't do the
> proper PHY suspend/resume. For such scenarios call phy_init_hw()
> from phylink_resume().
> 
> Suggested-by: Russell King (Oracle) <linux@...linux.org.uk>
> Signed-off-by: Claudiu Beznea <claudiu.beznea@...rochip.com>
> ---
> 
> Hi, Russel,
> 
> I let phy_init_hw() to execute for all devices. I can restrict it only
> for PHYs that has struct phy_device::mac_managed_phy = true.
> 
> Please let me know what you think.
> 
> Thank you,
> Claudiu Beznea
> 
> 
>  drivers/net/phy/phylink.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
> index 09cc65c0da93..6003c329638e 100644
> --- a/drivers/net/phy/phylink.c
> +++ b/drivers/net/phy/phylink.c
> @@ -2031,6 +2031,12 @@ void phylink_resume(struct phylink *pl)
>  {
>  	ASSERT_RTNL();
>  
> +	if (pl->phydev) {
> +		int ret = phy_init_hw(pl->phydev);
> +		if (ret)
> +			return;
> +	}
> +

If the config_init() method of the driver does things such as this:

	phydev->mdix_ctrl = ETH_TP_MDI_AUTO;

like for example the marvell10g.c driver, won't a user-configured manual
MDI setting get overwritten after a suspend/resume cycle?

>  	if (test_bit(PHYLINK_DISABLE_MAC_WOL, &pl->phylink_disable_state)) {
>  		/* Wake-on-Lan enabled, MAC handling */
>  
> -- 
> 2.34.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ