From patchwork Tue Aug 4 16:55:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 11701483 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DDB6514DD for ; Wed, 5 Aug 2020 07:13:57 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 BE93E22B40 for ; Wed, 5 Aug 2020 07:13:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mailerdienst.de header.i=@mailerdienst.de header.b="G5QrEXus" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BE93E22B40 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=fw-web.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7D7D289FDD; Wed, 5 Aug 2020 07:13:17 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mxwww.masterlogin.de (mxwww.masterlogin.de [95.129.51.220]) by gabe.freedesktop.org (Postfix) with ESMTPS id 15D636E48F for ; Tue, 4 Aug 2020 16:56:12 +0000 (UTC) Received: from mxout4.routing.net (unknown [192.168.10.112]) by forward.mxwww.masterlogin.de (Postfix) with ESMTPS id AD31796135; Tue, 4 Aug 2020 16:56:10 +0000 (UTC) Received: from mxbox3.masterlogin.de (unknown [192.168.10.78]) by mxout4.routing.net (Postfix) with ESMTP id 65C451014A6; Tue, 4 Aug 2020 16:56:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1596560170; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sO6tybaMOJ1Y/9jRMHEuMbPOV8G3l1zST2AlvdQbQc4=; b=G5QrEXusd7O180Uc4HbCX88/NhgIAjUvUG/poFT8KiVuY+bL5KLI7P/3YGHEXMXVv5TjT3 qhJxbMsqIrF5w4ESj438PffNefB0XFfEYy7yyKexhi36jJiz2qIRjPqK+POzfHiQ3Ie6AK op1YFQPXAET5ZGv7kQUNBgD8QrCh2YM= Received: from localhost.localdomain (fttx-pool-217.61.144.119.bambit.de [217.61.144.119]) by mxbox3.masterlogin.de (Postfix) with ESMTPSA id 5B5443601C7; Tue, 4 Aug 2020 16:56:09 +0000 (UTC) From: Frank Wunderlich To: linux-mediatek@lists.infradead.org Subject: [PATCH v4] net: ethernet: mtk_eth_soc: fix MTU warnings Date: Tue, 4 Aug 2020 18:55:50 +0200 Message-Id: <20200804165555.75159-3-linux@fw-web.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200804165555.75159-1-linux@fw-web.de> References: <20200804165555.75159-1-linux@fw-web.de> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 05 Aug 2020 07:13:16 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chun-Kuang Hu , Landen Chao , Frank Wunderlich , David Airlie , netdev@vger.kernel.org, Sean Wang , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, "David S. Miller" , Andrew Lunn , John Crispin , Matthias Brugger , Jakub Kicinski , Mark Lee , linux-arm-kernel@lists.infradead.org, Felix Fietkau Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Landen Chao in recent kernel versions there are warnings about incorrect MTU size like these: eth0: mtu greater than device maximum mtk_soc_eth 1b100000.ethernet eth0: error -22 setting MTU to include DSA overhead Fixes: bfcb813203e6 ("net: dsa: configure the MTU for switch ports") Fixes: 72579e14a1d3 ("net: dsa: don't fail to probe if we couldn't set the MTU") Fixes: 7a4c53bee332 ("net: report invalid mtu value via netlink extack") Signed-off-by: Landen Chao Signed-off-by: Frank Wunderlich Reviewed-by: Andrew Lunn --- v3->v4 - fix commit-message (hyphernations,capitalisation) as suggested by Russell - add Signed-off-by Landen - dropped wrong signed-off from rene (because previous v1/2 was from him) --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c index 85735d32ecb0..a1c45b39a230 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -2891,6 +2891,8 @@ static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np) eth->netdev[id]->irq = eth->irq[0]; eth->netdev[id]->dev.of_node = np; + eth->netdev[id]->max_mtu = MTK_MAX_RX_LENGTH - MTK_RX_ETH_HLEN; + return 0; free_netdev: