Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp672635imp; Thu, 21 Feb 2019 08:55:26 -0800 (PST) X-Google-Smtp-Source: AHgI3IYONOj3Lro1cfeTkQ50inKJNN7QwtH/50YTeLKcHRuOLIdD2mumQFJixqUhEoY0f9Pbx7s/ X-Received: by 2002:a63:fd07:: with SMTP id d7mr34608870pgh.163.1550768126674; Thu, 21 Feb 2019 08:55:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550768126; cv=none; d=google.com; s=arc-20160816; b=Be+6kbo+1OeJZhZE/B5yuIMJuCFf71G7WgT5jCdw8qyro4g4kHiWQuSoCWYPSmyQiL WZ0wurO627baFce6LT6fuHEhtW1HXheGRb0PxNomjIZyYddWT8bGbQaLb0cnjCSIxafg vfUeNxfiJPK4Cd25kyE4eDN0MYtizRZqLUdlONpSZreAXTW+jB7oW+zh8i0sCOEcX33b A8lqNJHrvPHjsHYYuut7yxVMPSLJiahwzPSxlCd2MyxT2QZKp8Oj2LEVeSI+zmp1mpNR rDwmoMvzbqMCvcNcRB1rvVfBy53MuhEwZTqFM+DPtXP/PlHVfY2KFhRNq4myrUbI6KkB IXZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=0cIn/833eYp0l6xX1dVBsFQJFHiO0tu2YM/Dqi8cxHA=; b=Qg+xa/bm/rlTVwwZfqxh1EuwfaFV9+N4HR0+jJibjoRzXHEzP+SoSdWph2760AeEnu aKYPiaDKLFsiQegMyz9gAqjEjOCG+34B7KxqrXq8bEmBUL/9MLVMxguGH2+LOlgRkaoU zTRMJFK/Cqe7RiQQicEZHa81B3f33m44VB7cvPV1FUyFEFNBYyw9nmGyH1rrM+jrzzEF 4vXZypxAMjIU8ogiTY0yB7ARs9xItB5B02iv9zEChHorBAV9dXAc2pBoV3nNb7Qjfg3h V/Go28d0vEDgVxDoQUZc+FtRo8er4iKRdiMCZXYj4aQYqzA51gTi5IqtQQd7bLMDiU9J stBA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a19si6770678plm.128.2019.02.21.08.55.11; Thu, 21 Feb 2019 08:55:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728131AbfBUQye (ORCPT + 99 others); Thu, 21 Feb 2019 11:54:34 -0500 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:58777 "EHLO relay7-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725767AbfBUQye (ORCPT ); Thu, 21 Feb 2019 11:54:34 -0500 X-Originating-IP: 90.88.23.190 Received: from mc-bl-xps13.lan (aaubervilliers-681-1-81-190.w90-88.abo.wanadoo.fr [90.88.23.190]) (Authenticated sender: maxime.chevallier@bootlin.com) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 8F0102000F; Thu, 21 Feb 2019 16:54:29 +0000 (UTC) From: Maxime Chevallier To: davem@davemloft.net Cc: Maxime Chevallier , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Lunn , Florian Fainelli , Heiner Kallweit , Russell King , linux-arm-kernel@lists.infradead.org, Antoine Tenart , thomas.petazzoni@bootlin.com Subject: [PATCH net] net: phy: marvell10g: Fix Multi-G advertisement to only advertise 10G Date: Thu, 21 Feb 2019 17:54:11 +0100 Message-Id: <20190221165411.9739-1-maxime.chevallier@bootlin.com> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some Marvell Alaska PHYs support 2.5G, 5G and 10G BaseT links. Their default behaviour is to advertise all of these modes, but at the moment, only 10GBaseT is supported. To prevent link partners from establishing link at that speed, clear these modes upon configuring aneg parameters. Fixes: 20b2af32ff3f ("net: phy: add Marvell Alaska X 88X3310 10Gigabit PHY support") Signed-off-by: Maxime Chevallier Reported-by: Russell King --- Dave, This patch will conflict when merging net into net-next, and is actually not needed there. In net-next, this issue is fixed by the recent work done by Andrew and Heiner, that introduce more generic ways to handle aneg configuration for C45 PHYs. The commit fixing this would be : 3de97f3c6308 ("net: phy: marvell10g: use genphy_c45_an_config_aneg") However this fix should be backported, hence why it was implemented in a small standalone patch here. Please tell me if you have any issue with this. Thanks, Maxime drivers/net/phy/marvell10g.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c index 82ab6ed3b74e..6bac602094bd 100644 --- a/drivers/net/phy/marvell10g.c +++ b/drivers/net/phy/marvell10g.c @@ -26,6 +26,8 @@ #include #include +#define MDIO_AN_10GBT_CTRL_ADV_NBT_MASK 0x01e0 + enum { MV_PCS_BASE_T = 0x0000, MV_PCS_BASE_R = 0x1000, @@ -386,8 +388,10 @@ static int mv3310_config_aneg(struct phy_device *phydev) else reg = 0; + /* Make sure we clear unsupported 2.5G/5G advertising */ ret = mv3310_modify(phydev, MDIO_MMD_AN, MDIO_AN_10GBT_CTRL, - MDIO_AN_10GBT_CTRL_ADV10G, reg); + MDIO_AN_10GBT_CTRL_ADV10G | + MDIO_AN_10GBT_CTRL_ADV_NBT_MASK, reg); if (ret < 0) return ret; if (ret > 0) -- 2.19.2