Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp1049745rdg; Fri, 13 Oct 2023 08:48:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH/SbM9SBNBtY+E9hmoa91acy56nwzGwjfsQiZnV8V/aqMFyaifIJeukQ5HGhpZgSBCBvhl X-Received: by 2002:a17:90a:f008:b0:27d:af4:c8b with SMTP id bt8-20020a17090af00800b0027d0af40c8bmr7200210pjb.36.1697212092524; Fri, 13 Oct 2023 08:48:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697212092; cv=none; d=google.com; s=arc-20160816; b=SjujC1NzdtJO4S3AOpWgZfiED/fJozpkRhDbkMIFl9h99HQWcC3wyxPUrDgw54u5hH Ud4w+YMPGdCGR6TadekJ0opIoD35qwJjUkZbWEs7zyB16b/AZCQNuaoM1dZpG4dV+3kg eYCg01zQd0oJKYYLhlswbVVF2MAixKWIRr83ckZ8OtDhU1rn5BzmDeNLhFGWUQ8st9h5 fwygBPtMSxpZqbALUG6iXl/HxaLsQFcQpd8Xj3W86B881W3Tv1EA0DFmzYErnGaTFRY+ NC/m6MVfodjADfzWQ3+tmjIG2d8OHLjGnqIcoRqAnb6wtsbqSNt5T+/JLuGUk44WEs9l P7Uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=5lfs0q9obOeHMCxah/eKAu+kKfYDZlaOswG1jDYdyXw=; fh=P2qovqNuC/PWky+IwRC+Tf8EWQo7eFBqbiQ/DvqZUyU=; b=XXO9hYBNTHX39r69DhfccQugLQINQGinsqod1Gjkdl7ARsW3HsuuXccixsVresB9JL KNaUOXdYockzq6lyvFWlWxIRCUXwkgAeiWd/gVQqnY56gNEet/VKIOqGDhHq+yMXYa+B /TuTdYMyuoEqcfmJistNovXaT+rvS77FEO0oxVjd0kCH99mslmYPo8qpMBnNy5gdcZ+b 7y/TRwcuiPOH1u06w0n7K75ZCDPUOu9w4A6dl7jhJCsCpg+zzx34u8BXOBtXepNUCMca 7emefcfcxaJWkY6yIF3pxOxw4+IXIpT8scQ/yFwmyRUI4V7x9mfbcfIXfE1ja3aQ8EUW IakA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JkWOrR98; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id gz9-20020a17090b0ec900b0027d0e78a0b3si306100pjb.190.2023.10.13.08.48.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 08:48:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JkWOrR98; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 77CCD8030B97; Fri, 13 Oct 2023 08:48:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232441AbjJMPsH (ORCPT + 99 others); Fri, 13 Oct 2023 11:48:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232372AbjJMPsG (ORCPT ); Fri, 13 Oct 2023 11:48:06 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8606BB for ; Fri, 13 Oct 2023 08:48:05 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC20AC433C7; Fri, 13 Oct 2023 15:48:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697212085; bh=U1YKFSXY08tJibk9UQhz6q54OPcpF6fXz3U2EjQSuK0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=JkWOrR9826ylpMuzJMiAyn0/eOUE38ZcixBepBRBTMBoE4e//5ma1fRX1ha14UIn8 eIbMe3RrWdLUTkTZMkvbIxyPP4mLU1ZoZl8JAxgJxjOdoZ4bvs/07wm8IZs6VO9w9F ZJO9o+pEAt9L2/xWfMnGh4f/6mGQ6vGdzJkd+k6WW/hBRHrmJtzKyi1wfer+Z3HERu ahy3e7eJweHhEFcp8Nw4U9c2MYhZWnaKciOlsZaZb75zi0G64SXKXgQGdo4xB9C2DA NMpFStVO1OJr3Li5xce9AFLJfjNSXwib9wFtroWGY7fY+ACSXvlmGIT74wfzAVSiMD 5qTlH4hR+0vhg== Date: Fri, 13 Oct 2023 17:48:00 +0200 From: Simon Horman To: Oleksij Rempel Cc: Woojung Huh , UNGLinuxDriver@microchip.com, Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Heiner Kallweit , kernel@pengutronix.de, linux-kernel@vger.kernel.org, Russell King , netdev@vger.kernel.org Subject: Re: [PATCH net-next v1 3/3] net: phy: micrel: Fix forced link mode for KSZ886X switches Message-ID: <20231013154800.GQ29570@kernel.org> References: <20231011123856.1443308-1-o.rempel@pengutronix.de> <20231011123856.1443308-3-o.rempel@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231011123856.1443308-3-o.rempel@pengutronix.de> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 13 Oct 2023 08:48:11 -0700 (PDT) On Wed, Oct 11, 2023 at 02:38:56PM +0200, Oleksij Rempel wrote: > Address a link speed detection issue in KSZ886X PHY driver when in > forced link mode. Previously, link partners like "ASIX AX88772B" > with KSZ8873 could fall back to 10Mbit instead of configured 100Mbit. > > The issue arises as KSZ886X PHY continues sending Fast Link Pulses (FLPs) > even with autonegotiation off, misleading link partners in autoneg mode, > leading to incorrect link speed detection. > > Now, when autonegotiation is disabled, the driver sets the link state > forcefully using KSZ886X_CTRL_FORCE_LINK bit. This action, beyond just > disabling autonegotiation, makes the PHY state more reliably detected by > link partners using parallel detection, thus fixing the link speed > misconfiguration. > > With autonegotiation enabled, link state is not forced, allowing proper > autonegotiation process participation. > > Signed-off-by: Oleksij Rempel > --- > drivers/net/phy/micrel.c | 32 +++++++++++++++++++++++++++++--- > 1 file changed, 29 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c > index 927d3d54658e..12f093aed4ff 100644 > --- a/drivers/net/phy/micrel.c > +++ b/drivers/net/phy/micrel.c > @@ -1729,9 +1729,35 @@ static int ksz886x_config_aneg(struct phy_device *phydev) > { > int ret; > > - ret = genphy_config_aneg(phydev); > - if (ret) > - return ret; > + if (phydev->autoneg != AUTONEG_ENABLE) { > + ret = genphy_setup_forced(phydev); > + if (ret) > + return ret; > + > + /* When autonegotation is disabled, we need to manually force nit: autonegotiation > + * the link state. If we don't do this, the PHY will keep > + * sending Fast Link Pulses (FLPs) which are part of the > + * autonegotiation process. This is not desired when > + * autonegotiation is off. > + */ ...