Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3708196pxb; Mon, 24 Jan 2022 15:59:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJw4LFh2G1JsTw0UKziifqdB30qowbgHVFZvfmQg3GKLPv5AV+yByVERjtgO9G7PiRs8hXyu X-Received: by 2002:a17:90b:2248:: with SMTP id hk8mr710772pjb.242.1643068761675; Mon, 24 Jan 2022 15:59:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643068761; cv=none; d=google.com; s=arc-20160816; b=XefSTLl4U6ZJWytfrQ+L9Nnnm/I/3lbajeKcpIiCessirdsUE5VfrUDZeyDiP8syrE UwK0wD4phAtBQ6UeIamtRwSvPybgRLOi2nDZB75tqVNNJW6PcfmtuEWEsmhOeDrQLnik qkDoubHE7ZaViGWOPxQrPpbVZplaUsME5YPreRwGOtjVfGawjBITyj9lq5IU65ZGgThi G1B5RGv3lu4pCYxkxa605i6iDj8JyNSdhP3D9Kc4RgAnx0exkwMz+yHjQ4MhYvW1e0do a4MjgvhR72GuB71bJgdVbdgH6M9o6XvHVZfircLdcdTpxitDR9UWVmdQzVvfJmCj8X1w 6Duw== 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=QLs7i9IEEE3MlLWtUyitgd7sJHaENcp7qPbD2gNHVts=; b=V6ccShUZt5iIihnTlqtnrJ1QcV4vAarm0YGoB43NCbCKyFY8n9+dd2G2/gsxlecyUL DoOo1bov0NEmcvoUjvkbEwOS2sftoRRG9ZTYO0kx6DUQSug4MZYfp8MzBTg7ZcBBHWZu 15llf6UzaIpSpnkV7hhcASTnqFolULx7Ywdt3O5uL6DJJ8z6nOhhRqyQ/IhxqOG3RPKL aCjMXXvBOdP4ZTRVX52nx6JBqeMiZm+6LTPxgeK09MYaPG5uLQdBdqUUkdk2QU9vXVLx CwmSpwirkYGdy5o+jIsBwYQGVIvGspD6fGgb0MxrLHIVgb0NvkmWZgoYLOeviASnr6s4 /yQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NL7fR9vJ; 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 q7si250914pfs.281.2022.01.24.15.59.10; Mon, 24 Jan 2022 15:59:21 -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=NL7fR9vJ; 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 S2367650AbiAXX4G (ORCPT + 99 others); Mon, 24 Jan 2022 18:56:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1846497AbiAXXQH (ORCPT ); Mon, 24 Jan 2022 18:16:07 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0C42C0604E3; Mon, 24 Jan 2022 13:24:49 -0800 (PST) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 8FF4C614D9; Mon, 24 Jan 2022 21:24:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 67789C340E4; Mon, 24 Jan 2022 21:24:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643059489; bh=cIVsYXY5t94PiqfXWViR/Oi0njjK/oBXtpCVnbK2xrY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NL7fR9vJdIXDgEWKVO4GGU+Wb7F0dVDYpLT59bk88oVWpFMmBJFgZOwZC5aGCpaaN 5aRkCkEdvQTWAnIClYMCzBUqPae3dInm0ISmfZbIKNWgN+QpnuvQDdNG7zfKI9ehx8 kkd3f9hOFlZqybT1CjcwAMKaUSP5Vr5SVBM1QDeE= 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.16 0633/1039] net: phy: prefer 1000baseT over 1000baseKX Date: Mon, 24 Jan 2022 19:40:22 +0100 Message-Id: <20220124184146.628391804@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@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 2870c33b8975d..271fc01f7f7fd 100644 --- a/drivers/net/phy/phy-core.c +++ b/drivers/net/phy/phy-core.c @@ -162,11 +162,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