@@ -142,6 +142,7 @@ int fbnic_phylink_init(struct net_device *netdev)
MAC_40000FD | MAC_50000FD |
MAC_100000FD;
fbn->phylink_config.default_an_inband = true;
+ fbn->phylink_config.rolling_start = true;
__set_bit(PHY_INTERFACE_MODE_XGMII,
fbn->phylink_config.supported_interfaces);
@@ -52,6 +52,7 @@ struct phylink {
struct phylink_pcs *pcs;
struct device *dev;
unsigned int old_link_state:1;
+ unsigned int rolling_start:1;
unsigned long phylink_disable_state; /* bitmask of disables */
struct phy_device *phydev;
@@ -1666,8 +1667,9 @@ static void phylink_resolve(struct work_struct *w)
if (pl->major_config_failed)
link_state.link = false;
- if (link_state.link != cur_link_state) {
+ if (link_state.link != cur_link_state || pl->rolling_start) {
pl->old_link_state = link_state.link;
+ pl->rolling_start = false;
if (!link_state.link)
phylink_link_down(pl);
else
@@ -2603,10 +2605,12 @@ void phylink_resume(struct phylink *pl)
{
ASSERT_RTNL();
+ pl->rolling_start = pl->config->rolling_start;
+
if (test_bit(PHYLINK_DISABLE_MAC_WOL, &pl->phylink_disable_state)) {
/* Wake-on-Lan enabled, MAC handling */
- if (pl->suspend_link_up) {
+ if (pl->suspend_link_up && !pl->rolling_start) {
/* Call mac_link_down() so we keep the overall state
* balanced. Do this under the state_mutex lock for
* consistency. This will cause a "Link Down" message
@@ -156,6 +156,9 @@ enum phylink_op_type {
* @lpi_capabilities: MAC speeds which can support LPI signalling
* @lpi_timer_default: Default EEE LPI timer setting.
* @eee_enabled_default: If set, EEE will be enabled by phylink at creation time
+ * @rolling_start: If set MAC may start in the "up" state, and if possible we
+ * should avoid bringing it down unecessarily during
+ * phylink_start/resume.
*/
struct phylink_config {
struct device *dev;
@@ -165,6 +168,7 @@ struct phylink_config {
bool mac_requires_rxc;
bool default_an_inband;
bool eee_rx_clk_stop_enable;
+ bool rolling_start;
void (*get_fixed_state)(struct phylink_config *config,
struct phylink_link_state *state);
DECLARE_PHY_INTERFACE_MASK(supported_interfaces);