[PATCH net-next 0/2] patch for stmmac driver

STALE2004d

6 messages, 2 authors, 2021-02-05 · open the first message on its own page

[PATCH net-next 0/2] patch for stmmac driver

From: Joakim Zhang <hidden>
Date: 2021-02-04 10:16:23

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

[PATCH net-next 2/2] net: stmmac: slightly adjust the order of the codes in stmmac_resume()

From: Joakim Zhang <hidden>
Date: 2021-02-04 10:16:26

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>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 11e0b30b2e01..94d4f5d294f4 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -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)
 			return ret;
 	}
 
-	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);
 
-- 
2.17.1

Re: [PATCH net-next 2/2] net: stmmac: slightly adjust the order of the codes in stmmac_resume()

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.

RE: [PATCH net-next 2/2] net: stmmac: slightly adjust the order of the codes in stmmac_resume()

From: Joakim Zhang <hidden>
Date: 2021-02-05 01:19:41

-----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

Re: [PATCH net-next 2/2] net: stmmac: slightly adjust the order of the codes in stmmac_resume()

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.

[PATCH net-next 1/2] net: stmmac: remove redundant null check for ptp clock

From: Joakim Zhang <hidden>
Date: 2021-02-04 10:17:26

commit 1c35cc9cf6a0 ("net: stmmac: remove redundant null check before
clk_disable_unprepare()"), have not did NULL clock parameter check completely,
this patch help remove redundant null check for ptp clock.

Fixes: 1c35cc9cf6a0 ("net: stmmac: remove redundant null check before clk_disable_unprepare()")
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Joakim Zhang <redacted>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 26b971cd4da5..11e0b30b2e01 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -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);
-- 
2.17.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help