All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
To: Joakim Zhang <qiangqing.zhang@nxp.com>
Cc: "peppe.cavallaro@st.com" <peppe.cavallaro@st.com>,
	"alexandre.torgue@st.com" <alexandre.torgue@st.com>,
	"joabreu@synopsys.com" <joabreu@synopsys.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	dl-linux-imx <linux-imx@nxp.com>
Subject: Re: [PATCH RFC] ethernet: stmmac: clean up the code for release/suspend/resume function
Date: Thu, 10 Dec 2020 17:03:19 +0800	[thread overview]
Message-ID: <20201210170319.534c0377@xhacker.debian> (raw)
In-Reply-To: <DB8PR04MB67952071DBA50ECF03BF9B98E6CD0@DB8PR04MB6795.eurprd04.prod.outlook.com>

On Tue, 8 Dec 2020 10:49:03 +0000 Joakim Zhang <qiangqing.zhang@nxp.com> wrote:

> 
> 
> > -----Original Message-----
> > From: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
> > Sent: 2020年12月8日 18:24
> > To: Joakim Zhang <qiangqing.zhang@nxp.com>
> > Cc: peppe.cavallaro@st.com; alexandre.torgue@st.com;
> > joabreu@synopsys.com; davem@davemloft.net; kuba@kernel.org;
> > netdev@vger.kernel.org; dl-linux-imx <linux-imx@nxp.com>
> > Subject: Re: [PATCH RFC] ethernet: stmmac: clean up the code for
> > release/suspend/resume function
> >
> > On Mon,  7 Dec 2020 19:38:49 +0800 Joakim Zhang wrote:
> >
> >  
> > >
> > > commit 1c35cc9cf6a0 ("net: stmmac: remove redundant null check before
> > > clk_disable_unprepare()"), have not clean up check NULL clock parameter  
> > completely, this patch did it.  
> > >
> > > commit e8377e7a29efb ("net: stmmac: only call pmt() during
> > > suspend/resume if HW enables PMT"), after this patch, we use if
> > > (device_may_wakeup(priv->device) && priv->plat->pmt) check MAC wakeup
> > > if (device_may_wakeup(priv->device)) check PHY wakeup Add oneline
> > > comment for readability.
> > >
> > > commit 77b2898394e3b ("net: stmmac: Speed down the PHY if WoL to save
> > > energy"), slow down phy speed when release net device under any condition.
> > >
> > > Slightly adjust the order of the codes so that suspend/resume look
> > > more symmetrical, generally speaking they should appear symmetrically.
> > >
> > > Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
> > > ---
> > >  .../net/ethernet/stmicro/stmmac/stmmac_main.c | 22
> > > +++++++++----------
> > >  1 file changed, 10 insertions(+), 12 deletions(-)
> > >
> > > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> > > b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> > > index c33db79cdd0a..a46e865c4acc 100644
> > > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> > > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> > > @@ -2908,8 +2908,7 @@ static int stmmac_release(struct net_device *dev)
> > >         struct stmmac_priv *priv = netdev_priv(dev);
> > >         u32 chan;
> > >
> > > -       if (device_may_wakeup(priv->device))  
> >
> > This check is to prevent link speed down if the stmmac isn't a wakeup device.  
> 
> When we invoke .ndo_stop, we down the net device. Per my understanding, we can speed down the phy, no matter it is a wakeup device or not.

The problem is if the device can't wake up, then phy link will be turned off
No need to speed down the phy before turning off it.

PS: It seems your email client isn't properly setup..

  reply	other threads:[~2020-12-10  9:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-07 11:38 [PATCH RFC] ethernet: stmmac: clean up the code for release/suspend/resume function Joakim Zhang
2020-12-08 10:24 ` Jisheng Zhang
2020-12-08 10:49   ` Joakim Zhang
2020-12-10  9:03     ` Jisheng Zhang [this message]
2020-12-11 12:18       ` Joakim Zhang

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=20201210170319.534c0377@xhacker.debian \
    --to=jisheng.zhang@synaptics.com \
    --cc=alexandre.torgue@st.com \
    --cc=davem@davemloft.net \
    --cc=joabreu@synopsys.com \
    --cc=kuba@kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=netdev@vger.kernel.org \
    --cc=peppe.cavallaro@st.com \
    --cc=qiangqing.zhang@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.