From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (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 BDFC138BF73 for ; Fri, 27 Feb 2026 09:54:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772186062; cv=none; b=Vhyi3YgoVP2is1HVAol2TNNJqPrDW6nXVUOC7rrvr9YpQIquItfjXkTCUBQsbVDx69mwuEyXnDN4frfkMRmXrjGAfvMl4c98MtzrO0iJafx4muloLzU+MKsUOdy4BCPg0MFTJ0VaYD0TIP2T85zcwalgvSs5Ntt1vSZIZu2t1a8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772186062; c=relaxed/simple; bh=xMEvE6MVW5KbtPNmUGe+9TTiSBXrZkrUvFI/EewsC9g=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=GgC4oaAjDFiOwRZzALAkkY45gIyttrT9eJEeVN4H+LK1pM1cuuX0YR5tD3kzsFiemOzJShWwX19CCn6YfJOYiOSTBn4Dg+tg790KOGBIwX+G4TEzk/ar6d8lNwK+zas5jxWAwPvtZJIQdmKLtugM64uTmoV8i8cffucEbB6AnBc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=KBULIJm9; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="KBULIJm9" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=6kho+T4pB8cv+vYpSQaKdyOQtMZDJQnvD+jvbZwcTao=; b=KBULIJm9VA8MYAefHp/vSThrAx V8GWElB+2MqeYurSe7W44GzIst9yjOmhthTTQ7/cdQeRfLJdH/NK/H8e9nvA8SIgDcEPuKeirI2rv F4WRLxufwnOJZGVD5T3LZtmaWiHqgkep+GSqPwC9mO7xfmeKtvmjKCL8Eso6a5wbEHMzh/O3MPV/X lF/sYQwdgM1Rb4VA37nWsFUrnzAUb6fA0DwweHhMYit+bxsJS3+3VDF13FjTylicfI4QE/amp/XZv 3JsyiV4HUCwE+F2XS9o9AvWNUXyNmyJqhfN2QhmOF/gMnbzD6ye4fq778T+eOsDXg6MxQEjm/5S5s SyNSKUGA==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:51756 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vvuXx-000000000en-1MNL; Fri, 27 Feb 2026 09:54:09 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.98.2) (envelope-from ) id 1vvuXt-0000000Avnc-0UYC; Fri, 27 Feb 2026 09:54:05 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn Cc: Alexandre Torgue , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, netdev@vger.kernel.org, Paolo Abeni Subject: [PATCH net-next 12/14] net: stmmac: move initialisation of dma_cfg->atds Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" Message-Id: Sender: Russell King Date: Fri, 27 Feb 2026 09:54:05 +0000 Move the initialisation of priv->plat->dma_cfg->atds, which indicates that 8 32-bit word descriptors are being used for pre-v4.0 cores, after the call to stmmac_hwif_init(), which will initialise priv->extend_desc and priv->mode (the descriptor mode.) We don't need to re-evaluate this in stmmac_init_dma_engine() - as the state that it depends on only changes in stmmac_hwif_init() which is only called in the probe path. Also, once set, no code clears this flag. Signed-off-by: Russell King (Oracle) --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index be144b946fd5..38f6b890ec37 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -3254,9 +3254,6 @@ static int stmmac_init_dma_engine(struct stmmac_priv *priv) return -EINVAL; } - if (priv->extend_desc && (priv->mode == STMMAC_RING_MODE)) - priv->plat->dma_cfg->atds = 1; - ret = stmmac_prereset_configure(priv); if (ret) return ret; @@ -7449,6 +7446,13 @@ static int stmmac_hw_init(struct stmmac_priv *priv) return ret; } + /* Set alternate descriptor size (which tells the hardware that + * descriptors are 8 32-bit words) when using extended descriptors + * with ring mode. Only applicable for pre-v4.0 cores. + */ + if (priv->extend_desc && priv->mode == STMMAC_RING_MODE) + priv->plat->dma_cfg->atds = 1; + /* Rx Watchdog is available in the COREs newer than the 3.40. * In some case, for example on bugged HW this feature * has to be disable and this can be done by passing the -- 2.47.3