From patchwork Fri Mar 19 13:44:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin LABBE X-Patchwork-Id: 12151115 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80AFAC433E0 for ; Fri, 19 Mar 2021 13:45:59 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0BE7864ED4 for ; Fri, 19 Mar 2021 13:45:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0BE7864ED4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id: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:In-Reply-To:References:List-Owner; bh=+kpU1JQ6ud4nMeXkP9W6/oHD0LsFdtqUv5JPXIg0DX8=; b=hQsyrlT6geAkqEOxtSqYBQI3TQ Vs/VTqJmtZ5icXCRwgUKIPJ9RYjrSmMjCnDlDFHpQdOjilewmHTGZQCHQfakNWfm5UvYTdJ2jC+fw KaDHBw82K0iElqMFlnzDtENR4ehrd7cqV0LitCwhOfwp8ZYhVfb8lHJkhsgXN2jgkKm/GXfPh5jTJ aBeGG120OdfOMxvn88XfCH74YsfR0Fd6GbC6dwdOMyI6Fx+M+caVnt0Qve8Zj2uMG6XALTsd+x1a6 x60jZdnGatkxxo5SIBtMRBbd3y+uULnS9m92mls0hcSRXL6pYvY3q2PJM7Jsj7hcYrsf7mTmLfXC2 Dm8o+LwA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lNFQa-007Udg-Bu; Fri, 19 Mar 2021 13:44:36 +0000 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lNFQV-007UdK-Vk for linux-arm-kernel@lists.infradead.org; Fri, 19 Mar 2021 13:44:33 +0000 Received: by mail-wm1-x331.google.com with SMTP id d191so5483774wmd.2 for ; Fri, 19 Mar 2021 06:44:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=SrPXMdsT8fh/wUuXWu6/XdTRaAoBqvPSi7osz8TT9SU=; b=U6R1VBR7eogovqe6fbsKMg5rSPuVNlwRpsQj7zgx5iIkAphJM281y9IMs1+1oloRuU IXjNVsdVkcYMH5Uun5Tb6+DKDB2ll9TYNJLw/eHctGukmi5uDfwSVInQd3PgXwYe4Bm8 lhnpZqaKhEL1Oti1UB3WgXu/ALz2kAcvM8mUENcaeWbbcBX64Q+X8kLVaT73LZ/d0KAy TJ/kIbZvOxysalhkY703OtBRqgLboDTt0gbUQL9KfTUfz570+kqI3M4j5NthsgESxZ1D nnCryXE7M0zSct8hpFrH6ZkSdaH9rsDGG63WNBQoHDokk9QPG85SqWvPb96BMXZ1zYat 2Vxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=SrPXMdsT8fh/wUuXWu6/XdTRaAoBqvPSi7osz8TT9SU=; b=NJfOeDj8ywXEeiLUbAAt64G45j9rQu3WRZpkx8V/52FYQpwSLgdkdGClFDZBPhU6KS HVdfNo1+tVM0jtlzVhEeriPniGjTdTsQHuf0FEmTrFDftLq524YAaB19LNcPYCdeucqb mrKdsnnccEDKABW5XAPGtX2Qcu02GFJE/mNDIZP9Ybsr5wWONHj8kwxMIIOAGvJk0XDY +gGTLL+iupwWxMe76pZPEJouKfLpoqyQSCe+lOllYQApa79Uqo0z1C7E3D8nVPpaOlwJ TefnCwJVGAQUodAYJEMY60D0lbW2A6MV6OhzS0IzsIAW27K3iujrcncq7nThnXmABTed J9MA== X-Gm-Message-State: AOAM530LPpsppUkoViDUGWjqTLKlARrnu2UmJ4b4ykY3QN0+yfUfNIqU F6E6SHCGs1pYI1rUcFbhW4TaWw== X-Google-Smtp-Source: ABdhPJw0eghg2ZDKjaor7MbxmSXtlraqPUEAPJEv3PG9iEAsL4DxgNxTwpwnFkISye/A6z/DYyY8FQ== X-Received: by 2002:a05:600c:4f14:: with SMTP id l20mr3772915wmq.71.1616161470266; Fri, 19 Mar 2021 06:44:30 -0700 (PDT) Received: from localhost.localdomain ([163.172.76.58]) by smtp.googlemail.com with ESMTPSA id h8sm7829080wrt.94.2021.03.19.06.44.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 06:44:29 -0700 (PDT) From: Corentin Labbe To: alexandre.torgue@st.com, davem@davemloft.net, jernej.skrabec@siol.net, joabreu@synopsys.com, marek.belisko@gmail.com, mripard@kernel.org, peppe.cavallaro@st.com, wens@csie.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Corentin Labbe Subject: [PATCH] net: stmmac: dwmac-sun8i: Provide TX and RX fifo sizes Date: Fri, 19 Mar 2021 13:44:22 +0000 Message-Id: <20210319134422.9351-1-clabbe@baylibre.com> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210319_134432_159166_5A79A14D X-CRM114-Status: GOOD ( 11.76 ) 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: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org MTU cannot be changed on dwmac-sun8i. (ip link set eth0 mtu xxx returning EINVAL) This is due to tx_fifo_size being 0, since this value is used to compute valid MTU range. Like dwmac-sunxi (with commit 806fd188ce2a ("net: stmmac: dwmac-sunxi: Provide TX and RX fifo sizes")) dwmac-sun8i need to have tx and rx fifo sizes set. I have used values from datasheets. After this patch, setting a non-default MTU (like 1000) value works and network is still useable. Tested-on: sun8i-h3-orangepi-pc Tested-on: sun8i-r40-bananapi-m2-ultra Tested-on: sun50i-a64-bananapi-m64 Tested-on: sun50i-h5-nanopi-neo-plus2 Tested-on: sun50i-h6-pine-h64 Fixes: 9f93ac8d408 ("net-next: stmmac: Add dwmac-sun8i") Reported-by: Belisko Marek Signed-off-by: Corentin Labbe --- drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c index 6b75cf2603ff..e62efd166ec8 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c @@ -1214,6 +1214,8 @@ static int sun8i_dwmac_probe(struct platform_device *pdev) plat_dat->init = sun8i_dwmac_init; plat_dat->exit = sun8i_dwmac_exit; plat_dat->setup = sun8i_dwmac_setup; + plat_dat->tx_fifo_size = 4096; + plat_dat->rx_fifo_size = 16384; ret = sun8i_dwmac_set_syscon(&pdev->dev, plat_dat); if (ret)