[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <DM6PR11MB330673F1441CFE89A8092D66B9B0A@DM6PR11MB3306.namprd11.prod.outlook.com>
Date: Thu, 16 Nov 2023 07:39:10 +0000
From: "Gan, Yi Fang" <yi.fang.gan@...el.com>
To: Paolo Abeni <pabeni@...hat.com>,
"Russell King (Oracle)" <linux@...linux.org.uk>
CC: Alexandre Torgue <alexandre.torgue@...s.st.com>,
Jose Abreu <joabreu@...opsys.com>,
"David S . Miller" <davem@...emloft.net>,
"Eric Dumazet" <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
"Maxime Coquelin" <mcoquelin.stm32@...il.com>,
Joakim Zhang <qiangqing.zhang@....com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-stm32@...md-mailman.stormreply.com"
<linux-stm32@...md-mailman.stormreply.com>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"Looi, Hong Aun" <hong.aun.looi@...el.com>,
"Voon, Weifeng" <weifeng.voon@...el.com>,
"Song, Yoong Siang" <yoong.siang.song@...el.com>
Subject: RE: [PATCH net 1/1] net: stmmac: fix MAC and phylink mismatch issue
after resume with STMMAC_FLAG_USE_PHY_WOL enabled
Hi Paolo and Russell King,
After study the information provided, it seems better to find another way to
resolve the issue. Appreciate for the details given. Will try to figure out another
solution.
Best Regards,
Gan Yi Fang
> -----Original Message-----
> From: Paolo Abeni <pabeni@...hat.com>
> Sent: Thursday, November 9, 2023 8:14 PM
> To: Russell King (Oracle) <linux@...linux.org.uk>; Gan, Yi Fang
> <yi.fang.gan@...el.com>
> Cc: Alexandre Torgue <alexandre.torgue@...s.st.com>; Jose Abreu
> <joabreu@...opsys.com>; David S . Miller <davem@...emloft.net>; Eric
> Dumazet <edumazet@...gle.com>; Jakub Kicinski <kuba@...nel.org>;
> Maxime Coquelin <mcoquelin.stm32@...il.com>; Joakim Zhang
> <qiangqing.zhang@....com>; netdev@...r.kernel.org; linux-stm32@...md-
> mailman.stormreply.com; linux-arm-kernel@...ts.infradead.org; linux-
> kernel@...r.kernel.org; Looi, Hong Aun <hong.aun.looi@...el.com>; Voon,
> Weifeng <weifeng.voon@...el.com>; Song, Yoong Siang
> <yoong.siang.song@...el.com>
> Subject: Re: [PATCH net 1/1] net: stmmac: fix MAC and phylink mismatch issue
> after resume with STMMAC_FLAG_USE_PHY_WOL enabled
>
> On Thu, 2023-11-09 at 09:15 +0000, Russell King (Oracle) wrote:
> > On Thu, Nov 09, 2023 at 01:00:27PM +0800, Gan Yi Fang wrote:
> > > From: "Gan, Yi Fang" <yi.fang.gan@...el.com>
> > >
> > > The issue happened when flag STMMAC_FLAG_USE_PHY_WOL is enabled.
> > > It can be reproduced with steps below:
> > > 1. Advertise only one speed on the host 2. Enable the WoL on the
> > > host 3. Suspend the host 4. Wake up the host
> > >
> > > When the WoL is disabled, both the PHY and MAC will suspend and wake
> > > up with everything configured well. When WoL is enabled, the PHY
> > > needs to be stay awake to receive the signal from remote client but
> > > MAC will enter suspend mode.
> > >
> > > When the MAC resumes from suspend, phylink_resume() will call
> > > phylink_start() to start the phylink instance which will trigger the
> > > phylink machine to invoke the mac_link_up callback function. The
> > > stmmac_mac_link_up() will configure the MAC_CTRL_REG based on the
> > > current link state. Then the stmmac_hw_setup() will be called to configure
> the MAC.
> > >
> > > This sequence might cause mismatch of the link state between MAC and
> > > phylink. This patch moves the phylink_resume() after
> > > stmamc_hw_setup() to ensure the MAC is initialized before phylink is being
> configured.
> >
> > Isn't this going to cause problems?
> >
> > stmamc_hw_setup() calls stmmac_init_dma_engine(), which then calls
> > stmmac_reset() - and stmmac_reset() can fail if the PHY clock isn't
> > running, which is why phylink_resume() gets called before this.
>
> @Gan Yi Fang: at very least we need a solid explanation in the commit message
> why this change don't cause the above problems.
>
> Thanks,
>
> Paolo
>
Powered by blists - more mailing lists