Skip to content

Commit 0ec037c

Browse files
vDorstgregkh
authored andcommitted
net: dsa: mt7530: Change the LINK bit to reflect the link status
[ Upstream commit 2225947 ] Andrew reported: After a number of network port link up/down changes, sometimes the switch port gets stuck in a state where it thinks it is still transmitting packets but the cpu port is not actually transmitting anymore. In this state you will see a message on the console "mtk_soc_eth 1e100000.ethernet eth0: transmit timed out" and the Tx counter in ifconfig will be incrementing on virtual port, but not incrementing on cpu port. The issue is that MAC TX/RX status has no impact on the link status or queue manager of the switch. So the queue manager just queues up packets of a disabled port and sends out pause frames when the queue is full. Change the LINK bit to reflect the link status. Fixes: b8f126a ("net-next: dsa: add dsa support for Mediatek MT7530 switch") Reported-by: Andrew Smith <andrew.smith@digi.com> Signed-off-by: René van Dorst <opensource@vdorst.com> Reviewed-by: Vivien Didelot <vivien.didelot@gmail.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 60e9750 commit 0ec037c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎drivers/net/dsa/mt7530.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ mt7530_mib_reset(struct dsa_switch *ds)
566566
static void
567567
mt7530_port_set_status(struct mt7530_priv *priv, int port, int enable)
568568
{
569-
u32 mask = PMCR_TX_EN | PMCR_RX_EN;
569+
u32 mask = PMCR_TX_EN | PMCR_RX_EN | PMCR_FORCE_LNK;
570570

571571
if (enable)
572572
mt7530_set(priv, MT7530_PMCR_P(port), mask);
@@ -1439,7 +1439,7 @@ static void mt7530_phylink_mac_config(struct dsa_switch *ds, int port,
14391439
mcr_new &= ~(PMCR_FORCE_SPEED_1000 | PMCR_FORCE_SPEED_100 |
14401440
PMCR_FORCE_FDX | PMCR_TX_FC_EN | PMCR_RX_FC_EN);
14411441
mcr_new |= PMCR_IFG_XMIT(1) | PMCR_MAC_MODE | PMCR_BACKOFF_EN |
1442-
PMCR_BACKPR_EN | PMCR_FORCE_MODE | PMCR_FORCE_LNK;
1442+
PMCR_BACKPR_EN | PMCR_FORCE_MODE;
14431443

14441444
/* Are we connected to external phy */
14451445
if (port == 5 && dsa_is_user_port(ds, 5))

0 commit comments

Comments
 (0)