netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Francesco Dolcini <francesco@dolcini.it>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Francesco Dolcini <francesco@dolcini.it>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	linux-renesas-soc@vger.kernel.org, netdev@vger.kernel.org,
	Francesco Dolcini <francesco.dolcini@toradex.com>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] net: phy: micrel: reset KSZ9x31 when resuming
Date: Tue, 6 Feb 2024 20:09:31 +0100	[thread overview]
Message-ID: <ZcKD69vLxYkbvAL-@gaggiata.pivistrello.it> (raw)
In-Reply-To: <dbae1fca-9313-40e3-9b5c-0de1a8e177df@lunn.ch>

On Tue, Feb 06, 2024 at 06:57:37PM +0100, Andrew Lunn wrote:
> On Tue, Feb 06, 2024 at 06:26:45PM +0100, Francesco Dolcini wrote:
> > On Wed, Jan 17, 2024 at 02:33:53PM +0100, Wolfram Sang wrote:
> > > Makes sense? Tests work fine here, at least.
> > 
> > What I do not know, is what happen to any configuration that was done to
> > the phy before.
> 
> I'm assuming here WoL was not enabled, so the PHY did actually
> suspend.
> 
> mdio_bus_phy_suspend() calls phy_stop_machine() which will set the
> state of the PHY to UP.
> 
> During resume mdio_bus_phy_resume() calls phy_init_hw(). That should
> do a soft reset, call the config_init() callback, and configure
> interrupts. After that phy_resume() is called and then
> phy_state_machine(). Do to setting the state to UP, the state machine
> will kick off auto-negotiation, which will cause any auto-neg
> parameters to be written to the PHY.
> 
> > What if you have disabled gigabit ethernet from auto negotiation before
> > suspend, it will be enabled again after the phy get out of reset.
> 
> If you have set in fixed mode, the wrongly named phy_config_aneg()
> will set the fixed modes, same as it would set the auto-neg modes. So
> they should be preserved over suspend/resume.

Thanks for the detailed explanation Andrew.

What if the configuration was done using ethtool?

Francesco

  reply	other threads:[~2024-02-06 19:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-09 20:52 [RFC PATCH] net: phy: micrel: reset KSZ9x31 when resuming Wolfram Sang
2024-01-09 21:04 ` Andrew Lunn
2024-01-17 13:59   ` Wolfram Sang
2024-01-09 23:28 ` Francesco Dolcini
2024-01-17 13:33   ` Wolfram Sang
2024-02-06 17:26     ` Francesco Dolcini
2024-02-06 17:57       ` Andrew Lunn
2024-02-06 19:09         ` Francesco Dolcini [this message]
2024-02-06 19:19           ` Andrew Lunn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZcKD69vLxYkbvAL-@gaggiata.pivistrello.it \
    --to=francesco@dolcini.it \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=francesco.dolcini@toradex.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=wsa+renesas@sang-engineering.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).