From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Clark Wang <xiaoning.wang@nxp.com>
Cc: "peppe.cavallaro@st.com" <peppe.cavallaro@st.com>,
"alexandre.torgue@foss.st.com" <alexandre.torgue@foss.st.com>,
"joabreu@synopsys.com" <joabreu@synopsys.com>,
"davem@davemloft.net" <davem@davemloft.net>,
"edumazet@google.com" <edumazet@google.com>,
"kuba@kernel.org" <kuba@kernel.org>,
"pabeni@redhat.com" <pabeni@redhat.com>,
"mcoquelin.stm32@gmail.com" <mcoquelin.stm32@gmail.com>,
"andrew@lunn.ch" <andrew@lunn.ch>,
"hkallweit1@gmail.com" <hkallweit1@gmail.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-stm32@st-md-mailman.stormreply.com"
<linux-stm32@st-md-mailman.stormreply.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] net: phylink: add sync flag mac_ready to fix resume issue with WoL enabled
Date: Wed, 30 Nov 2022 11:50:50 +0000 [thread overview]
Message-ID: <Y4dDmvOQwuIYxgro@shell.armlinux.org.uk> (raw)
In-Reply-To: <HE1PR0402MB2939242DB6E909B4A62109E5F3159@HE1PR0402MB2939.eurprd04.prod.outlook.com>
On Wed, Nov 30, 2022 at 11:32:09AM +0000, Clark Wang wrote:
> Hi Russell,
>
> > -----Original Message-----
> > From: Russell King <linux@armlinux.org.uk>
> > Sent: 2022年11月30日 19:24
> > To: Clark Wang <xiaoning.wang@nxp.com>
> > Cc: peppe.cavallaro@st.com; alexandre.torgue@foss.st.com;
> > joabreu@synopsys.com; davem@davemloft.net; edumazet@google.com;
> > kuba@kernel.org; pabeni@redhat.com; mcoquelin.stm32@gmail.com;
> > andrew@lunn.ch; hkallweit1@gmail.com; netdev@vger.kernel.org;
> > linux-stm32@st-md-mailman.stormreply.com;
> > linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org
> > Subject: Re: [PATCH 1/2] net: phylink: add sync flag mac_ready to fix resume
> > issue with WoL enabled
> >
> > On Wed, Nov 30, 2022 at 07:11:47PM +0800, Clark Wang wrote:
> > > Issue we met:
> > > On some platforms, mac cannot work after resumed from the suspend with
> > > WoL enabled.
> > >
> > > The cause of the issue:
> > > 1. phylink_resolve() is in a workqueue which will not be executed immediately.
> > > This is the call sequence:
> > > phylink_resolve()->phylink_link_up()->pl->mac_ops->mac_link_up()
> > > For stmmac driver, mac_link_up() will set the correct speed/duplex...
> > > values which are from link_state.
> > > 2. In stmmac_resume(), it will call stmmac_hw_setup() after called the
> > > phylink_resume(). stmmac_core_init() is called in function
> > > stmmac_hw_setup(),
> >
> > ... and that is where the problem is. Don't call phylink_resume() before your
> > hardware is ready to see a link-up event.
>
> Thank you very much for your reply!
>
> You are right.
>
> However, stmmac requires RXC to have a clock input when performing a reset(in stmmac_hw_setup()). On our board, RXC is provided by the phy.
>
> In WoL mode, this is not a problem, because the phy will not be down when suspend. RXC will keep output. But in normal suspend(without WoL), the phy will be down, which does not guarantee the output of the RXC of the phy. Therefore, the previous code will call phylink_resume() before stmmac_hw_setup().
I think we need phylink_phy_resume() which stmmac can use to resume the
PHY without resuming phylink, assuming that will output the RXC. Which
PHY driver(s) are used with stmmac?
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
next prev parent reply other threads:[~2022-11-30 11:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-30 11:11 [PATCH 0/2] fix mac not working after system resumed with WoL enabled Clark Wang
2022-11-30 11:11 ` [PATCH 1/2] net: phylink: add sync flag mac_ready to fix resume issue " Clark Wang
2022-11-30 11:23 ` Russell King (Oracle)
2022-11-30 11:32 ` Clark Wang
2022-11-30 11:50 ` Russell King (Oracle) [this message]
2022-11-30 12:00 ` Clark Wang
2022-11-30 11:32 ` Russell King (Oracle)
2022-11-30 11:38 ` Clark Wang
2022-11-30 11:40 ` Clark Wang
2022-11-30 11:11 ` [PATCH 2/2] net: stmmac: synchronize status with phylink via flag during suspend/resume Clark Wang
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=Y4dDmvOQwuIYxgro@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=alexandre.torgue@foss.st.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=joabreu@synopsys.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=peppe.cavallaro@st.com \
--cc=xiaoning.wang@nxp.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).