Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78820C433EF for ; Mon, 13 Jun 2022 17:36:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241738AbiFMRgw (ORCPT ); Mon, 13 Jun 2022 13:36:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241900AbiFMRe7 (ORCPT ); Mon, 13 Jun 2022 13:34:59 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1ABE235A9F for ; Mon, 13 Jun 2022 06:00:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=BfeQeEaR3dnIoWFf03tFG4sJ+0A700KaJng35c36mlY=; b=FIGjUdn95ts0nod8HSyYTS/nbJ A/3GYQ4myl/4iB/BuUl0FICA3OjxdEvzrAeN5zoG0JhiyNYohQ9HUh00hUQnj0AQoI1PP64Op2BaT KCM+F+9BQILwFreB+LiEAs50S0Cdhn9UYiL4OTZr9HxaHIx64cJQq6Bijv5yL112nicOVmcdNrymm 0doHt7qm1XnJoEyUkDFa3zyGPiyA3NFxtQ2YFMQlD9V0MIhEpNUNgp7Wl/OZtYATK65LH9of2hup9 XqoOBO/AMYfOzDjTRzIXCjSUJ71CvPSW0yJ7wLKtUWB0RG7j5TEFcl+nQ+rghLZLxXqf9l/7KQthg igIVx9zg==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:52076 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1o0jgA-0001qN-Js; Mon, 13 Jun 2022 14:00:26 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1o0jg9-000JY6-Vx; Mon, 13 Jun 2022 14:00:26 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Marek =?iso-8859-1?Q?Beh=FAn?= Cc: "David S. Miller" , Eric Dumazet , Florian Fainelli , Heiner Kallweit , Jakub Kicinski , netdev@vger.kernel.org, Paolo Abeni , Robert Hancock , Vivien Didelot , Vladimir Oltean Subject: [PATCH net-next 01/15] net: phylink: fix SGMII inband autoneg enable MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" Message-Id: Sender: Russell King Date: Mon, 13 Jun 2022 14:00:25 +0100 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org When we are operating in SGMII inband mode, it implies that there is a PHY connected, and the ethtool advertisement for autoneg applies to the PHY, not the SGMII link. When in 1000base-X mode, then this applies to the 802.3z link and needs to be applied to the PCS. Fix this. Fixes: 92817dad7dcb ("net: phylink: Support disabling autonegotiation for PCS") Signed-off-by: Russell King (Oracle) --- drivers/net/phy/phylink.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index 066684b80919..5bc58e50e318 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -3030,7 +3030,9 @@ int phylink_mii_c22_pcs_config(struct mdio_device *pcs, unsigned int mode, /* Ensure ISOLATE bit is disabled */ if (mode == MLO_AN_INBAND && - linkmode_test_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, advertising)) + (interface == PHY_INTERFACE_MODE_SGMII || + interface == PHY_INTERFACE_MODE_QSGMII || + linkmode_test_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, advertising))) bmcr = BMCR_ANENABLE; else bmcr = 0; -- 2.30.2