From: Samuel Holland <samuel@sholland.org> Date: 2021-02-17 04:27:00
These patches clean up some things I noticed while fixing suspend/resume
behavior. The first four are minor code improvements. The last one adds
a shutdown hook to minimize power consumption on boards without a PMIC.
Changes v1 to v2:
- Note the assumption of exclusive reset controller access in patch 3
Samuel Holland (5):
net: stmmac: dwmac-sun8i: Return void from PHY unpower
net: stmmac: dwmac-sun8i: Remove unnecessary PHY power check
net: stmmac: dwmac-sun8i: Use reset_control_reset
net: stmmac: dwmac-sun8i: Minor probe function cleanup
net: stmmac: dwmac-sun8i: Add a shutdown callback
.../net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 33 ++++++++++++-------
1 file changed, 21 insertions(+), 12 deletions(-)
--
2.26.2
From: Samuel Holland <samuel@sholland.org> Date: 2021-02-17 04:22:34
sun8i_dwmac_unpower_internal_phy already checks if the PHY is powered,
so there is no need to do it again here.
Reviewed-by: Chen-Yu Tsai <redacted>
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
From: Samuel Holland <samuel@sholland.org> Date: 2021-02-17 04:23:58
Adjust the spacing and use an explicit "return 0" in the success path
to make the function easier to parse.
Reviewed-by: Chen-Yu Tsai <redacted>
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
@@ -1229,6 +1229,7 @@ static int sun8i_dwmac_probe(struct platform_device *pdev)ndev=dev_get_drvdata(&pdev->dev);priv=netdev_priv(ndev);+/* The mux must be registered after parent MDIO*soafterstmmac_dvr_probe()*/
@@ -1247,7 +1248,8 @@ static int sun8i_dwmac_probe(struct platform_device *pdev)gotodwmac_remove;}-returnret;+return0;+dwmac_mux:reset_control_put(gmac->rst_ephy);clk_put(gmac->ephy_clk);
From: Samuel Holland <samuel@sholland.org> Date: 2021-02-17 04:28:41
Use the appropriate function instead of reimplementing it,
and update the error message to match the code.
Reviewed-by: Chen-Yu Tsai <redacted>
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
@@ -805,12 +805,12 @@ static int sun8i_dwmac_power_internal_phy(struct stmmac_priv *priv)/* Make sure the EPHY is properly reseted, as U-Boot may leave*itatdeassertedstate,andthusitmayfailtoresetEMAC.+*+*ThisassumesthedriverhasexclusiveaccesstotheEPHYreset.*/-reset_control_assert(gmac->rst_ephy);--ret=reset_control_deassert(gmac->rst_ephy);+ret=reset_control_reset(gmac->rst_ephy);if(ret){-dev_err(priv->device,"Cannot deassert internal phy\n");+dev_err(priv->device,"Cannot reset internal PHY\n");clk_disable_unprepare(gmac->ephy_clk);returnret;}
From: Samuel Holland <samuel@sholland.org> Date: 2021-02-17 04:31:18
This is a deinitialization function that always returned zero, and that
return value was always ignored. Have it return void instead.
Reviewed-by: Chen-Yu Tsai <redacted>
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
From: Samuel Holland <samuel@sholland.org> Date: 2021-02-17 04:34:20
The Ethernet MAC and PHY are usually major consumers of power on boards
which may not be able to fully power off (those with no PMIC). Powering
down the MAC and internal PHY saves power while these boards are "off".
Reviewed-by: Chen-Yu Tsai <redacted>
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 10 ++++++++++
1 file changed, 10 insertions(+)
Hello:
This series was applied to netdev/net-next.git (refs/heads/master):
On Tue, 16 Feb 2021 22:20:01 -0600 you wrote:
These patches clean up some things I noticed while fixing suspend/resume
behavior. The first four are minor code improvements. The last one adds
a shutdown hook to minimize power consumption on boards without a PMIC.
Changes v1 to v2:
- Note the assumption of exclusive reset controller access in patch 3
[...]