From patchwork Mon Mar 13 22:42:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Serge Semin X-Patchwork-Id: 13173426 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E9015C61DA4 for ; Mon, 13 Mar 2023 22:47:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ve4TqHV8MkqeQyz6QgiD6W0JutpzVC9v2cETzl7w4H4=; b=CbhU7zfmrZIPds cp7Ayjp6gr60bSXdTG71VkVTd1PDk0+gmxvJjn9vY0wsCIdWoDS05UaXeoyqt3onPzbY5fkgmx0w+ ZwLLFr1GuKuSD44voPLYnd7Oef/AVplJp8lotK5JcVTtrFwuHnaDTqcWvLaS7ANWz/mWdSZCEdNuz vDXnLxqhxvU+86drD45DT9qW64wpxZKasUJK8d3LzzW+vlWPn8FYye/jYWDA3XkJE6PBQVDQxgIhz ZDmhTAxoX5Ak25sZq/GmBHrdWVAd1lE5QwTWsjBqFcXx1e3qKYMjxupOYxtwuV38QrXvjXj1Zz1PZ Dl9ynczs2QDY1qGvEVgw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pbqvy-0088BZ-Um; Mon, 13 Mar 2023 22:46:27 +0000 Received: from post.baikalelectronics.com ([213.79.110.86]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pbqsd-0086IE-M4 for linux-arm-kernel@lists.infradead.org; Mon, 13 Mar 2023 22:43:02 +0000 Received: from post.baikalelectronics.com (localhost.localdomain [127.0.0.1]) by post.baikalelectronics.com (Proxmox) with ESMTP id 728ECE0EB6; Tue, 14 Mar 2023 01:42:48 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= baikalelectronics.ru; h=cc:cc:content-transfer-encoding :content-type:content-type:date:from:from:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=post; bh=Bs1amY+XsKSxbeDn+7iKOOqICBSFRydBCis7liFwu4M=; b=s5zEKbtDGfsz GMOXYO34rCQXnqbu/6HpjlHjQYT7qG5sah9NBsitvYdUzg5MXWvhy0KWhDLRdAmc jTmIL314/LxUWbEmhwsWmPv0H/zf9Iq5Ab6vZLq77jmEtx1fM/zEjWZDGe+CI7Ul lj6dxXk/4+cLAR4n+cNei4FUWrovtXo= Received: from mail.baikal.int (mail.baikal.int [192.168.51.25]) by post.baikalelectronics.com (Proxmox) with ESMTP id 57D7FE0E6A; Tue, 14 Mar 2023 01:42:48 +0300 (MSK) Received: from localhost (10.8.30.10) by mail (192.168.51.25) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 14 Mar 2023 01:42:47 +0300 From: Serge Semin To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Russell King , Andrew Lunn , Heiner Kallweit CC: Serge Semin , Serge Semin , Alexey Malahov , Pavel Parkhomenko , Christian Marangi , Biao Huang , Yang Yingliang , , , , Subject: [PATCH net 05/13] net: stmmac: Enable ATDS for chain-mode Date: Tue, 14 Mar 2023 01:42:29 +0300 Message-ID: <20230313224237.28757-6-Sergey.Semin@baikalelectronics.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230313224237.28757-1-Sergey.Semin@baikalelectronics.ru> References: <20230313224237.28757-1-Sergey.Semin@baikalelectronics.ru> MIME-Version: 1.0 X-Originating-IP: [10.8.30.10] X-ClientProxiedBy: MAIL.baikal.int (192.168.51.25) To mail (192.168.51.25) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230313_154300_044866_C1AE2567 X-CRM114-Status: GOOD ( 15.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org It wasn't stated why the Alternate Descriptor Size shouldn't have been changed for the chained DMA descriptors, while the original commit did introduce some chain_mode.c modifications. So the ATDS-related change in commit c24602ef8664 ("stmmac: support extend descriptors") seems contradicting. Anyway from the DW MAC/GMAC hardware point of view there is no such limitation - whether the chained descriptors can't be used together with the extended alternate descriptors. Moreover not setting the BUS_MODE.ATDS flag will cause the driver malfunction in the framework of the IPC Full Checksum and Advanced Timestamp feature, since the later features require the additional 4-7 dwords of the DMA descriptor to set some flags and a timestamp. So to speak in order to have all these features working correctly in the chained mode too let's make sure the ATDS flag is set irrespectively from the DMA descriptors mode. Fixes: c24602ef8664 ("stmmac: support extend descriptors") Signed-off-by: Serge Semin Reviewed-by: Piotr Raczynski --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 2ed63acaee5b..ee4297a25521 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -2907,7 +2907,6 @@ static int stmmac_init_dma_engine(struct stmmac_priv *priv) struct stmmac_rx_queue *rx_q; struct stmmac_tx_queue *tx_q; u32 chan = 0; - int atds = 0; int ret = 0; if (!priv->plat->dma_cfg || !priv->plat->dma_cfg->pbl) { @@ -2915,9 +2914,6 @@ static int stmmac_init_dma_engine(struct stmmac_priv *priv) return -EINVAL; } - if (priv->extend_desc && (priv->mode == STMMAC_RING_MODE)) - atds = 1; - ret = stmmac_reset(priv, priv->ioaddr); if (ret) { dev_err(priv->device, "Failed to reset the dma\n"); @@ -2925,7 +2921,8 @@ static int stmmac_init_dma_engine(struct stmmac_priv *priv) } /* DMA Configuration */ - stmmac_dma_init(priv, priv->ioaddr, priv->plat->dma_cfg, atds); + stmmac_dma_init(priv, priv->ioaddr, priv->plat->dma_cfg, + priv->extend_desc); if (priv->plat->axi) stmmac_axi(priv, priv->ioaddr, priv->plat->axi);