Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3572602pxb; Mon, 24 Jan 2022 12:32:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJwqnhZUVDRuxjrxbek/ps5xiOyYpnTiAm9fi61vmgQpMGSS1T6O7hSSBmWKzoHlqKHaqDcu X-Received: by 2002:a17:90a:3e4c:: with SMTP id t12mr3420898pjm.175.1643056319832; Mon, 24 Jan 2022 12:31:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643056319; cv=none; d=google.com; s=arc-20160816; b=Qes/R0wJLS3ieiBEF34ebntC7dxBO9dgA3HpT7NWCxlhVmUuvoSDWWFmh96pXELKSU QKK+plQ6raof8LjNoop8yVaiFxQsw0G0yB4mNXKHe5QWmX2dzBzQfkrDCw33DKl25A6H ov3TADlhADvZsQTqcO73QMKIPm5nG1Qw75s8XQgDMj5VGHNmgnKJcqC49kc5C1bSa3uA lPmoSe7iCZtPTBh5r1bwvN1IxxAbLbnvM9dnufb3E1z/68HlFjKOH7h6nDAmCutt+3A0 8uid5Nf6HWlTBCQ+eL9eKXCSGmsVHrbFr3v76iGDk1e2WtQlQjiy1XOCJMydCdlzppgt QOqQ== 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=6fZ0sIpsVk8UJYX6Ezj3+veFcxPhP8x65edauxHxh7U=; b=q2PBnp84swlMJF7X8YFROxHTccQy8mhvghcPKATgIdDpZwBfSUobUL4chyFDSettt2 KeWT6WHbU1LTIjs60vPUEr3ywiUPsOW98N+pBj27uhIOBlnvPm22k5Br99phbX4ani86 hsrIi2nZ5o/JQgCrnh9mhfQlDjt5FbmBqSwMNPFvVXPdeTuCwYZ1DedjcXl5iRWKXG6J jccH/rRugW4R1kS4quw7/ZeamrmYv7Yon3l3qaX8HDSHzSl0pp0zTd3HV2CG/Y5Xpkih ap6IhN2NZaJ+BxlYiLN7j0p+wJvFo6MMjb35yKc6KuEwRTYtemZy4m+9Tdx8aMpE2k0r GCCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eaT2bYcJ; 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 bc2si13078430plb.349.2022.01.24.12.31.45; Mon, 24 Jan 2022 12:31:59 -0800 (PST) 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=eaT2bYcJ; 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 S1354177AbiAXTjS (ORCPT + 99 others); Mon, 24 Jan 2022 14:39:18 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:56438 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353222AbiAXTdd (ORCPT ); Mon, 24 Jan 2022 14:33:33 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 0FF84B811FB; Mon, 24 Jan 2022 19:33:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 29B2AC340E5; Mon, 24 Jan 2022 19:33:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643052810; bh=z3KHjrtjkrAJ1l60+JVSkvpB2u2zxdDMwLh9FzYWkM8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eaT2bYcJPpqC4kXQPUSVMzK5zNTwDVesxhNLr4dm1ZEV/ob+7bsIO1BBCypGGWCLO py8fYe2WwjLjAB5rMvK7QByA1B06mPenxald7olN2nwRf7LJIXRmjx4WMNKnf8aUjW rTkJlfggZ34iAsA0FCzAd2WFq2mtDBs4aQPvUaSM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tom Lendacky , "Russell King (Oracle)" , Andrew Lunn , Florian Fainelli , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.4 182/320] net: phy: prefer 1000baseT over 1000baseKX Date: Mon, 24 Jan 2022 19:42:46 +0100 Message-Id: <20220124183959.854124738@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183953.750177707@linuxfoundation.org> References: <20220124183953.750177707@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: Russell King (Oracle) [ Upstream commit f20f94f7f52c4685c81754f489ffcc72186e8bdb ] The PHY settings table is supposed to be sorted by descending match priority - in other words, earlier entries are preferred over later entries. The order of 1000baseKX/Full and 1000baseT/Full is such that we prefer 1000baseKX/Full over 1000baseT/Full, but 1000baseKX/Full is a lot rarer than 1000baseT/Full, and thus is much less likely to be preferred. This causes phylink problems - it means a fixed link specifying a speed of 1G and full duplex gets an ethtool linkmode of 1000baseKX/Full rather than 1000baseT/Full as would be expected - and since we offer userspace a software emulation of a conventional copper PHY, we want to offer copper modes in preference to anything else. However, we do still want to allow the rarer modes as well. Hence, let's reorder these two modes to prefer copper. Tested-by: Tom Lendacky Signed-off-by: Russell King (Oracle) Reviewed-by: Andrew Lunn Reported-by: Florian Fainelli Link: https://lore.kernel.org/r/E1muvFO-00F6jY-1K@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/phy/phy-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/phy/phy-core.c b/drivers/net/phy/phy-core.c index 9412669b579c7..84064120918f0 100644 --- a/drivers/net/phy/phy-core.c +++ b/drivers/net/phy/phy-core.c @@ -128,11 +128,11 @@ static const struct phy_setting settings[] = { PHY_SETTING( 2500, FULL, 2500baseT_Full ), PHY_SETTING( 2500, FULL, 2500baseX_Full ), /* 1G */ - PHY_SETTING( 1000, FULL, 1000baseKX_Full ), PHY_SETTING( 1000, FULL, 1000baseT_Full ), PHY_SETTING( 1000, HALF, 1000baseT_Half ), PHY_SETTING( 1000, FULL, 1000baseT1_Full ), PHY_SETTING( 1000, FULL, 1000baseX_Full ), + PHY_SETTING( 1000, FULL, 1000baseKX_Full ), /* 100M */ PHY_SETTING( 100, FULL, 100baseT_Full ), PHY_SETTING( 100, FULL, 100baseT1_Full ), -- 2.34.1