From: Piotr Raczynski <piotr.raczynski@intel.com>
To: Clark Wang <xiaoning.wang@nxp.com>
Cc: <linux@armlinux.org.uk>, <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 2/2] net: stmmac: resume phy separately before calling stmmac_hw_setup()
Date: Thu, 22 Dec 2022 21:04:11 +0100 [thread overview]
Message-ID: <Y6S4O2tgf6ntc/vG@nimitz> (raw)
In-Reply-To: <20221221080144.2549125-3-xiaoning.wang@nxp.com>
On Wed, Dec 21, 2022 at 04:01:44PM +0800, Clark Wang wrote:
> On some platforms, mac cannot work after resumed from the suspend with WoL
> enabled.
>
> We found the stmmac_hw_setup() when system resumes will called after the
> stmmac_mac_link_up(). So the correct values set in stmmac_mac_link_up()
> are overwritten by stmmac_core_init() in phylink_resume().
>
> So call the new added function in phylink to resume phy fristly.
first.
> Then can call the stmmac_hw_setup() before calling phy_resume().
It'd be nice to add Fixes tag with appropriate commit id.
Other than that looks fine.
Reviewed-by: Piotr Raczynski <piotr.raczynski@intel.com>
>
> Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
> ---
> .../net/ethernet/stmicro/stmmac/stmmac_main.c | 16 +++++++---------
> 1 file changed, 7 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index c6951c976f5d..d0bdc9b6dbe8 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -7532,16 +7532,9 @@ int stmmac_resume(struct device *dev)
> }
>
> rtnl_lock();
> - if (device_may_wakeup(priv->device) && priv->plat->pmt) {
> - phylink_resume(priv->phylink);
> - } else {
> - phylink_resume(priv->phylink);
> - if (device_may_wakeup(priv->device))
> - phylink_speed_up(priv->phylink);
> - }
> - rtnl_unlock();
>
> - rtnl_lock();
> + phylink_phy_resume(priv->phylink);
> +
> mutex_lock(&priv->lock);
>
> stmmac_reset_queues_param(priv);
> @@ -7559,6 +7552,11 @@ int stmmac_resume(struct device *dev)
> stmmac_enable_all_dma_irq(priv);
>
> mutex_unlock(&priv->lock);
> +
> + phylink_resume(priv->phylink);
> + if (device_may_wakeup(priv->device) && !priv->plat->pmt)
> + phylink_speed_up(priv->phylink);
> +
> rtnl_unlock();
>
> netif_device_attach(ndev);
> --
> 2.34.1
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
WARNING: multiple messages have this Message-ID (diff)
From: Piotr Raczynski <piotr.raczynski@intel.com>
To: Clark Wang <xiaoning.wang@nxp.com>
Cc: <linux@armlinux.org.uk>, <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 2/2] net: stmmac: resume phy separately before calling stmmac_hw_setup()
Date: Thu, 22 Dec 2022 21:04:11 +0100 [thread overview]
Message-ID: <Y6S4O2tgf6ntc/vG@nimitz> (raw)
In-Reply-To: <20221221080144.2549125-3-xiaoning.wang@nxp.com>
On Wed, Dec 21, 2022 at 04:01:44PM +0800, Clark Wang wrote:
> On some platforms, mac cannot work after resumed from the suspend with WoL
> enabled.
>
> We found the stmmac_hw_setup() when system resumes will called after the
> stmmac_mac_link_up(). So the correct values set in stmmac_mac_link_up()
> are overwritten by stmmac_core_init() in phylink_resume().
>
> So call the new added function in phylink to resume phy fristly.
first.
> Then can call the stmmac_hw_setup() before calling phy_resume().
It'd be nice to add Fixes tag with appropriate commit id.
Other than that looks fine.
Reviewed-by: Piotr Raczynski <piotr.raczynski@intel.com>
>
> Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
> ---
> .../net/ethernet/stmicro/stmmac/stmmac_main.c | 16 +++++++---------
> 1 file changed, 7 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index c6951c976f5d..d0bdc9b6dbe8 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -7532,16 +7532,9 @@ int stmmac_resume(struct device *dev)
> }
>
> rtnl_lock();
> - if (device_may_wakeup(priv->device) && priv->plat->pmt) {
> - phylink_resume(priv->phylink);
> - } else {
> - phylink_resume(priv->phylink);
> - if (device_may_wakeup(priv->device))
> - phylink_speed_up(priv->phylink);
> - }
> - rtnl_unlock();
>
> - rtnl_lock();
> + phylink_phy_resume(priv->phylink);
> +
> mutex_lock(&priv->lock);
>
> stmmac_reset_queues_param(priv);
> @@ -7559,6 +7552,11 @@ int stmmac_resume(struct device *dev)
> stmmac_enable_all_dma_irq(priv);
>
> mutex_unlock(&priv->lock);
> +
> + phylink_resume(priv->phylink);
> + if (device_may_wakeup(priv->device) && !priv->plat->pmt)
> + phylink_speed_up(priv->phylink);
> +
> rtnl_unlock();
>
> netif_device_attach(ndev);
> --
> 2.34.1
>
next prev parent reply other threads:[~2022-12-22 20:05 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-21 8:01 [PATCH V2 0/2] fix mac not working after system resumed with WoL enabled Clark Wang
2022-12-21 8:01 ` Clark Wang
2022-12-21 8:01 ` [PATCH 1/2] net: phylink: add a function to resume phy alone to fix resume issue " Clark Wang
2022-12-21 8:01 ` Clark Wang
2022-12-22 20:32 ` Piotr Raczynski
2022-12-22 20:32 ` Piotr Raczynski
2023-01-03 9:46 ` Russell King (Oracle)
2023-01-03 9:46 ` Russell King (Oracle)
2022-12-21 8:01 ` [PATCH 2/2] net: stmmac: resume phy separately before calling stmmac_hw_setup() Clark Wang
2022-12-21 8:01 ` Clark Wang
2022-12-22 20:04 ` Piotr Raczynski [this message]
2022-12-22 20:04 ` Piotr Raczynski
2022-12-22 19:56 ` [PATCH V2 0/2] fix mac not working after system resumed with WoL enabled Piotr Raczynski
2022-12-22 19:56 ` Piotr Raczynski
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=Y6S4O2tgf6ntc/vG@nimitz \
--to=piotr.raczynski@intel.com \
--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=linux@armlinux.org.uk \
--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 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.