Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3923104pxj; Mon, 21 Jun 2021 09:27:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9vaHJ+KtHSHs9T2hGDDhwRD1V6JuUP2/B1N8f/56ZRsytvqJLoxn0KeMUXL3lvdw38pL2 X-Received: by 2002:a17:906:b0c4:: with SMTP id bk4mr25766133ejb.422.1624292839607; Mon, 21 Jun 2021 09:27:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624292839; cv=none; d=google.com; s=arc-20160816; b=L5tEhiD653/bGns7FTgyCA9BKnbCFwc2rcG5B6jSc93RD8pUTMkVLkBrdDIrvVJrDe yFHWuRUhlIO0bhybxPcYdFcvFXo42GDD7r59wSwryazMAZO00VBXjWN13q5xBHerVJ6Z t2zj9JDCV88VP0WMRpxcrjhEPwi5aMWwTqYWnLEXwIGAfd6al5iE9alZZ4Twb0bjR/gC lbHr752j9PzL/AAlmRNLAJhInfRuUdd/69cyHTUu0Vzy+oFI0xLb5w+cf6lbB9vykcoy /a2nD74e7Bg+6ZFq19/1VWs7SWxil+XLJy0pAmEBKW1fja0MESLWq7gJlqfm+XnH6HvF glIg== 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=tUaRSm4ibKnw3J6ECIVThwaNrkyD7vg2qfNrrOW7xY0=; b=yder0chM4xedDTM8q/qBvNykkoZOfvIFvs/de48XTqihSJjNV76tTDKQMrkPBrtM5E Gbd7OcNbkCnjKBhU+T46DmtTtzGbNFyO/OfIF0YCDG6tzxdz0pbkBLBnN1XtZgzgvIGM 75J4DNuifl11AaNMvrtR+2RGDpuuLxec6p7JJz698JkroOzwvZieoYchyXsPW0PUWg+4 Cb8sOfARNGy153cH+PoftridSIXOSdm36i/+l3R/q7iVFM//aoJFGmkn0BXRC+XoASxk RTD6yGIFkv15ECyvXbw2AuZOIaZsfoRYN5uxcsj/itLABdtfNUiVzNcdyz16ffA5DiSp 8K6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Gh5KozJr; 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 e5si16829049edu.539.2021.06.21.09.26.57; Mon, 21 Jun 2021 09:27:19 -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=Gh5KozJr; 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 S232087AbhFUQ0a (ORCPT + 99 others); Mon, 21 Jun 2021 12:26:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:46838 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231976AbhFUQY6 (ORCPT ); Mon, 21 Jun 2021 12:24:58 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2A9F8613BD; Mon, 21 Jun 2021 16:21:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1624292491; bh=piiJn/vqQ4NodYHaGlI0T4JMB2f61o0iphmtpgrFU14=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Gh5KozJr4/zFiIMSxSWXNYYT4/e2nU5kfqU8UzWLQH5vjRKf00H3U6pAlDr5/MJmq qPNRY3wMgoGdTPRnRrynffdDO2ihmxoJimHBYDPEW9i8uimk5iYk5uB6d0/i0FDRW6 z+Ffug/rNONhFk5nnHWz2SVx7EVnh3XRJKxHwhhs= 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.10 020/146] net: dsa: felix: re-enable TX flow control in ocelot_port_flush() Date: Mon, 21 Jun 2021 18:14:10 +0200 Message-Id: <20210621154911.958549234@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210621154911.244649123@linuxfoundation.org> References: <20210621154911.244649123@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 aa400b925b08..5bfc7acfd13a 100644 --- a/drivers/net/ethernet/mscc/ocelot.c +++ b/drivers/net/ethernet/mscc/ocelot.c @@ -355,6 +355,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 */ @@ -363,6 +364,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 */ @@ -398,6 +400,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