net: phylink: add phylink_set_mac_pm() helper
Subsystems (7)
v5 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 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 v5 1/2 net: phylink: add mac_managed_pm in phylink_config structure
The recent commit
'commit 47ac7b2f6a1f ("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.
'Fixes: 47ac7b2f6a1f ("net: phy: Warn about incorrect mdio_bus_phy_resume() state")'
--- 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);
--
2.34.1
Re: [PATCH v5 1/2] net: phylink: add mac_managed_pm in phylink_config structure
Quoted 9 lines · Shenwei Wang
The recent commit
'commit
47ac7b2f6a1f("net: phy: Warn about incorrectmdio_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.
Quoted 6 lines
Add a boolean property in the
phylink_configstructure so that the MAC driver can use it to tell the PHY driver if it wants to manage the PM.'Fixes:
47ac7b2f6a1f("net: phy: Warn about incorrectmdio_bus_phy_resume()state")'
This is not the way to provide a Fixse tag, it should simply be:
With that fixed:
as a courtesy, you could CC the author of the patch you are fixing BTW
Signature · 1 line
Florian
RE: [EXT] Re: [PATCH v5 1/2] net: phylink: add mac_managed_pm in phylink_config structure
Quoted 17 lines
-----Original Message-----
From: Florian Fainelli <[email protected]>
Sent: Thursday, October 13, 2022 1:48 PMQuoted 11 lines · Shenwei Wang
The recent commit
'commit
47ac7b2f6a1f("net: phy: Warn about incorrectmdio_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_configstructure so that the MAC driver can use it to tell the PHY driver if it wants to manage the PM.
Quoted 8 lines
Quoted 2 lines
'Fixes:
47ac7b2f6a1f("net: phy: Warn about incorrectmdio_bus_phy_resume()state")'This is not the way to provide a Fixse tag, it should simply be:
Fixes 47ac7b2f6a1f ("net: phy: Warn about incorrect
mdio_bus_phy_resume()state"
That was my original format. But it met the following warning when ran checkpatch.pl script:
./scripts/checkpatch.pl 0001-net-phylink-add-mac_managed_pm-in-phylink_config-str.patch
WARNING: Please use correct Fixes: style 'Fixes: <12 chars of sha1> ("<title line>")' - ie: 'Fixes: e6a39ffcfe22 ("net: stmmac: Enable mac_managed_pm phylink config")' #20:
That's why I changed to the current tag format.
Regards,
Shenwei
Quoted 7 lines
With that fixed:
Acked-by Florian Fainelli <[email protected]>as a courtesy, you could CC the author of the patch you are fixing BTW --
Florian
Jakub Kicinski
maintainerRe: [EXT] Re: [PATCH v5 1/2] net: phylink: add mac_managed_pm in phylink_config structure
Quoted 4 lines · On Thu, 13 Oct 2022 19:28:45 +0000 Shenwei Wang wrote:
Quoted 3 lines
Fixes 47ac7b2f6a1f ("net: phy: Warn about incorrect
mdio_bus_phy_resume()state"
Quoted 8 lines
That was my original format. But it met the following warning when ran checkpatch.pl script:
./scripts/checkpatch.pl0001-net-phylink-add-mac_managed_pm-in-phylink_config-str.patch
WARNING: Please use correct Fixes: style 'Fixes: <12 chars of sha1> ("<title line>")' - ie: 'Fixes:e6a39ffcfe22("net: stmmac: Enablemac_managed_pmphylink config")' #20:Fixes 47ac7b2f6a1f ("net: phy: Warn about incorrectThat's why I changed to the current tag format.
It needs to be all on one line:
But I don't see 47ac7b2f6a1f in my trees, are you sure that's the upstream commit id?
RE: [EXT] Re: [PATCH v5 1/2] net: phylink: add mac_managed_pm in phylink_config structure
RESEND because some recipients' mail address were somehow corrupted.
Quoted 23 lines
-----Original Message-----
From: Jakub Kicinski <[email protected]>
Sent: Thursday, October 13, 2022 6:12 PM
To: Shenwei Wang <[email protected]> On Thu, 13 Oct 2022 19:28:45Quoted 6 lines · +0000 Shenwei Wang wrote:
Quoted 3 lines
Fixes 47ac7b2f6a1f ("net: phy: Warn about incorrect
mdio_bus_phy_resume()state"That was my original format. But it met the following warning when ran
checkpatch.pl script:
Quoted 5 lines
./scripts/checkpatch.pl0001-net-phylink-add-mac_managed_pm-in-phylink_config-str.patch
WARNING: Please use correct Fixes: style 'Fixes: <12 chars of sha1> ("<titleline>")' - ie: 'Fixes:
e6a39ffcfe22("net: stmmac: Enable line>mac_managed_pm
phylink config")'Quoted 3 lines
#20:
Fixes 47ac7b2f6a1f ("net: phy: Warn about incorrect
Quoted 8 lines
Quoted 1 line
That's why I changed to the current tag format.
It needs to be all on one line:
Fixes 47ac7b2f6a1f ("net: phy: Warn about incorrect
mdio_bus_phy_resume()
state")
En, that's the tricky. Seems the rule of size limit is not applied for this use case.
Quoted 2 lines
But I don't see
47ac7b2f6a1fin my trees, are you sure that's the upstream commit id?
Just had a check again, and commit id on the upstream changed to
commit 744d23c71af39c7dc77ac7c3cac87ae86a181a85 upstream
Will post a new patches to fix the tag.
Thanks,
Shenwei
PATCH v5 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.
'Fixes: 47ac7b2f6a1f ("net: phy: Warn about incorrect mdio_bus_phy_resume() state")'
--- 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);
--
2.34.1
Re: [PATCH v5 2/2] net: stmmac: Enable mac_managed_pm phylink config
Quoted 7 lines · Shenwei Wang
Enable the
mac_managed_pmconfiguration in thephylink_configstructure to avoid the kernel warning during system resume.'Fixes:
47ac7b2f6a1f("net: phy: Warn about incorrectmdio_bus_phy_resume()state")'Signed-off-by Shenwei Wang <[email protected]>
Same comment as patch #1, the Fixes tag is improperly formatted and does not require the use of ' before and after.
With that fixed:
Signature · 1 line
Florian
Russell King (Oracle)
maintainerQuoted 3 lines · Shenwei Wang
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.
Which tree are you aiming this for - net-next or net?
You should use [PATCH net ...] or [PATCH net-next ...] to indicate which tree you're aiming these patches for.
Please don't repost due to this unless you want it to go into the net tree, as net-next is currently closed.
Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
Quoted 16 lines
-----Original Message-----
From: Russell King <[email protected]>
Sent: Thursday, October 13, 2022 11:07 AM
To: Shenwei Wang <[email protected]>
Cc: David S. Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Maxime Coquelin <[email protected]>; Andrew Lunn <[email protected]>; Heiner Kallweit <[email protected]>; Giuseppe Cavallaro <[email protected]>; Alexandre Torgue <[email protected]>; Jose Abreu <[email protected]>; [email protected]; [email protected]; linux- [email protected]; [email protected]
Subject: [EXT] Re: [PATCH v5 0/2] net: phylink: addphylink_set_mac_pm()helper
Quoted 9 lines
Caution: EXT Email
Quoted 3 lines · Shenwei Wang
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.Which tree are you aiming this for - net-next or net?
The patch can be applied to both trees. You can select the one which is easy to go ahead.
Thanks,
Shenwei
Quoted 16 lines
You should use [PATCH net ...] or [PATCH net-next ...] to indicate which tree you're aiming these patches for.
Please don't repost due to this unless you want it to go into the net tree, as net- next is currently closed.
--
RMK's Patch system:
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.ar
mlinux.org.uk%2Fdeveloper%2Fpatches%2F&data=05%7C01%7Cshenwei. wang%40nxp.com%7C9eb73c5218ab4ca2e25908daad350702%7C686ea1d3bc2 b4c6fa92cd99c5c301635%7C0%7C0%7C638012740506537030%7CUnknown%7 CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJ XVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=ZUtXNJ8wXqhi9Tvcg51uJJvcS 9CbJt6yxF3zjuoEfuQ%3D&reserved=0
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
Russell King (Oracle)
maintainerQuoted 4 lines · Shenwei Wang
Quoted 4 lines
-----Original Message-----
From: Russell King <[email protected]>
Sent: Thursday, October 13, 2022 11:07 AM
On Thu, Oct 13, 2022 at 08:39:02AM -0500, Shenwei Wang wrote:
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
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.Which tree are you aiming this for - net-next or net?
The patch can be applied to both trees. You can select the one which is easy to go ahead.
That may be the case at the moment, because the net-next tree has been merged into mainline and the net tree recently updated to mainline, but that is not always the case.
The purpose of the tag in the subject line is to tell the various maintainers on the netdev mailing list what _your_ expectation is for the patch and where _you_ intend it to be applied.
Thanks.
Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!