From patchwork Sat Jun 30 16:18:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 140681 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2138777ljj; Sat, 30 Jun 2018 09:20:42 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeqYiRQTicWOE/uC/ZLoHPQWzQ59c/xMi/DFG1CSF2HuI1B1gmEqS01z+3BNOR++8xvpVYD X-Received: by 2002:a65:4e84:: with SMTP id b4-v6mr14209764pgs.293.1530375642042; Sat, 30 Jun 2018 09:20:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530375642; cv=none; d=google.com; s=arc-20160816; b=tI7DYoVGhCo2TR4nJy09RKb1S3emy58OKR5ld6sjAipQh4mIi3PJizYH3iLDqujVRQ ic6ioLSV3N3A5SO45OAlT6Ua9W+wIH7wcRUeeY2IQE6ZEsRpR3PGrpnjN3mPRVv/A0fM 5Shst+5i2d0g9D81dwPe3ZKsfTnk5h2kNflXM9MZZpL6+AuJmHWQRHFN0jHN8tpgjT+w I86Fu0h19G2IdkPgjNmLnmx9u/ZxfK6NHUtp+0WcKHGAOikI1dTqXNFzDGbW7baAzZzQ efHXs27nGeiQI42hJX6UxwJ66e3AKiCyQzJmTxBMen/542OnqLmRRl4SFJXoJnQ6QuFj kWEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=vTNCzfqgVI/ts3itcR8up9gaX2uJ8xL04YE+he4T6hc=; b=inUxluYsQyI/QWcE7sdb83oxUpo1JK1KYEaVzVUq89lsBX0zgi/8uXklPt4uEUKeof D3cXtZe3GmXQuEmQDjsVXN0jJ/zDevGqG3h+QIEsIXjRsduO9AzAp+3gi0b9inGmopb6 ODO9CnBREYRYt22H3FlHJ7ibwMiOeVyQ1i/NHmSf+Sg0xKgeRTUx5fK1AEuMiCijRVej jxUg7RJF4xSbf8gFXb6Rat8K2p6yidsWRM+gwX3kpb+C60RU2ywYO0PSS4JSQGoJik6t Opmlbw993VyOVmzViyuurAILb8Y5FGWMn1f7+pM75Bn/fHF1dxXejycezeVn2A0F9HHJ 2JFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LlsrEzjn; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l15-v6si3618264pgf.451.2018.06.30.09.20.41; Sat, 30 Jun 2018 09:20:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LlsrEzjn; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751241AbeF3QU3 (ORCPT + 9 others); Sat, 30 Jun 2018 12:20:29 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:37795 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751113AbeF3QU1 (ORCPT ); Sat, 30 Jun 2018 12:20:27 -0400 Received: by mail-lj1-f193.google.com with SMTP id c11-v6so9540181lja.4 for ; Sat, 30 Jun 2018 09:20:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=vTNCzfqgVI/ts3itcR8up9gaX2uJ8xL04YE+he4T6hc=; b=LlsrEzjn/g2c8IUXL7UQ7bBl0pe6Sj05Hwo/E/m50KnAaoXmCS+SDvOP1YoaSY+fdM A8+UrNp4nDmk+nL+3veCwsvt3p9j5/KUFwyd/70G4EmCkrFZUjDGxxJhT+MNoMFNkGrC J8Qi9Z1IXbCsE8f7xlXoyYaZS9OzuXldc5wDc= 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=vTNCzfqgVI/ts3itcR8up9gaX2uJ8xL04YE+he4T6hc=; b=byK0qbJ7NRYvSuiFFnIgvNnmwNCAx3HUyQusr39Hc2PjbTNRPJ6GTSTVaoChnErkUO 3cvaHGudA11o2AN71S19HhGzPnmOm0EH0SQgOk1WuxCEWDyuPfJmIEj2R4dXE9r364oe FO7n1WOA96+GjfX39JyElIBNEOksyU0XLpc2TGsLA0NZsQq8K8ZmZrUPanw4bCQ71/Yd kQQYSZILjTNEDJkTz56t8JxNt7d2mFx/0utXlJUgnvAA2K7vWdedqa60+675WyjI3fwT fTK1gGwmAsGC+aL2BFvKY9rf9j3nyPSsyRpXBMCBHd3iW9M7/fioIAWPxPy6s19aTknJ JrBA== X-Gm-Message-State: APt69E3XgpqQVLEo4vmo3ngm8ClrpotHlhBpMlu8Dc0avmxZDiQ7y7H+ lgBL7gufrmydrNbDSHoKe5eahjhgW70= X-Received: by 2002:a2e:330b:: with SMTP id d11-v6mr12473059ljc.67.1530375625350; Sat, 30 Jun 2018 09:20:25 -0700 (PDT) Received: from localhost.localdomain (c-ae7b71d5.014-348-6c756e10.bbcust.telenor.se. [213.113.123.174]) by smtp.gmail.com with ESMTPSA id 93-v6sm2271978lfy.64.2018.06.30.09.20.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 30 Jun 2018 09:20:24 -0700 (PDT) From: Linus Walleij To: netdev@vger.kernel.org, "David S . Miller" , =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Cc: Janos Laube , Paulius Zaleckas , linux-arm-kernel@lists.infradead.org, Hans Ulli Kroll , Florian Fainelli , Linus Walleij Subject: [PATCH net-next 1/5] net: gemini: Look up L3 maxlen from table Date: Sat, 30 Jun 2018 18:18:02 +0200 Message-Id: <20180630161806.24312-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The code to calculate the hardware register enumerator for the maximum L3 length isn't entirely simple to read. Use the existing defines and rewrite the function into a table look-up. Signed-off-by: Linus Walleij --- drivers/net/ethernet/cortina/gemini.c | 61 ++++++++++++++++++++------- 1 file changed, 46 insertions(+), 15 deletions(-) -- 2.17.1 diff --git a/drivers/net/ethernet/cortina/gemini.c b/drivers/net/ethernet/cortina/gemini.c index 6d7404f66f84..8fc31723f700 100644 --- a/drivers/net/ethernet/cortina/gemini.c +++ b/drivers/net/ethernet/cortina/gemini.c @@ -401,26 +401,57 @@ static int gmac_setup_phy(struct net_device *netdev) return 0; } -static int gmac_pick_rx_max_len(int max_l3_len) -{ - /* index = CONFIG_MAXLEN_XXX values */ - static const int max_len[8] = { - 1536, 1518, 1522, 1542, - 9212, 10236, 1518, 1518 - }; - int i, n = 5; +/* The maximum frame length is not logically enumerated in the + * hardware, so we do a table lookup to find the applicable max + * frame length. + */ +struct gmac_max_framelen { + unsigned int max_l3_len; + u8 val; +}; - max_l3_len += ETH_HLEN + VLAN_HLEN; +static const struct gmac_max_framelen gmac_maxlens[] = { + { + .max_l3_len = 1518, + .val = CONFIG0_MAXLEN_1518, + }, + { + .max_l3_len = 1522, + .val = CONFIG0_MAXLEN_1522, + }, + { + .max_l3_len = 1536, + .val = CONFIG0_MAXLEN_1536, + }, + { + .max_l3_len = 1542, + .val = CONFIG0_MAXLEN_1542, + }, + { + .max_l3_len = 9212, + .val = CONFIG0_MAXLEN_9k, + }, + { + .max_l3_len = 10236, + .val = CONFIG0_MAXLEN_10k, + }, +}; + +static int gmac_pick_rx_max_len(unsigned int max_l3_len) +{ + const struct gmac_max_framelen *maxlen; + int maxtot; + int i; - if (max_l3_len > max_len[n]) - return -1; + maxtot = max_l3_len + ETH_HLEN + VLAN_HLEN; - for (i = 0; i < 5; i++) { - if (max_len[i] >= max_l3_len && max_len[i] < max_len[n]) - n = i; + for (i = 0; i < ARRAY_SIZE(gmac_maxlens); i++) { + maxlen = &gmac_maxlens[i]; + if (maxtot <= maxlen->max_l3_len) + return maxlen->val; } - return n; + return -1; } static int gmac_init(struct net_device *netdev) From patchwork Sat Jun 30 16:18:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 140685 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2139057ljj; Sat, 30 Jun 2018 09:21:00 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd+iQt68e93w/SXAjbJRbRIK5kVvMeRODYM+BpAC5e/FkC/Nb+nb4ibIpUlSpwB8NGuPodr X-Received: by 2002:a17:902:d896:: with SMTP id b22-v6mr1455961plz.265.1530375660223; Sat, 30 Jun 2018 09:21:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530375660; cv=none; d=google.com; s=arc-20160816; b=Cwf7WHBRObV+yrCO0qoPJuK8PLwIPTYXfSqg9mlsoqjDn2TeKWl8mN7bPyqY8LHCNP gkprhC+05IsBi+T597OaQ7bZt628yjUuEF88mvSELLkelz8m2nSP09BRryUt6VBnjLl8 Whj5YV84UWkxRi42zDmjqfFv2dTc5uJrCm0SzHasZqRpQt9VZdK2Rbt3TQaVyEcYryDg biQgoJv3JMDAOJ+KQ7szzIvB2X/7Fjm7WmP6MkMPxU0yLK75mO5v4W2MwCPQ8VLo9mvc IUlGZkioQCJ6HKYp2/5Xc1gJhRlLm0kD8HEZsR51iUY86oKAOorxl3ofOVK5x2SCV5SI S3Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=hJq7g3g0CwrmubFANUHdHonKFNoumP2irvnjb4uadxk=; b=as80nW0i1yC7UX2K7rEqu3Ht+5oYMVmv+FMn8khnPflZzNliaAsT59tn9NDDk4zXKT HJoQriiSuONx3v8pwcg/y5lv+ASPndkkQOPO5n0GSCSPaTeqztSonocqStN1jq5NFXtx KF1xzw0ioksc9EZpIfiWg71UiBLrf35dkPtn2t+DHos7nIj/Ch8Bevef0e1XJLTVPkw9 nKTh7etD8bixhu+7UD0cOyMXK+Xqp37ez8PThkTENKjoNCqtMKuny+84DeKKXcSgdLPd /A4j3ihAAHdkEiYIp7RFM8s2Kr8L2FaX82Sj2mN551Xgvi4vrnzsjQ75at61TG3SZY/M 3RiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=U7slvhpp; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 78-v6si12501422pfb.204.2018.06.30.09.21.00; Sat, 30 Jun 2018 09:21:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=U7slvhpp; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751339AbeF3QUe (ORCPT + 9 others); Sat, 30 Jun 2018 12:20:34 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:43655 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751246AbeF3QUc (ORCPT ); Sat, 30 Jun 2018 12:20:32 -0400 Received: by mail-lf0-f66.google.com with SMTP id m12-v6so8372972lfc.10 for ; Sat, 30 Jun 2018 09:20:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=hJq7g3g0CwrmubFANUHdHonKFNoumP2irvnjb4uadxk=; b=U7slvhpp0WIcj9Xl/DINJd5W9r32VKKBu23EKAG4EI8VUv99LnbkWzoHdSbsl6ZoQX +nBu42bIWQaAFMppRzzcTSlUcAR/fOc81WAmD9xqY2UWs9y/v0HxNlkN/ir2XnsPR+xu lANw8GyYo2PbgyjF8fuzNnlGOln9qC98sFDeI= 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:in-reply-to :references; bh=hJq7g3g0CwrmubFANUHdHonKFNoumP2irvnjb4uadxk=; b=lZJYEvVM/jEx9jSdIDa4CjPZvnEwUnPZyvQIlzOCAQhIrlVwUH/2a6bRAKCilndHcO oCAt3H0NnJm9Y+4U5ViIiA2H8fElM8R1oQBkLAC74LDZSNWRsTsaP5gvTzoPBfeO2Wvy GTts3V5qv/wolKJZGSWaSFKv4kdTKBOHjRBNotYQIuOmnpK92Y01yx9zitwrwWPgMh5b HpxtK1r/crEmAIh6m6ja1J/biCe3GuAwtTRiZLrq8VLAeltRNXjUQ5asBd6xVzjDn8Sx T3DTP2TYK7SPHj7CZr6QetuVN51vaikpeNAYwIdbDkf2enfAePUXUKJJteCrw+yFDztS vBTg== X-Gm-Message-State: APt69E1n9c0xu6TerKZYnr+82axTQlkWxcW5aTrvm2XA0c8zbKNbyqKA uK0g5JtMvt09MUXwwSqAMdS13qls4/c= X-Received: by 2002:a19:8f10:: with SMTP id r16-v6mr7387986lfd.92.1530375630683; Sat, 30 Jun 2018 09:20:30 -0700 (PDT) Received: from localhost.localdomain (c-ae7b71d5.014-348-6c756e10.bbcust.telenor.se. [213.113.123.174]) by smtp.gmail.com with ESMTPSA id 93-v6sm2271978lfy.64.2018.06.30.09.20.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 30 Jun 2018 09:20:29 -0700 (PDT) From: Linus Walleij To: netdev@vger.kernel.org, "David S . Miller" , =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Cc: Janos Laube , Paulius Zaleckas , linux-arm-kernel@lists.infradead.org, Hans Ulli Kroll , Florian Fainelli , Linus Walleij Subject: [PATCH net-next 2/5] net: gemini: Improve connection prints Date: Sat, 30 Jun 2018 18:18:03 +0200 Message-Id: <20180630161806.24312-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180630161806.24312-1-linus.walleij@linaro.org> References: <20180630161806.24312-1-linus.walleij@linaro.org> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Instead of just specify that a PHY is connected at some speed, also specify which one. This is helpful with several PHYs on the system. Signed-off-by: Linus Walleij --- drivers/net/ethernet/cortina/gemini.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) -- 2.17.1 diff --git a/drivers/net/ethernet/cortina/gemini.c b/drivers/net/ethernet/cortina/gemini.c index 8fc31723f700..b49ed8964026 100644 --- a/drivers/net/ethernet/cortina/gemini.c +++ b/drivers/net/ethernet/cortina/gemini.c @@ -300,23 +300,26 @@ static void gmac_speed_set(struct net_device *netdev) status.bits.speed = GMAC_SPEED_1000; if (phydev->interface == PHY_INTERFACE_MODE_RGMII) status.bits.mii_rmii = GMAC_PHY_RGMII_1000; - netdev_info(netdev, "connect to RGMII @ 1Gbit\n"); + netdev_info(netdev, "connect %s to RGMII @ 1Gbit\n", + phydev_name(phydev)); break; case 100: status.bits.speed = GMAC_SPEED_100; if (phydev->interface == PHY_INTERFACE_MODE_RGMII) status.bits.mii_rmii = GMAC_PHY_RGMII_100_10; - netdev_info(netdev, "connect to RGMII @ 100 Mbit\n"); + netdev_info(netdev, "connect %s to RGMII @ 100 Mbit\n", + phydev_name(phydev)); break; case 10: status.bits.speed = GMAC_SPEED_10; if (phydev->interface == PHY_INTERFACE_MODE_RGMII) status.bits.mii_rmii = GMAC_PHY_RGMII_100_10; - netdev_info(netdev, "connect to RGMII @ 10 Mbit\n"); + netdev_info(netdev, "connect %s to RGMII @ 10 Mbit\n", + phydev_name(phydev)); break; default: - netdev_warn(netdev, "Not supported PHY speed (%d)\n", - phydev->speed); + netdev_warn(netdev, "Unsupported PHY speed (%d) on %s\n", + phydev->speed, phydev_name(phydev)); } if (phydev->duplex == DUPLEX_FULL) { From patchwork Sat Jun 30 16:18:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 140682 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2138807ljj; Sat, 30 Jun 2018 09:20:43 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfXsI9t3JV0Xm+4CQdP/L8TDkXBKOqei/ym5DcPfW5MTAEwLPC8liSL2bZW+jdfW6+h1VxK X-Received: by 2002:a62:b94:: with SMTP id 20-v6mr18551558pfl.234.1530375643766; Sat, 30 Jun 2018 09:20:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530375643; cv=none; d=google.com; s=arc-20160816; b=ZGA34KkuHZQL1pgk/9I/LyvSwrt0Hn3q5Bqj8gwa046SgoIXprD65GaId5nYr9RHcJ bUzlSP4QnWxNgMweuPrTEafn18ezsrfwm0/+hIQl6Cy3P/5whR3wHT9qavYokpaEtkqy FgzjcVOvLtSHwzaEVcLBXE8eBxvUF0L+0B4ZgD3ploXjgo3acKaSN5j7Jjb2gXSNzm3v OQWGWbCecdPXC7E0ADChyojIFHhi0F2iUPn6r3ZizgOZdzFtwnt/5hd9ap5Xnu8NBMVi Q1TM1uZf86xPj4/2T6Rc/CiSaoNfbRoqeEXucldrtPsUWGPksXbphy09StGxGSOFdnsp TsRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=bU62lQ3D52yGrEqTjFbWNMYMbSN8HfjijrnWjvZAtQQ=; b=sHtLEAGbqcySBj8G22rC55HI62eC3GG8lNYV3cOD6T/H8jfRRe/CQrQWMkOsRYc8ge JTy+9wLz7aVx1smVi7F6uj+pXhqPvfqYc3cvsedbBNBpP267g1OPBJ3m0hqltO+gQOwO YSfbicvqMjh3Y635EjhWcfkUBTnEajoMOojXpncVokLP3Qw949lyVMfr/0bJpO8lROhG xUUq8TKrQN51MhDCYt4fu1DvBhTXInHYa/lW22dypfbYSN0kimMdq4K/EoxtMkw2sOXU 1jofzrM/TP4SkRm/svIZAxcHcqjQqW7mNyN9FBGJbg2MkT2xIB43BPO59ovmiLQtFBdr Xa4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aDADMcSF; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l15-v6si3618264pgf.451.2018.06.30.09.20.43; Sat, 30 Jun 2018 09:20:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aDADMcSF; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751483AbeF3QUi (ORCPT + 9 others); Sat, 30 Jun 2018 12:20:38 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:45351 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751460AbeF3QUf (ORCPT ); Sat, 30 Jun 2018 12:20:35 -0400 Received: by mail-lf0-f65.google.com with SMTP id m13-v6so8925018lfb.12 for ; Sat, 30 Jun 2018 09:20:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=bU62lQ3D52yGrEqTjFbWNMYMbSN8HfjijrnWjvZAtQQ=; b=aDADMcSFgNOzkooI5MtNjQa62SPLUmLwKsBpqGEurVYf6KDbZlFQlShQIF+CQdkV1U 6T+8BWQEUELH0qpGi3wExLDJziZehYgMWei4LfZLgwbxdV3sQSW8NCHLCUtg/ioFQQvx wiGIeoq0j1oBh2/tcTrpDFqbtFlBaUVx6mAUg= 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:in-reply-to :references; bh=bU62lQ3D52yGrEqTjFbWNMYMbSN8HfjijrnWjvZAtQQ=; b=N6seE/fUP/NmH3kvl9bLAjlOc8fQQNkaJQ0JhGXk7bAGxR/JXGEpSwQfjDVG+4u0YT /61A6mAJNFZNowmyDL/KuOfTT6x/RVtIQsB8pXa1nigJIzbdDl4sUoUm5STNd7Dr1bQe 10f5Z4sKiFzV1XHbE+Frba0rQB3A3Brm0o5rLbQz3FHra/r18/fKoBLhYQouDH0X4Ale 7KKyMhc6qdKYzj5NqIcSH3SLvSyYmgMAURtayt2WwenYxpTTxBBQDbnVkqxjZGHv8Wn6 kXMK8L4ETceXwQUCrVpsvO6LyuJcIuAeZ3J2dEGYpm2KAv06Q894DVbvn95rMoc9fjuV f/WQ== X-Gm-Message-State: APt69E35KBaMW5spDZnhzh6vzOWzprSw0fCXucAILNvoxPsPx4vPKgdr +uJNWTsEjNRSavrdUcR1rsV5EQFkEgE= X-Received: by 2002:a19:1190:: with SMTP id 16-v6mr12047969lfr.122.1530375633531; Sat, 30 Jun 2018 09:20:33 -0700 (PDT) Received: from localhost.localdomain (c-ae7b71d5.014-348-6c756e10.bbcust.telenor.se. [213.113.123.174]) by smtp.gmail.com with ESMTPSA id 93-v6sm2271978lfy.64.2018.06.30.09.20.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 30 Jun 2018 09:20:32 -0700 (PDT) From: Linus Walleij To: netdev@vger.kernel.org, "David S . Miller" , =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Cc: Janos Laube , Paulius Zaleckas , linux-arm-kernel@lists.infradead.org, Hans Ulli Kroll , Florian Fainelli , Linus Walleij Subject: [PATCH net-next 3/5] net: gemini: Allow multiple ports to instantiate Date: Sat, 30 Jun 2018 18:18:04 +0200 Message-Id: <20180630161806.24312-3-linus.walleij@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180630161806.24312-1-linus.walleij@linaro.org> References: <20180630161806.24312-1-linus.walleij@linaro.org> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The code was not tested with two ports actually in use at the same time. (I blame this on lack of actual hardware using that feature.) Now after locating a system using both ports, add necessary fix to make both ports come up. Signed-off-by: Linus Walleij --- drivers/net/ethernet/cortina/gemini.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/net/ethernet/cortina/gemini.c b/drivers/net/ethernet/cortina/gemini.c index b49ed8964026..8d192fcd51c8 100644 --- a/drivers/net/ethernet/cortina/gemini.c +++ b/drivers/net/ethernet/cortina/gemini.c @@ -1787,7 +1787,10 @@ static int gmac_open(struct net_device *netdev) phy_start(netdev->phydev); err = geth_resize_freeq(port); - if (err) { + /* It's fine if it's just busy, the other port has set up + * the freeq in that case. + */ + if (err && (err != -EBUSY)) { netdev_err(netdev, "could not resize freeq\n"); goto err_stop_phy; } From patchwork Sat Jun 30 16:18:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 140683 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2138973ljj; Sat, 30 Jun 2018 09:20:55 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLlUNNq/f5RPXqYwAkF8WsDJrw7K8x3D9SWB1gPHLv2/KuZc63CAXxr+4kXJT2JrpDBiTvX X-Received: by 2002:a17:902:6b86:: with SMTP id p6-v6mr19455703plk.75.1530375655390; Sat, 30 Jun 2018 09:20:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530375655; cv=none; d=google.com; s=arc-20160816; b=tUooQx90NHw+u/4qObUvjZjw6ceuCIWlca/2/bRGI6cxe1S4BNosinV1Zt2a+wgqDN AJEFx6COUTpx4UN8cT1ENonOMcVVLf4dQ8itHhTiD8AOUu32TaaTZKd2/GvoomA/O6Ip DfeZWFT1BlSg4wuQkN8jtH0zNk10gKsFQSqRBTJnOqol52bq0f8DLvf6HxSz7Dx1YBGM OEpMWuUJSsREIN3FVJDrnRqbbvxIN5prY6SZ7v9Bx4aD+QgobngYUVTBbJoo+Z3nc43y VMwywSLe4zhHwlpUdbR4z/j3DBHrXDnpMfdWBjhqJvrK6mWngmtxnlR0aG36DvtaUZnH Dscg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=UxpUcszz9WFS4pG/wLl3BHuJI4EYo2qBSZxxg9tbKcg=; b=xUjrTkR+xP4DEQW+5LIQ0thwmIJufXdO/awwraNdJS49cKTESBqflWjUFO+cAzE5Tk +pIOrD0L+CuVqVLUq4afh3xb3mvSKdoLdTm+qMZpR6KRKt+7cVosP7U/Q0/lv/1jYUWO zgsfHqJa5G+IBMiHP6BpjDQ1dxWa8qsp7IMmySwfJPldJzpHlPOr5gnehrWz/A96+xRl 4WnkuKq4VbVEJI/wkF1isfERXk0hZIMu45KUMjzAc5QdJU5ng7e/W0ZZvKPnd/0EW0sJ K3WEMqJhoczrN15nV9qM2+uFFlfUzPcp1kNNAYFV3VEzom0wvp2IWfCHAPLZ5ODWW1UH w9vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AQLjXu4+; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 78-v6si12501422pfb.204.2018.06.30.09.20.55; Sat, 30 Jun 2018 09:20:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AQLjXu4+; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751516AbeF3QUo (ORCPT + 9 others); Sat, 30 Jun 2018 12:20:44 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:36123 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751113AbeF3QUh (ORCPT ); Sat, 30 Jun 2018 12:20:37 -0400 Received: by mail-lf0-f66.google.com with SMTP id n24-v6so8948143lfh.3 for ; Sat, 30 Jun 2018 09:20:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=UxpUcszz9WFS4pG/wLl3BHuJI4EYo2qBSZxxg9tbKcg=; b=AQLjXu4+JgWTbe+Tu+FY65iKD6OgseSvYA2948WZvbz/ooxw44nwEFzbuCyAETgXQI anGHmDrjdj2t5uwMM3lRpDtuUvBUgAALRXnAF2X+w+KeHVyqVZD7Lql92OtkL2Sgzh59 ljgpM+W4YXDFmfhuorSy5Uwa9vPb2f7XViqao= 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:in-reply-to :references; bh=UxpUcszz9WFS4pG/wLl3BHuJI4EYo2qBSZxxg9tbKcg=; b=oPc+s7RrBB8An4/oKnQxIRGtZdIZXE7Qqq4eUQIZrGuUg2It2KKDuXfDFBw/KT/5As IAXunvffJrGIqyDbpvJj/z1GqK/fQXw6lPi7sI1pEwh7X5RNI8uGroaGwvXGnHRSrmBz QWB5LIYLM5ydeXOa6qYjxUEiT0kB5eZ0WCGd17kiEJdpC4ia1nlslVWv7QV2cVacN0Wd e8h46ud4KQ4ZXHwgLsqlbq23mjgRydI0N+PZ7xeKpDThDqcbSNzuJGe4azf39AhiV6rA HdrjxLEi3r2xZI7t7cgHpuhorORNg4PSTuDJ3ttMumzk0ZmvS7m3egMmsgkrbJeAM8La ytcA== X-Gm-Message-State: APt69E1cIMrErqZzRKZRKd3Oiw9HnEDtkbdgeTT8M7KzECWoPxahrl9w q3UlxoQ2XS2wELy3YiH91iY4Z7BTPw8= X-Received: by 2002:a19:138b:: with SMTP id 11-v6mr9483220lft.74.1530375635971; Sat, 30 Jun 2018 09:20:35 -0700 (PDT) Received: from localhost.localdomain (c-ae7b71d5.014-348-6c756e10.bbcust.telenor.se. [213.113.123.174]) by smtp.gmail.com with ESMTPSA id 93-v6sm2271978lfy.64.2018.06.30.09.20.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 30 Jun 2018 09:20:34 -0700 (PDT) From: Linus Walleij To: netdev@vger.kernel.org, "David S . Miller" , =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Cc: Janos Laube , Paulius Zaleckas , linux-arm-kernel@lists.infradead.org, Hans Ulli Kroll , Florian Fainelli , Linus Walleij Subject: [PATCH net-next 4/5] net: gemini: Move main init to port Date: Sat, 30 Jun 2018 18:18:05 +0200 Message-Id: <20180630161806.24312-4-linus.walleij@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180630161806.24312-1-linus.walleij@linaro.org> References: <20180630161806.24312-1-linus.walleij@linaro.org> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The initialization sequence for the ethernet, setting up interrupt routing and such things, need to be done after both the ports are clocked and reset. Before this the config will not "take". Move the initialization to the port probe function and keep track of init status in the state. Signed-off-by: Linus Walleij --- drivers/net/ethernet/cortina/gemini.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/drivers/net/ethernet/cortina/gemini.c b/drivers/net/ethernet/cortina/gemini.c index 8d192fcd51c8..79324bbfd768 100644 --- a/drivers/net/ethernet/cortina/gemini.c +++ b/drivers/net/ethernet/cortina/gemini.c @@ -146,6 +146,7 @@ struct gemini_ethernet { void __iomem *base; struct gemini_ethernet_port *port0; struct gemini_ethernet_port *port1; + bool initialized; spinlock_t irq_lock; /* Locks IRQ-related registers */ unsigned int freeq_order; @@ -2301,6 +2302,14 @@ static void gemini_port_remove(struct gemini_ethernet_port *port) static void gemini_ethernet_init(struct gemini_ethernet *geth) { + /* Only do this once both ports are online */ + if (geth->initialized) + return; + if (geth->port0 && geth->port1) + geth->initialized = true; + else + return; + writel(0, geth->base + GLOBAL_INTERRUPT_ENABLE_0_REG); writel(0, geth->base + GLOBAL_INTERRUPT_ENABLE_1_REG); writel(0, geth->base + GLOBAL_INTERRUPT_ENABLE_2_REG); @@ -2447,6 +2456,10 @@ static int gemini_ethernet_port_probe(struct platform_device *pdev) geth->port0 = port; else geth->port1 = port; + + /* This will just be done once both ports are up and reset */ + gemini_ethernet_init(geth); + platform_set_drvdata(pdev, port); /* Set up and register the netdev */ @@ -2564,7 +2577,6 @@ static int gemini_ethernet_probe(struct platform_device *pdev) spin_lock_init(&geth->irq_lock); spin_lock_init(&geth->freeq_lock); - gemini_ethernet_init(geth); /* The children will use this */ platform_set_drvdata(pdev, geth); @@ -2577,8 +2589,8 @@ static int gemini_ethernet_remove(struct platform_device *pdev) { struct gemini_ethernet *geth = platform_get_drvdata(pdev); - gemini_ethernet_init(geth); geth_cleanup_freeq(geth); + geth->initialized = false; return 0; } From patchwork Sat Jun 30 16:18:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 140684 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2138978ljj; Sat, 30 Jun 2018 09:20:55 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe+jINa3iEfgU2F+PXTd1OOF00Wp1ihhjotbzhSFkyKuL7wJIyz/Fx7jK1Src93BTto5fHI X-Received: by 2002:a62:c8c2:: with SMTP id i63-v6mr3071127pfk.73.1530375655735; Sat, 30 Jun 2018 09:20:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530375655; cv=none; d=google.com; s=arc-20160816; b=c3KBVbjuO1CHZoUDRSliaacxHNGkzLUcAzzmu+GwCl9QmdfW6HToLrQBNwjDXZ8vBr oUatGfDZlm2757ohTjIK9FGALMPoIPCjd2S/vaz8RjaeBBRvSiFM3UXJAYmUVnAwLtGy 99QdtkkcfQwPZuobdJ/0Jp3uw4Cpm6hk1c9+FHwq/aFVsZtvrr/UybrQ7huf0oEWvKFC x8AMispAFKhw5Z/s9gQCajsHWvpDiKoGV3C69ioFlJoVNdtrFuflIUcZxmFHwwztFLQM fRqmtfF6VI5w0IIY0RZK4tN42zSaD28jZvYvtc2Zx6yjEZ7XVBImf3epEAx8n10xrN4v PBNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=CZYYZYSWvfSyxGf+31QL5nyDvXIzm3ctA/PKotM1VUU=; b=XEM92++PIpLepAEQzfxQBB1rERfeG/8WZos0v846q0O5tR206g3Y0BBgXs2/KpxUab Zua/6wNNI5yUP2WDx2y2GQ5XZMmOihZyINMVKfKZtbYeTWdqBppncMiLIVq2Q+VMHbi9 XXMq6ZlBilXq0cD2vqPI2g+wzHon4tpNHXMajvSaTwPxpNpO0eW1+rfWeRWZQsdjBrxk A51hdtrQ6NdgedzV+Go2qbGElGqIAbu2W8Ag03a9Oklo1tdbcgA4/C7q6VfKd5ydL97W r2HzCwOPHAd+zysfC5aS7Dds4d4GD6coLxNifiHRvk5acGOEap/YLreyNDgTEhaya9TV B8Eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=enb6ASSV; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 78-v6si12501422pfb.204.2018.06.30.09.20.55; Sat, 30 Jun 2018 09:20:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=enb6ASSV; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751533AbeF3QUr (ORCPT + 9 others); Sat, 30 Jun 2018 12:20:47 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:38717 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751460AbeF3QUk (ORCPT ); Sat, 30 Jun 2018 12:20:40 -0400 Received: by mail-lj1-f194.google.com with SMTP id v15-v6so9564151ljk.5 for ; Sat, 30 Jun 2018 09:20:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=CZYYZYSWvfSyxGf+31QL5nyDvXIzm3ctA/PKotM1VUU=; b=enb6ASSVXOStKcjIkI+5xLQh0LS0eL3g2gtP3pXO35H51nR14vQVDuY/RQI3B+5mOl QkLedM8kul1a6Dirk3K7kSKwGmre5IXlpUu6k3W/HiQ5XfjEdsqTL1h6UB4Ih09mah89 2JiGKlV1bsWjTIDu8WQWBIzOmjCJRKhhATjpc= 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:in-reply-to :references; bh=CZYYZYSWvfSyxGf+31QL5nyDvXIzm3ctA/PKotM1VUU=; b=G0wTvdI7HTi+sOBGm9unORiTkUprgoZ97u7Uh8eeEQRJ0KGc9BDhyO3R8e3LWXnpHD d+UzH1VjNIFyPTIfszBax5uNVr8soLva77JQrRbQKRzX1jikCgyMgJXnRhYdYOLN2WaD nJyn83nYpGyhlWzz95qGHmjsrY5+rZInYI9cKNfCTK1PkRwu16tjilSmkXRSDWpw6mLG 1LgCbFpicqL7PtwNjquz2qotwYLwgFBFd/U+Mv0oiX9FpsTEtOSUAZyhh3ubEHfhTAPi zctAqhXJzzkPpwbMPM0RIhfxzH0DJ/vQiBEgxCVYK5KqY+7rrJ6QVpV/jpy3tJ5MDswj zJVg== X-Gm-Message-State: APt69E0t6W3NkDgb9qsavl0MKuDc08XQUUR1ulzVadI0f8r9ZrMZULY7 ZSo9QrhErQf8ZxDaGe2rxv6pvvFM2f4= X-Received: by 2002:a2e:1503:: with SMTP id s3-v6mr13275647ljd.65.1530375638689; Sat, 30 Jun 2018 09:20:38 -0700 (PDT) Received: from localhost.localdomain (c-ae7b71d5.014-348-6c756e10.bbcust.telenor.se. [213.113.123.174]) by smtp.gmail.com with ESMTPSA id 93-v6sm2271978lfy.64.2018.06.30.09.20.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 30 Jun 2018 09:20:37 -0700 (PDT) From: Linus Walleij To: netdev@vger.kernel.org, "David S . Miller" , =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Cc: Janos Laube , Paulius Zaleckas , linux-arm-kernel@lists.infradead.org, Hans Ulli Kroll , Florian Fainelli , Linus Walleij Subject: [PATCH net-next 5/5] net: gemini: Indicate that we can handle jumboframes Date: Sat, 30 Jun 2018 18:18:06 +0200 Message-Id: <20180630161806.24312-5-linus.walleij@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180630161806.24312-1-linus.walleij@linaro.org> References: <20180630161806.24312-1-linus.walleij@linaro.org> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The hardware supposedly handles frames up to 10236 bytes and implements .ndo_change_mtu() so accept 10236 minus the ethernet header for a VLAN tagged frame on the netdevices. Signed-off-by: Linus Walleij --- drivers/net/ethernet/cortina/gemini.c | 5 +++++ 1 file changed, 5 insertions(+) -- 2.17.1 diff --git a/drivers/net/ethernet/cortina/gemini.c b/drivers/net/ethernet/cortina/gemini.c index 79324bbfd768..ae475393e4ac 100644 --- a/drivers/net/ethernet/cortina/gemini.c +++ b/drivers/net/ethernet/cortina/gemini.c @@ -2473,6 +2473,11 @@ static int gemini_ethernet_port_probe(struct platform_device *pdev) netdev->hw_features = GMAC_OFFLOAD_FEATURES; netdev->features |= GMAC_OFFLOAD_FEATURES | NETIF_F_GRO; + /* We can handle jumbo frames up to 10236 bytes so, let's accept + * payloads of 10236 bytes minus VLAN and ethernet header + */ + netdev->min_mtu = 256; + netdev->max_mtu = 10236 - VLAN_ETH_HLEN; port->freeq_refill = 0; netif_napi_add(netdev, &port->napi, gmac_napi_poll,