Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3389369pxb; Mon, 17 Jan 2022 19:23:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJzg4rig6PN9b/eKrCDt10wx5mLvSUMWbF+MDYTZ3in92skTxVqaKULpfv2H+9ghsaG3lS3A X-Received: by 2002:a17:903:1c2:b0:14a:586c:134f with SMTP id e2-20020a17090301c200b0014a586c134fmr26561484plh.14.1642476199810; Mon, 17 Jan 2022 19:23:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642476199; cv=none; d=google.com; s=arc-20160816; b=gjmfYapHJi0ygalHHxlvuU/tJzkrnqN8z6CM1TnmkOq/sygDKPVHcSLmZxpQ4/E7zs Yguwdfs2yvQRIIzSFijYYxccIkakvCm1a1ZE7qsuaMGo/9IXgfvNx7UaI4JLvv4f+mBx EAncEvz2Jk4uvoGBf7dCT/ojlpoQQFAO5AEjt+rYM4jgO6s30V6ayKpbIMA7VU/w8EYK P91ZNdnC0aI91mFa10nzTDObDL9mDJfs2GT60tp4PeZL845fuaNKjaz49HwzkOuzXUqg HJodpqxFPRh3pgoVNZpTKBDGwINEE4KmahMgOav0TJsqB8NjDun+TYffoU5UUoo2H486 DmDQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=njcyHRnGktudcaYth6CaN9Emg8dgJckdIS0ZM/FS708=; b=s0gum2vqDTt9S24Fc9h8DXDR0iz4+g4A20hDBYc0lahClkImCS44URIY24Rt8csaqn cD+qkj4+tXpPctRBIqILjg8alDdwSHffxIZ/Uh4HETPOFcb/LPX6qevekguquphbhJ2Q GkiM1nF5HOWKGg1oBG/JEJaq3qxuF+DqQrHrKs/ztdEtFuoZt5p14qRBVbNCsI7asFYm EfpxCJgAA/Dn/mJqhWkuUt7WlbeHaitEcgNOkdy2wB4/SgXnrnoRFfZIzA0/0uZi2Je/ 0pC27mRBg9cetupN/GN3+qpMOXTZwc2H4O6xdMv9ndBs3uEHABZ8I8+rdnhDgyNR3ayc mKHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VtVdCi6g; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a15si15373076pfa.226.2022.01.17.19.23.08; Mon, 17 Jan 2022 19:23:19 -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=@kernel.org header.s=k20201202 header.b=VtVdCi6g; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345747AbiARCb7 (ORCPT + 99 others); Mon, 17 Jan 2022 21:31:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343822AbiARC1S (ORCPT ); Mon, 17 Jan 2022 21:27:18 -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 9065AC0617A9; Mon, 17 Jan 2022 18:25:25 -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 23A6C60C95; Tue, 18 Jan 2022 02:25:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 581A8C36AF3; Tue, 18 Jan 2022 02:25:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1642472724; bh=oApYUgwpm7sP2/MB1uTCxP0eGg8ajqHEVrPO6uprhBs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VtVdCi6gSpop6JYiTTJ1Dvaz5vz1qu0AmcJJkq5YflZ6MrWpll09yBz3aSRRffQSi a9N/evatoJXdch1VykBewuxPj1qejARbkoq6iNa4EP2Y79ft6NChVfPH5b0HAGa/ge PsmUVf9neCbEUtboC6uDeHgZyF3eH0Bxkun77w5+C7AJGzfqiEk18PyYPTtpMrDX2V WqgHxzybbUFlZBOLL8+RYOZyV65lvTg10tmXFNoyiroJotiyWKr7MSLs3LCUtODJYV cWgyN8B1lXoiL+HjMyrkGTXVq2BH1bPt9+LNr/uyXO8TDoKW+146v9DABNto9AidE4 4WAnLW8lD4JRA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: "Russell King (Oracle)" , Tom Lendacky , Andrew Lunn , Florian Fainelli , Jakub Kicinski , Sasha Levin , hkallweit1@gmail.com, davem@davemloft.net, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.16 114/217] net: phy: prefer 1000baseT over 1000baseKX Date: Mon, 17 Jan 2022 21:17:57 -0500 Message-Id: <20220118021940.1942199-114-sashal@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220118021940.1942199-1-sashal@kernel.org> References: <20220118021940.1942199-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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