Small improvement for stmmac driver.
Reviewer think patch #1 should go into net-next repo, and add patch #2.
Joakim Zhang (2):
net: stmmac: remove redundant null check for ptp clock
net: stmmac: slightly adjust the order of the codes in stmmac_resume()
.../net/ethernet/stmicro/stmmac/stmmac_main.c | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
--
2.17.1
@@ -5295,6 +5295,12 @@ int stmmac_resume(struct device *dev)/* reset the phy so that it's ready */if(priv->mii)stmmac_mdio_reset(priv->mii);++rtnl_lock();+phylink_start(priv->phylink);+/* We may have called phylink_speed_down before */+phylink_speed_up(priv->phylink);+rtnl_unlock();}if(priv->plat->serdes_powerup){
@@ -5305,14 +5311,6 @@ int stmmac_resume(struct device *dev)returnret;}-if(!device_may_wakeup(priv->device)||!priv->plat->pmt){-rtnl_lock();-phylink_start(priv->phylink);-/* We may have called phylink_speed_down before */-phylink_speed_up(priv->phylink);-rtnl_unlock();-}-rtnl_lock();mutex_lock(&priv->lock);
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com> Date: 2021-02-04 13:21:35
On Thu, Feb 4, 2021 at 5:18 AM Joakim Zhang [off-list ref] wrote:
Slightly adjust the order of the codes in stmmac_resume(), remove the
check "if (!device_may_wakeup(priv->device) || !priv->plat->pmt)".
Signed-off-by: Joakim Zhang <redacted>
This commit message says what the code does, but not why or why it's correct.
-----Original Message-----
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Sent: 2021年2月4日 21:20
To: Joakim Zhang <redacted>
Cc: Giuseppe Cavallaro <redacted>; Alexandre Torgue
[off-list ref]; Jose Abreu [off-list ref]; David
Miller [off-list ref]; Jakub Kicinski [off-list ref]; Network
Development [off-list ref]; Andrew Lunn [off-list ref];
Florian Fainelli [off-list ref]; Willem de Bruijn
[off-list ref]
Subject: Re: [PATCH net-next 2/2] net: stmmac: slightly adjust the order of the
codes in stmmac_resume()
On Thu, Feb 4, 2021 at 5:18 AM Joakim Zhang [off-list ref]
wrote:
quoted
Slightly adjust the order of the codes in stmmac_resume(), remove the
check "if (!device_may_wakeup(priv->device) || !priv->plat->pmt)".
Signed-off-by: Joakim Zhang <redacted>
This commit message says what the code does, but not why or why it's correct.
This just slight changes the code order, there is no function change, I will improve the commit message if needed.
Best Regards,
Joakim Zhang
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com> Date: 2021-02-05 16:02:57
On Thu, Feb 4, 2021 at 8:18 PM Joakim Zhang [off-list ref] wrote:
quoted
-----Original Message-----
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Sent: 2021年2月4日 21:20
To: Joakim Zhang <redacted>
Cc: Giuseppe Cavallaro <redacted>; Alexandre Torgue
[off-list ref]; Jose Abreu [off-list ref]; David
Miller [off-list ref]; Jakub Kicinski [off-list ref]; Network
Development [off-list ref]; Andrew Lunn [off-list ref];
Florian Fainelli [off-list ref]; Willem de Bruijn
[off-list ref]
Subject: Re: [PATCH net-next 2/2] net: stmmac: slightly adjust the order of the
codes in stmmac_resume()
On Thu, Feb 4, 2021 at 5:18 AM Joakim Zhang [off-list ref]
wrote:
quoted
Slightly adjust the order of the codes in stmmac_resume(), remove the
check "if (!device_may_wakeup(priv->device) || !priv->plat->pmt)".
Signed-off-by: Joakim Zhang <redacted>
This commit message says what the code does, but not why or why it's correct.
This just slight changes the code order, there is no function change, I will improve the commit message if needed.
And it is correct to move this phylink initialization before serdes_powerup?
That is not immediately obvious to me. A comment would definitely be
good. More relevant than just stating that the code is moved, which I
see from the patch easily.
@@ -5291,8 +5291,7 @@ int stmmac_resume(struct device *dev)/* enable the clk previously disabled */clk_prepare_enable(priv->plat->stmmac_clk);clk_prepare_enable(priv->plat->pclk);-if(priv->plat->clk_ptp_ref)-clk_prepare_enable(priv->plat->clk_ptp_ref);+clk_prepare_enable(priv->plat->clk_ptp_ref);/* reset the phy so that it's ready */if(priv->mii)stmmac_mdio_reset(priv->mii);