From patchwork Fri Jan 26 09:10:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Esben Haabendal X-Patchwork-Id: 13532304 X-Patchwork-Delegate: kuba@kernel.org Received: from www530.your-server.de (www530.your-server.de [188.40.30.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A944B14263; Fri, 26 Jan 2024 09:10:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=188.40.30.78 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706260250; cv=none; b=mX1KSkJIDIYLIGtNqZY0zBA2qvo3oDybkpjAQvrSsQmYv9bu64eXSRos08w0OcVS+CY9SgHjLpEE9Z65F6so51wGqF5FYn0EdRRBDOVhrzP5kysJBa7vdrXJnpX6gQIFsUyEI6ab6ofPK/ojvros4nBJ7yEAqQXl+YjAUSDjufA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706260250; c=relaxed/simple; bh=iqbcOpTlEh5SlO47biheNN9vN+dMs8WVH0huJV/6Kbw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jYHuXRoQ7SstXoXWCsF/IemAZixw33vqEONA8n1IY9MEWAwe26uay17PpXmLl5XfdfNYukVTtRD4zBjFS88rzafzJPkaw06sTMYZfWRHv34VatlqW2M/lBoff3hrPsVfoDLRhiz49Msqk3Td4yc83Y4rE27D5H5TUq/XHneLAuw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=geanix.com; spf=pass smtp.mailfrom=geanix.com; dkim=pass (2048-bit key) header.d=geanix.com header.i=@geanix.com header.b=Bw6d/FAj; arc=none smtp.client-ip=188.40.30.78 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=geanix.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=geanix.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=geanix.com header.i=@geanix.com header.b="Bw6d/FAj" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=geanix.com; s=default2211; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID; bh=O99d2OhA5yD9439wbiGDNw8gbQ6j47VNjuChaGpSepE=; b=Bw6d/FAjzh7JS+ZSE9l79uyRPs ug04KQ4kugdFE5zsfhVBsrVF2KMCrN6Wcf5FMm0YeEfICSLMtXV/BtvW8kTaYW6Pj+P2UuTo9fOuJ 0awaRMrNFxYiit77EkNuu67cqTdgC4cDdnzQ9R8aMnSlXwZiUTvOjdpaOr6TzbyJw3cbxE3l1ih7V ft407vgmgel6hwcDzRGDgXQBT32XxiaxXKF0tsTU9gxg+6x043M2Qr01DwNi75xISHtWmWW68e+JK r0fy6wb7SsazDKW2TZ6Bx8xC+zzO+yizMv+ZiSTcwTyQouj9l1Y4shrHnZtTDWsiQLYztk46/IexG YxXL017w==; Received: from sslproxy04.your-server.de ([78.46.152.42]) by www530.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rTIEX-000GfG-V8; Fri, 26 Jan 2024 10:10:45 +0100 Received: from [87.49.42.9] (helo=localhost) by sslproxy04.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rTIEX-0004SN-3Z; Fri, 26 Jan 2024 10:10:45 +0100 From: Esben Haabendal To: netdev@vger.kernel.org, Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Christian Marangi Cc: stable@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/2] net: stmmac: do not clear TBS enable bit on link up/down Date: Fri, 26 Jan 2024 10:10:41 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Authenticated-Sender: esben@geanix.com X-Virus-Scanned: Clear (ClamAV 0.103.10/27165/Thu Jan 25 10:51:15 2024) X-Patchwork-Delegate: kuba@kernel.org With the dma conf being reallocated on each call to stmmac_open(), any information in there is lost, unless we specifically handle it. The STMMAC_TBS_EN bit is set when adding an etf qdisc, and the etf qdisc therefore would stop working when link was set down and then back up. Fixes: ba39b344e924 ("net: ethernet: stmicro: stmmac: generate stmmac dma conf before open") Cc: stable@vger.kernel.org Signed-off-by: Esben Haabendal --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index b334eb16da23..25519952f754 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -3932,6 +3932,9 @@ static int __stmmac_open(struct net_device *dev, priv->rx_copybreak = STMMAC_RX_COPYBREAK; buf_sz = dma_conf->dma_buf_sz; + for (int i = 0; i < MTL_MAX_TX_QUEUES; i++) + if (priv->dma_conf.tx_queue[i].tbs & STMMAC_TBS_EN) + dma_conf->tx_queue[i].tbs = priv->dma_conf.tx_queue[i].tbs; memcpy(&priv->dma_conf, dma_conf, sizeof(*dma_conf)); stmmac_reset_queues_param(priv);