Skip to content

Commit a1b6b10

Browse files
committed
Merge branch 'phylink_set_mac_pm'
Shenwei Wang says: ==================== 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 ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents fc8695e + f151c14 commit a1b6b10

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1214,6 +1214,7 @@ static int stmmac_phy_setup(struct stmmac_priv *priv)
12141214
if (priv->plat->tx_queues_to_use > 1)
12151215
priv->phylink_config.mac_capabilities &=
12161216
~(MAC_10HD | MAC_100HD | MAC_1000HD);
1217+
priv->phylink_config.mac_managed_pm = true;
12171218

12181219
phylink = phylink_create(&priv->phylink_config, fwnode,
12191220
mode, &stmmac_phylink_mac_ops);

drivers/net/phy/phylink.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1661,6 +1661,9 @@ static int phylink_bringup_phy(struct phylink *pl, struct phy_device *phy,
16611661
if (phy_interrupt_is_valid(phy))
16621662
phy_request_interrupt(phy);
16631663

1664+
if (pl->config->mac_managed_pm)
1665+
phy->mac_managed_pm = true;
1666+
16641667
return 0;
16651668
}
16661669

include/linux/phylink.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ enum phylink_op_type {
122122
* (See commit 7cceb599d15d ("net: phylink: avoid mac_config calls")
123123
* @poll_fixed_state: if true, starts link_poll,
124124
* if MAC link is at %MLO_AN_FIXED mode.
125+
* @mac_managed_pm: if true, indicate the MAC driver is responsible for PHY PM.
125126
* @ovr_an_inband: if true, override PCS to MLO_AN_INBAND
126127
* @get_fixed_state: callback to execute to determine the fixed link state,
127128
* if MAC link is at %MLO_AN_FIXED mode.
@@ -134,6 +135,7 @@ struct phylink_config {
134135
enum phylink_op_type type;
135136
bool legacy_pre_march2020;
136137
bool poll_fixed_state;
138+
bool mac_managed_pm;
137139
bool ovr_an_inband;
138140
void (*get_fixed_state)(struct phylink_config *config,
139141
struct phylink_link_state *state);

0 commit comments

Comments
 (0)