Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3300130ybb; Tue, 31 Mar 2020 02:24:43 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvB/PL+Mgz4gs/r36LVyKF9YOc/a2OaDTLR54ltab4KDhh4MS5bJ3tRE1O0+pFOf7L7VXiX X-Received: by 2002:aca:ddc5:: with SMTP id u188mr1355681oig.8.1585646683497; Tue, 31 Mar 2020 02:24:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585646683; cv=none; d=google.com; s=arc-20160816; b=QBIJjn2BZQA735YlP4wH6O9E83VIMBDkIu1Ia9WLOT5eaBGTVZWO3H9a/xt2vMUKqo mAK16k0BOAHPbmUqJXonfa8EPTezXKUZ7bydFMOcrnxSjlCGPAKds0aNfpoVf6+EmRvt mPqoSM+NJfmzJqq0Wgm7syhLK1dKy/szNhHFPBlLAIdRMmUuTFmsZB28yhxBDinKU4aY QJSIqyJqZVrvzBxhmz/SHd0fGSNbSagX3zW6INmd1fiKd0/IMJDdW0sa6J0XDoPxC8ZM TM+mE32yrjRmdh76hfqDE3euWR2p6MxFhq5Y9+ynRN/ErjqENLWrEZRByOTgJaW++Bvp uIcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=K3CusSAOuUXPaRFQQ+F2AJmMJmmK+/IHphDHk4+dybA=; b=UoyIqK/0qV5Jwo7/N+KZoeqxYP1imia+/mzZj/JkKPO6dmn/2ms7NnrE5+uK3NI/nU lvwAvwxHcbLb1Cx8cTyGZedBcwRU2TumEzbX7ckfBw9wysKXfdNOVx/ZkSkufkr7z3zm ertX/U/hMCXKfHecjeL0IdNjW4SZv75cLH1lH754UQ6aXDh3/YEBb04Mg2HlEd+duJx3 ypxHSIhfpsp7VR0dfiRFO2LlBucG3S2bBLZmBaEj9wt+LhfKNkh9+iF2Bpxz3I5uhwUJ lj3LOEjacOm9P2O4sAanPXh9du69Ae/szeI9ilVVhAS7odfxW2splhhEVFaaVMaEnhE3 jFbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="tPn/xYn3"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f21si7671850otf.31.2020.03.31.02.24.30; Tue, 31 Mar 2020 02:24:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="tPn/xYn3"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730656AbgCaJCH (ORCPT + 99 others); Tue, 31 Mar 2020 05:02:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:41516 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730409AbgCaJCF (ORCPT ); Tue, 31 Mar 2020 05:02:05 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 945E120848; Tue, 31 Mar 2020 09:02:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585645325; bh=KDJYuc/fHq09pIXnc7q8gMDtImtWCkQEsuOHDBfYu1w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tPn/xYn3p5+qf2cwYAc1/BwFT0dpADt84pDjGO5D9au4yadlTxnu+wBwnSPG6BazO 9eXDpfm6yW/RWI4VfksUiT9oHqaEjh0wBxzQGz9yb+bNDENj+3ryfhU5ZE52rM11ne 8Y1wpt/jl0YDfm7+j7lM7uMvJLblv6UrbLkyGWBE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andrew Smith , =?UTF-8?q?Ren=C3=A9=20van=20Dorst?= , Vivien Didelot , Florian Fainelli , "David S. Miller" Subject: [PATCH 5.5 019/170] net: dsa: mt7530: Change the LINK bit to reflect the link status Date: Tue, 31 Mar 2020 10:57:13 +0200 Message-Id: <20200331085426.104742373@linuxfoundation.org> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200331085423.990189598@linuxfoundation.org> References: <20200331085423.990189598@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Ren? van Dorst" [ Upstream commit 22259471b51925353bd7b16f864c79fdd76e425e ] 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: b8f126a8d543 ("net-next: dsa: add dsa support for Mediatek MT7530 switch") Reported-by: Andrew Smith Signed-off-by: René van Dorst Reviewed-by: Vivien Didelot Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/dsa/mt7530.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c @@ -566,7 +566,7 @@ mt7530_mib_reset(struct dsa_switch *ds) static void mt7530_port_set_status(struct mt7530_priv *priv, int port, int enable) { - u32 mask = PMCR_TX_EN | PMCR_RX_EN; + u32 mask = PMCR_TX_EN | PMCR_RX_EN | PMCR_FORCE_LNK; if (enable) mt7530_set(priv, MT7530_PMCR_P(port), mask); @@ -1443,7 +1443,7 @@ static void mt7530_phylink_mac_config(st mcr_new &= ~(PMCR_FORCE_SPEED_1000 | PMCR_FORCE_SPEED_100 | PMCR_FORCE_FDX | PMCR_TX_FC_EN | PMCR_RX_FC_EN); mcr_new |= PMCR_IFG_XMIT(1) | PMCR_MAC_MODE | PMCR_BACKOFF_EN | - PMCR_BACKPR_EN | PMCR_FORCE_MODE | PMCR_FORCE_LNK; + PMCR_BACKPR_EN | PMCR_FORCE_MODE; /* Are we connected to external phy */ if (port == 5 && dsa_is_user_port(ds, 5))