Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3936275pxj; Mon, 21 Jun 2021 09:44:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwn6gWHMF/C42yCo6qyRf3KZ/W32oYOyQ3yxP2oIMMX8SFLzTgwQ/iW6MuU1fTKyF+dDMfe X-Received: by 2002:a17:906:bcf4:: with SMTP id op20mr5171447ejb.327.1624293851294; Mon, 21 Jun 2021 09:44:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624293851; cv=none; d=google.com; s=arc-20160816; b=AFP7WCgbXFUSMsb1Q1rt71hngArMpsRiTYlBMP3xEQmScQPHTZzUjCuTS1UUUmTPO/ CyLi3z67sWwNulilMZeKBJN1Ob6BVjPbQc59NcjgXEQQzGVJOYrSVERGIQOCCOdeahH4 NSVWKcrASxGbikS1ZX4q4eaEsXxKC/94OejvTHTcIvNy8HPD1Q3V5CT4Fp/tfqO+Wmb+ urqGYPARsIDQ35ywn5YUebUed8979yJJjbVyUX4IVIXFdClzl5QVe8X0v1JT2jphIMoV hfM/X5zHxHiaLY+RcUiyGN0+hOnAW3EChgWEX2Pb2Kzms424KrglQAV4kOKmeQWq552Q L6XQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=O4TK8ZjdSfM9+u4XezUksFgH80kRsgwApr/NQBbHqjI=; b=brQRIT1WzqzfUTTj9Siy3NemT93uLc4ChGwL0As/UJuD7eoTHk89NsgcKBMu6v3nBM D7hWyfumKhfXwrcUFBEq+BXSHUOQYb0chyMJj+joPZM4G+zwei5GHa31rfxKbpSOuwzB ZODT5NZWyhWYsVIPY6pCM5oG+TqGMqdGekuqotw9szYq9/g23pIhhFTCuBnguHk1/5qg Pcwylr/IIfHY1H+Hokb7M45oOt1snLvu1sFtCbVuFuHbdDiHiRfw3oWNjaue06mLqXzV HXx0ezg4hjdQ1XYkQV4KiFIMWPVTgufQPvAoIPEn77dHuSABC19FrWOkxo2VNIl/uQy+ KJKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SGPT3Ud3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i14si12435189eje.489.2021.06.21.09.43.47; Mon, 21 Jun 2021 09:44:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SGPT3Ud3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232789AbhFUQlZ (ORCPT + 99 others); Mon, 21 Jun 2021 12:41:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:56006 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231774AbhFUQhc (ORCPT ); Mon, 21 Jun 2021 12:37:32 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0BB296142B; Mon, 21 Jun 2021 16:28:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1624292936; bh=HYbTZRAy8/F/gBN8gsHM9NM5HdJwKFpKx8WWTYqihpY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SGPT3Ud3T5He89DKq7LR60iKuBO2C5WVnb7KIdbaJ8TYC3+eAGPyWUtDTD8bpEnM3 /6yGgek5Q7mM3DpW50QwvXCY4iHhXXZ3IWbcoxQxlxr92YwmRMjoiJNT7liYkPwILI YKzJqa6pk6yh9jW7XelE5LS0x25r5q1hjCJL9SMY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vladimir Oltean , "David S. Miller" , Sasha Levin Subject: [PATCH 5.12 022/178] net: dsa: felix: re-enable TX flow control in ocelot_port_flush() Date: Mon, 21 Jun 2021 18:13:56 +0200 Message-Id: <20210621154922.511835642@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210621154921.212599475@linuxfoundation.org> References: <20210621154921.212599475@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vladimir Oltean [ Upstream commit 1650bdb1c516c248fb06f6d076559ff6437a5853 ] Because flow control is set up statically in ocelot_init_port(), and not in phylink_mac_link_up(), what happens is that after the blamed commit, the flow control remains disabled after the port flushing procedure. Fixes: eb4733d7cffc ("net: dsa: felix: implement port flushing on .phylink_mac_link_down") Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/mscc/ocelot.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/ethernet/mscc/ocelot.c b/drivers/net/ethernet/mscc/ocelot.c index 46e5c9136bac..0c4c976548c8 100644 --- a/drivers/net/ethernet/mscc/ocelot.c +++ b/drivers/net/ethernet/mscc/ocelot.c @@ -378,6 +378,7 @@ static u32 ocelot_read_eq_avail(struct ocelot *ocelot, int port) int ocelot_port_flush(struct ocelot *ocelot, int port) { + unsigned int pause_ena; int err, val; /* Disable dequeuing from the egress queues */ @@ -386,6 +387,7 @@ int ocelot_port_flush(struct ocelot *ocelot, int port) QSYS_PORT_MODE, port); /* Disable flow control */ + ocelot_fields_read(ocelot, port, SYS_PAUSE_CFG_PAUSE_ENA, &pause_ena); ocelot_fields_write(ocelot, port, SYS_PAUSE_CFG_PAUSE_ENA, 0); /* Disable priority flow control */ @@ -421,6 +423,9 @@ int ocelot_port_flush(struct ocelot *ocelot, int port) /* Clear flushing again. */ ocelot_rmw_gix(ocelot, 0, REW_PORT_CFG_FLUSH_ENA, REW_PORT_CFG, port); + /* Re-enable flow control */ + ocelot_fields_write(ocelot, port, SYS_PAUSE_CFG_PAUSE_ENA, pause_ena); + return err; } EXPORT_SYMBOL(ocelot_port_flush); -- 2.30.2