Skip to content

Commit bf2fa12

Browse files
Russell Kingdavem330
authored andcommitted
net: marvell: mvpp2: fix lack of link interrupts
Sven Auhagen reports that if he changes a SFP+ module for a SFP module on the Macchiatobin Single Shot, the link does not come back up. For Sven, it is as easy as: - Insert a SFP+ module connected, and use ping6 to verify link is up. - Remove SFP+ module - Insert SFP 1000base-X module use ping6 to verify link is up: Link up event did not trigger and the link is down but that doesn't show the problem for me. Locally, this has been reproduced by: - Boot with no modules. - Insert SFP+ module, confirm link is up. - Replace module with 25000base-X module. Confirm link is up. - Set remote end down, link is reported as dropped at both ends. - Set remote end up, link is reported up at remote end, but not local end due to lack of link interrupt. Fix this by setting up both GMAC and XLG interrupts for port 0, but only unmasking the appropriate interrupt according to the current mode set in the mac_config() method. However, only do the mask/unmask dance when we are really changing the link mode to avoid missing any link interrupts. Tested-by: Sven Auhagen <[email protected]> Signed-off-by: Russell King <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 4a4cec7 commit bf2fa12

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,7 +1133,8 @@ static void mvpp22_gop_setup_irq(struct mvpp2_port *port)
11331133
{
11341134
u32 val;
11351135

1136-
if (phy_interface_mode_is_rgmii(port->phy_interface) ||
1136+
if (port->phylink ||
1137+
phy_interface_mode_is_rgmii(port->phy_interface) ||
11371138
phy_interface_mode_is_8023z(port->phy_interface) ||
11381139
port->phy_interface == PHY_INTERFACE_MODE_SGMII) {
11391140
val = readl(port->base + MVPP22_GMAC_INT_MASK);
@@ -4620,6 +4621,7 @@ static void mvpp2_mac_config(struct net_device *dev, unsigned int mode,
46204621
const struct phylink_link_state *state)
46214622
{
46224623
struct mvpp2_port *port = netdev_priv(dev);
4624+
bool change_interface = port->phy_interface != state->interface;
46234625

46244626
/* Check for invalid configuration */
46254627
if (state->interface == PHY_INTERFACE_MODE_10GKR && port->gop_id != 0) {
@@ -4629,14 +4631,16 @@ static void mvpp2_mac_config(struct net_device *dev, unsigned int mode,
46294631

46304632
/* Make sure the port is disabled when reconfiguring the mode */
46314633
mvpp2_port_disable(port);
4634+
if (change_interface) {
4635+
mvpp22_gop_mask_irq(port);
46324636

4633-
if (port->priv->hw_version == MVPP22 &&
4634-
port->phy_interface != state->interface) {
4635-
port->phy_interface = state->interface;
4637+
if (port->priv->hw_version == MVPP22) {
4638+
port->phy_interface = state->interface;
46364639

4637-
/* Reconfigure the serdes lanes */
4638-
phy_power_off(port->comphy);
4639-
mvpp22_mode_reconfigure(port);
4640+
/* Reconfigure the serdes lanes */
4641+
phy_power_off(port->comphy);
4642+
mvpp22_mode_reconfigure(port);
4643+
}
46404644
}
46414645

46424646
/* mac (re)configuration */
@@ -4650,6 +4654,9 @@ static void mvpp2_mac_config(struct net_device *dev, unsigned int mode,
46504654
if (port->priv->hw_version == MVPP21 && port->flags & MVPP2_F_LOOPBACK)
46514655
mvpp2_port_loopback_set(port, state);
46524656

4657+
if (change_interface)
4658+
mvpp22_gop_unmask_irq(port);
4659+
46534660
mvpp2_port_enable(port);
46544661
}
46554662

0 commit comments

Comments
 (0)