summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/ethernet/marvell/mvpp2x/mv_pp2x_main.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/drivers/net/ethernet/marvell/mvpp2x/mv_pp2x_main.c b/drivers/net/ethernet/marvell/mvpp2x/mv_pp2x_main.c
index 8c3154ac9436..79c2102a06d2 100644
--- a/drivers/net/ethernet/marvell/mvpp2x/mv_pp2x_main.c
+++ b/drivers/net/ethernet/marvell/mvpp2x/mv_pp2x_main.c
@@ -1993,8 +1993,11 @@ static void mv_pp22_mac_link_down(struct phylink_config *config,
port->mac_data.eee_active = false;
if (port->mac_data.phy_mode == PHY_INTERFACE_MODE_RGMII ||
port->mac_data.phy_mode == PHY_INTERFACE_MODE_SGMII ||
- port->mac_data.phy_mode == PHY_INTERFACE_MODE_QSGMII)
+ port->mac_data.phy_mode == PHY_INTERFACE_MODE_QSGMII) {
+ if (!phylink_autoneg_inband(mode))
+ mvgmac_force_link_down(&port->gmac);
mvgmac_set_eee(&port->gmac, false);
+ }
port->mac_data.link = 0;
mv_pp2x_ingress_disable(port);
@@ -2011,14 +2014,20 @@ static void mv_pp22_mac_link_up(struct phylink_config *config,
struct net_device *dev = to_net_dev(config->dev);
struct mv_pp2x_port *port = netdev_priv(dev);
- if ((port->mac_data.phy_mode == PHY_INTERFACE_MODE_RGMII ||
- port->mac_data.phy_mode == PHY_INTERFACE_MODE_SGMII ||
- port->mac_data.phy_mode == PHY_INTERFACE_MODE_QSGMII) &&
- phy && port->mac_data.eee_enabled) {
- port->mac_data.eee_active = phy_init_eee(phy, 0) >= 0;
- mvgmac_set_lpi_ts(&port->gmac, port->mac_data.tx_lpi_timer);
- mvgmac_set_eee(&port->gmac, port->mac_data.eee_active &&
- port->mac_data.tx_lpi_enabled);
+ if (port->mac_data.phy_mode == PHY_INTERFACE_MODE_RGMII ||
+ port->mac_data.phy_mode == PHY_INTERFACE_MODE_SGMII ||
+ port->mac_data.phy_mode == PHY_INTERFACE_MODE_QSGMII) {
+ if (phy && port->mac_data.eee_enabled) {
+ port->mac_data.eee_active = phy_init_eee(phy, 0) >= 0;
+ mvgmac_set_lpi_ts(&port->gmac, port->mac_data.tx_lpi_timer);
+ mvgmac_set_eee(&port->gmac, port->mac_data.eee_active &&
+ port->mac_data.tx_lpi_enabled);
+ }
+ if (!phylink_autoneg_inband(mode))
+ mvgmac_force_link_up(&port->gmac, speed, duplex,
+ tx_pause, rx_pause);
+ else
+ mvgmac_set_flow(&port->gmac, tx_pause, rx_pause);
}
port->mac_data.link = 1;