Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3416502pxf; Mon, 29 Mar 2021 01:24:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycucEQV1FhHXyyniHi7KEP+4mGx3X9jIhxF1wHpgpe2syFpgvSZ718nAthima3rU63Tx7J X-Received: by 2002:a17:906:29c3:: with SMTP id y3mr26338270eje.430.1617006262900; Mon, 29 Mar 2021 01:24:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617006262; cv=none; d=google.com; s=arc-20160816; b=nBh9MHSk20iD9Bb8TF0EQlxXcQXbQUfWtnaiwIGR+DUBT++Qa1ifGPL6qH4OE7JfrZ 8a2qjf2avU0wq0aggc4FEc6s23CTPsp3JPq1nJa9N3Et+liYumrTFZ560QcW8s5j/RVA vHGzx0gXSu6DQaZPLNnvxGWYKkvO8nxqKCHiKv8MqBLRyfnR1bg0NHk6bKaFjqSYauQZ SjCO2zQuUpBq6c/z4RvaZl822Ja5U0nsQXueuqhF0QpusYAQUxtp7jxr1M0BNdnh8nt2 IdsfLpkSr/6Cs+l7Uo8PpFve8P/hpju7oQaYb4wwT5V9ycBzYLW5XCQW48B84sDoA7uw 8+TQ== 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=cpsmQ7QMvIuRarskux/BFDxKVmlwGeI+VZH13XduUOI=; b=hkV8EwYke7Phv5j27ET5tFw93/SezkhiJUkl9krL3Ynd/DQB0VaFjFRKv8OcTKNyC7 Fyg6sAOqV3CsCBcHzcmrwPYniqtSkGjkFEPWvLHOsfV0mSdqYHXvwWxqf+RLURg8/BSX TPO1kNU1GZ0+W5gp8k54mU12+Z7sM7cVKwTnZXr0gCEJo5N3tzVOOkqpwrHpPH2ZprTx QEA94UkjUJj2ucMy3ME8X8c7v4fGzFYNFSPGi1JSraldDnB1dHSRs3w982ZWP+X1eLr2 IqdfeFy0+qG366cNYIwCdDbcKoTG8jMNaXP4o8BvYwt0c2TLR/Uv5QRXbTLlWnydO94R bZsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=w41L1zl+; 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 b9si12208908edr.611.2021.03.29.01.24.00; Mon, 29 Mar 2021 01:24:22 -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=w41L1zl+; 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 S234164AbhC2IXF (ORCPT + 99 others); Mon, 29 Mar 2021 04:23:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:58014 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232951AbhC2IOy (ORCPT ); Mon, 29 Mar 2021 04:14:54 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 45C6B61601; Mon, 29 Mar 2021 08:14:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617005693; bh=oCaTWTV0i2Q6BY8iMmVbuqvKd1Hqhy5Gfb+rLpgNUaE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=w41L1zl+vVUP9X02lgJBPZMgCx/MI7Y+XmXkNwArnD0DJJejmtxshReaqRtnpmsjk bv4a3GQEX3mrldORU2K0SZF46VBN6QRB4gid0p3WzC8z2LqkUvUmoXjmL0235KmSyv IicOjw+yb7REM9bcJnSItulT+cyAQa6U6fjLgnmw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Belisko Marek , Corentin Labbe , "David S. Miller" , Sasha Levin Subject: [PATCH 5.4 084/111] net: stmmac: dwmac-sun8i: Provide TX and RX fifo sizes Date: Mon, 29 Mar 2021 09:58:32 +0200 Message-Id: <20210329075618.015365829@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210329075615.186199980@linuxfoundation.org> References: <20210329075615.186199980@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: Corentin Labbe [ Upstream commit 014dfa26ce1c647af09bf506285ef67e0e3f0a6b ] 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 Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- 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 c4c9cbdeb601..2f6258ca9515 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c @@ -1206,6 +1206,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_init(pdev, plat_dat->bsp_priv); if (ret) -- 2.30.1