Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3425698pxf; Mon, 29 Mar 2021 01:44:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxnm3brJWLUEupB889i5ibO+kMuz4uSzCE0WLLBL/cl90skGozLYxrMwQPS9MUyO6tw96v1 X-Received: by 2002:a17:906:c04a:: with SMTP id bm10mr14857356ejb.135.1617007443046; Mon, 29 Mar 2021 01:44:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617007443; cv=none; d=google.com; s=arc-20160816; b=VY2aVphKor/Hxhh+X/fFwWpfUtt3tMPPt8Wp1yUqC7l6DSPlVkkufErNbAFQDyM2RL rVE00OH9I03yVbA4PaoL8d5u5YDCyXOUDJY3zZZQXFIgiViiupI6VvCtRJDpoIAouAMM qy1DfPrqPzIQ775KqN24Bj+xk+bFBhLTTTIj71MBLcRybPeqtglRmVdbd3/CI7dWY7Av 4mJwK9eYY64dLCboEPx565iq/x0KadbCoRFDvpM33XiVBChNdblPKLj6oLBqjn6GOHiA bcyITEmSocqdTxhXI+mSqmmkkArmFw9JFRdpXtwtWTYU0iz5cNR+hrMOBeuBLVH+1V51 AaGQ== 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=0EiOUWNuVIHG05l4ttZdd7C6b7H5eiQGroLoeZscumQ=; b=LWTHC6aNHPFOQb3DoNkP8SrNmtkOG0TSoMO2EVWdDdsHW5O31puX+iF0uSAx/rCVQw f2a985tjE8gWON5evXJYpjpi8LkKWhSw916Sgk52N1uHBwVZc3THIxsY9YtVveHIhAj+ usK2BRD/7S0YdK3M1Bpkh2JvkRHiA+nJ827dXsKTpjjcx4l+0wtZmsL9fbbQ3m6op9eA XSQe4RWP71LQHbTweElq9g3wzXAj0leiED833ilB8YIdLtAH5+nZzaULEOR7ku8UdXMG ctDedyaY57Enq2vcsrzRH1U8IXDWAdRP4NrJAcQDLCb6X0Z/UvrngUWOlX0312im7Rxx Kv9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VCHCQ1EP; 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 z15si13116727ejr.192.2021.03.29.01.43.40; Mon, 29 Mar 2021 01:44:03 -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=VCHCQ1EP; 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 S235039AbhC2Ilu (ORCPT + 99 others); Mon, 29 Mar 2021 04:41:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:40836 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233751AbhC2IXs (ORCPT ); Mon, 29 Mar 2021 04:23:48 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0B17C61477; Mon, 29 Mar 2021 08:23:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617006216; bh=eEJVoYkaI1r84j3V+kCRgMCnPWmDDoAETWzeYyE3snY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VCHCQ1EPU/7BtSphSUU89fyBOX8OL5jxR9m6RdCA+gyL1L3MaXQseT+pnGjoCyJw0 hgqzGrZTkqux2Cdf8+sEoEv4SVbfowPcrcde05h6JKcqjp9Pg21VBcCoIM1ZTqFdc8 xKzNZRPB34rjQg0xGzF+8tZerkxYvwlmrW/BaU80= 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.10 160/221] net: stmmac: dwmac-sun8i: Provide TX and RX fifo sizes Date: Mon, 29 Mar 2021 09:58:11 +0200 Message-Id: <20210329075634.495320332@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210329075629.172032742@linuxfoundation.org> References: <20210329075629.172032742@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 a5e0eff4a387..9f5ccf1a0a54 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c @@ -1217,6 +1217,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) -- 2.30.1