Skip to content

Commit 25382b9

Browse files
Doug Bergerdavem330
authored andcommitted
net: bcmgenet: reset 40nm EPHY on energy detect
The EPHY integrated into the 40nm Set-Top Box devices can falsely detect energy when connected to a disabled peer interface. When the peer interface is enabled the EPHY will detect and report the link as active, but on occasion may get into a state where it is not able to exchange data with the connected GENET MAC. This issue has not been observed when the link parameters are auto-negotiated; however, it has been observed with a manually configured link. It has been empirically determined that issuing a soft reset to the EPHY when energy is detected prevents it from getting into this bad state. Fixes: 1c1008c ("net: bcmgenet: add main driver file") Signed-off-by: Doug Berger <opendmb@gmail.com> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 1f51548 commit 25382b9

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

drivers/net/ethernet/broadcom/genet/bcmgenet.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2018,6 +2018,8 @@ static void bcmgenet_link_intr_enable(struct bcmgenet_priv *priv)
20182018
*/
20192019
if (priv->internal_phy) {
20202020
int0_enable |= UMAC_IRQ_LINK_EVENT;
2021+
if (GENET_IS_V1(priv) || GENET_IS_V2(priv) || GENET_IS_V3(priv))
2022+
int0_enable |= UMAC_IRQ_PHY_DET_R;
20212023
} else if (priv->ext_phy) {
20222024
int0_enable |= UMAC_IRQ_LINK_EVENT;
20232025
} else if (priv->phy_interface == PHY_INTERFACE_MODE_MOCA) {
@@ -2611,9 +2613,14 @@ static void bcmgenet_irq_task(struct work_struct *work)
26112613
priv->irq0_stat = 0;
26122614
spin_unlock_irq(&priv->lock);
26132615

2616+
if (status & UMAC_IRQ_PHY_DET_R &&
2617+
priv->dev->phydev->autoneg != AUTONEG_ENABLE)
2618+
phy_init_hw(priv->dev->phydev);
2619+
26142620
/* Link UP/DOWN event */
26152621
if (status & UMAC_IRQ_LINK_EVENT)
26162622
phy_mac_interrupt(priv->dev->phydev);
2623+
26172624
}
26182625

26192626
/* bcmgenet_isr1: handle Rx and Tx priority queues */
@@ -2708,7 +2715,7 @@ static irqreturn_t bcmgenet_isr0(int irq, void *dev_id)
27082715
}
27092716

27102717
/* all other interested interrupts handled in bottom half */
2711-
status &= UMAC_IRQ_LINK_EVENT;
2718+
status &= (UMAC_IRQ_LINK_EVENT | UMAC_IRQ_PHY_DET_R);
27122719
if (status) {
27132720
/* Save irq status for bottom-half processing. */
27142721
spin_lock_irqsave(&priv->lock, flags);

0 commit comments

Comments
 (0)