Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3697492ybv; Mon, 10 Feb 2020 04:55:12 -0800 (PST) X-Google-Smtp-Source: APXvYqxx+9kG1O86zsubSw7ix8aCjVknG8kpqoX2kiN3dQdYHf3QRz0DsZq6sxoLfkFnEuI5cHrn X-Received: by 2002:a54:4f16:: with SMTP id e22mr745936oiy.170.1581339312081; Mon, 10 Feb 2020 04:55:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581339312; cv=none; d=google.com; s=arc-20160816; b=sv1LggKBDZ0p9KkrjzDtq+oKEKaSD/PW16gCW4VUIEPVPomMSeif/Eg3l2JQh5MPzg H8Nc5b53ptKOjKEv5v8SSrXcT25cmn2tx208ZUDrZptF8sCxt2GJ27VbYeIAH55ED+4G 36rOKo8+0803l/223G11Z9YfmXaUdTB2O88Szdx9zMj4OKvR6c4hLzgKtXClM5QPbOY6 m4p949KxLqbMm64boYOHbHCpV4H1NTxnz2vVXkpIAKLllqGwW74TrKnzfwUPEo3N5JHh x7QeZaHtpBBTeP0FmG00tui+62X9gEcLF9B31Cmjl7ZkP7sqvKuaikQcEMJg+ZKfqgti cQwA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kG4OXonhmt5Lw4rgN38rCNhqQKUFuTLeZnr0rnqNnoI=; b=kyOu9VWb7FSHncui8Rx5TfKPf3soyD4/xBmG1RKgiTO1M8DacFVnwHP+BCug8qnkvJ fkemdQmYFmUCFWfjFksLl6fvfMLioZCGIG3JljYLSC12YYZwYC2DeYJnDn6UMiHnz2Xj nz+9OIrhliCEIUeGg3Hp/t+LJsFZF0EXStALXuQ/tupkowWIdFmtzdvxeaAOk9qpq9uo IsZcckj8Rg6WbFpe+6UIkTojnw1Df7+fkeNH6ZGMeFuGf9y3U19V1NHiLTT1Ot76AEAp KVaIPbZP40uJUc/Ps88mJk/ztgbufOeWjcGmO8Epqnge2gPa3fSev4xI33nO6c6X4L06 Eytg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Izg4tnh/"; 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 8si126197oix.109.2020.02.10.04.55.00; Mon, 10 Feb 2020 04:55:12 -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; dkim=pass header.i=@kernel.org header.s=default header.b="Izg4tnh/"; 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 S1729809AbgBJMy7 (ORCPT + 99 others); Mon, 10 Feb 2020 07:54:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:45112 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730085AbgBJMlw (ORCPT ); Mon, 10 Feb 2020 07:41:52 -0500 Received: from localhost (unknown [209.37.97.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 571C824689; Mon, 10 Feb 2020 12:41:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581338512; bh=Cof/ryjipZLZJWwo3NkGu0eHENrK05FEJFK/2jefe8o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Izg4tnh/ARaTho6p9CygZCeO9N9zhfp2AuJrKWQ8Iyf7xJqdSS07JcSKrC39QQtcd eVzKu4I8sWJKZuOAJDHLiA6+cthlJhK6j6JPD59PMWPFPeKcdOQ3gBYyiOqWcl//0y wfJI9rBH63vDXWLxsHsCU+mgP97gZAuzyko6swAU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mian Yousaf Kaukab , Madalin Bucur , Andrew Lunn , "David S. Miller" Subject: [PATCH 5.5 318/367] dpaa_eth: support all modes with rate adapting PHYs Date: Mon, 10 Feb 2020 04:33:51 -0800 Message-Id: <20200210122452.470668520@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200210122423.695146547@linuxfoundation.org> References: <20200210122423.695146547@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Madalin Bucur [ Upstream commit 73a21fa817f0cc8022dc6226250a86bca727a56d ] Stop removing modes that are not supported on the system interface when the connected PHY is capable of rate adaptation. This addresses an issue with the LS1046ARDB board 10G interface no longer working with an 1G link partner after autonegotiation support was added for the Aquantia PHY on board in commit 09c4c57f7bc4 ("net: phy: aquantia: add support for auto-negotiation configuration") Before this commit the values advertised by the PHY were not influenced by the dpaa_eth driver removal of system-side unsupported modes as the aqr_config_aneg() was basically a no-op. After this commit, the modes removed by the dpaa_eth driver were no longer advertised thus autonegotiation with 1G link partners failed. Reported-by: Mian Yousaf Kaukab Signed-off-by: Madalin Bucur Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c @@ -2453,6 +2453,9 @@ static void dpaa_adjust_link(struct net_ mac_dev->adjust_link(mac_dev); } +/* The Aquantia PHYs are capable of performing rate adaptation */ +#define PHY_VEND_AQUANTIA 0x03a1b400 + static int dpaa_phy_init(struct net_device *net_dev) { __ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, }; @@ -2471,9 +2474,14 @@ static int dpaa_phy_init(struct net_devi return -ENODEV; } - /* Remove any features not supported by the controller */ - ethtool_convert_legacy_u32_to_link_mode(mask, mac_dev->if_support); - linkmode_and(phy_dev->supported, phy_dev->supported, mask); + /* Unless the PHY is capable of rate adaptation */ + if (mac_dev->phy_if != PHY_INTERFACE_MODE_XGMII || + ((phy_dev->drv->phy_id & GENMASK(31, 10)) != PHY_VEND_AQUANTIA)) { + /* remove any features not supported by the controller */ + ethtool_convert_legacy_u32_to_link_mode(mask, + mac_dev->if_support); + linkmode_and(phy_dev->supported, phy_dev->supported, mask); + } phy_support_asym_pause(phy_dev);