net: phylink: add phylink_set_mac_pm() helper
Subsystems (7)
v6 cover net: phylink: add phylink_set_mac_pm() helper
Per Russell's suggestion, the implementation is changed from the helper function to add an extra property in phylink_config structure because this change can easily cover SFP usecase too.
Changes in v6:
- update the fix tag hash and format
Changes in v5:
- Add fix tag in the commit message
Changes in v4:
- Clean up the codes in phylink.c
- Continue the version number
Shenwei Wang (2):
net: phylink: add mac_managed_pm in phylink_config structure
net: stmmac: Enable mac_managed_pm phylink config
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 1 + drivers/net/phy/phylink.c | 3 +++ include/linux/phylink.h | 2 ++ 3 files changed, 6 insertions(+)
--
2.34.1
PATCH v6 1/2 net: phylink: add mac_managed_pm in phylink_config structure
The recent commit
'commit 744d23c71af3 ("net: phy: Warn about incorrect mdio_bus_phy_resume() state")'
requires the MAC driver explicitly tell the phy driver who is managing the PM, otherwise you will see warning during resume stage.
Add a boolean property in the phylink_config structure so that the MAC driver can use it to tell the PHY driver if it wants to manage the PM.
--- drivers/net/phy/phylink.c | 3 +++ include/linux/phylink.h | 2 ++ 2 files changed, 5 insertions(+)
drivers/net/phy/phylink.c +3 -0
@@ -1661,6 +1661,9 @@ static int phylink_bringup_phy(struct phylink *pl, struct phy_device *phy,if (phy_interrupt_is_valid (phy))phy_request_interrupt (phy); +if (pl->config->mac_managed_pm) + phy->mac_managed_pm = true; +return 0 ; }
include/linux/phylink.h +2 -0
@@ -122,6 +122,7 @@ enum phylink_op_type {* (See commit 7cceb599d15d ("net: phylink: avoid mac_config calls") * @poll_fixed_state: if true, starts link_poll, * if MAC link is at %MLO_AN_FIXED mode. +* @mac_managed_pm: if true, indicate the MAC driver is responsible for PHY PM. * @ovr_an_inband: if true, override PCS to MLO_AN_INBAND * @get_fixed_state: callback to execute to determine the fixed link state, * if MAC link is at %MLO_AN_FIXED mode.
@@ -134,6 +135,7 @@ struct phylink_config {enum phylink_op_type type;bool legacy_pre_march2020;bool poll_fixed_state; +bool mac_managed_pm;bool ovr_an_inband;void (*get_fixed_state)(struct phylink_config *config,struct phylink_link_state *state);
Signature · 1 line
2.34.1
PATCH v6 2/2 net: stmmac: Enable mac_managed_pm phylink config
In reply to Shenwei WangEnable the mac_managed_pm configuration in the phylink_config structure to avoid the kernel warning during system resume.
--- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +1 -0
@@ -1214,6 +1214,7 @@ static int stmmac_phy_setup(struct stmmac_priv *priv)if (priv->plat->tx_queues_to_use >1 ) priv->phylink_config.mac_capabilities &= ~(MAC_10HD |MAC_100HD |MAC_1000HD ); + priv->phylink_config.mac_managed_pm = true; phylink =phylink_create (&priv->phylink_config, fwnode, mode, &stmmac_phylink_mac_ops);
Signature · 1 line
2.34.1
This series was applied to netdev/net.git (master) by David S. Miller <[email protected]>:
Hello:
This series was applied to netdev/net.git (master) by David S. Miller <[email protected]>:
Quoted 8 lines · On Fri, 14 Oct 2022 09:47:27 -0500 you wrote:
Per Russell's suggestion, the implementation is changed from the helper function to add an extra property in
phylink_configstructure because this change can easily cover SFP usecase too.Changes in v6:
- update the fix tag hash and format[...]
Here is the summary with links:
- [NET,v6,1/2] net: phylink: add mac_managed_pm in phylink_config structure
https://git.kernel.org/netdev/net/c/96de900ae78e - [NET,v6,2/2] net: stmmac: Enable mac_managed_pm phylink config https://git.kernel.org/netdev/net/c/f151c147b3af
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html