From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DF567137B for ; Sat, 13 May 2023 09:24:19 +0000 (UTC) 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 81CB3448A for ; Sat, 13 May 2023 02:24:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding: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=XVh8KT9gVBykDIb1/H0Lx91tru6ENRaXWSfNY5scpLw=; b=ULaLP4WVTvp3xqw5S9/DZpOhGg k78QwHicUmyKSk3wyiVD9ylMk0D7L0odUvTyR8oatnle9bgtpnirIBZtnbZimTxCLfO29xuc/x0OU B/ENMWUpQySBiy4m1hJPx8ERt8lOGnGBjnIwHMb0pN6V7DMjC7LpDRyiOCtNnuub7UkoKwq7qPLYD bng2648049SGkdeWXdXHvEdBfbndfOqbkXXkeCAe/RdvXHMSsNmxJpBXWwGVg+NVuz2/IfetE0X+H gqX0PtUBfAwn9YyOBuTh5rVltozfJaPCLKrnac5BEgFiE59gk/5kCM8NontaFMmVDJvXESTk0ITkE MdYYF2pw==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:48936) 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 1pxlU1-0001AI-76; Sat, 13 May 2023 10:24:09 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1pxlTy-0005zE-FT; Sat, 13 May 2023 10:24:06 +0100 Date: Sat, 13 May 2023 10:24:06 +0100 From: "Russell King (Oracle)" To: Andrew Lunn Cc: Jose Abreu , "David S. Miller" , Eric Dumazet , Heiner Kallweit , Jakub Kicinski , netdev@vger.kernel.org, Paolo Abeni Subject: Re: [PATCH RFC net-next 3/9] net: phylink: add function to resolve clause 73 negotiation Message-ID: References: <7cec3e9f-e614-43b4-abe9-c423d5f63563@lunn.ch> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7cec3e9f-e614-43b4-abe9-c423d5f63563@lunn.ch> Sender: Russell King (Oracle) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net On Sat, May 13, 2023 at 01:57:46AM +0200, Andrew Lunn wrote: > > +void phylink_resolve_c73(struct phylink_link_state *state) > > +{ > > + int i; > > + > > + for (i = 0; i < ARRAY_SIZE(phylink_c73_priority_resolution); i++) { > > + int bit = phylink_c73_priority_resolution[i].bit; > > + if (linkmode_test_bit(bit, state->advertising) && > > + linkmode_test_bit(bit, state->lp_advertising)) > > + break; > > + } > > + > > + if (i < ARRAY_SIZE(phylink_c73_priority_resolution)) { > > + state->speed = phylink_c73_priority_resolution[i].speed; > > + state->duplex = DUPLEX_FULL; > > + } else { > > + /* negotiation failure */ > > + state->link = false; > > + } > > Hi Russell > > This looks asymmetric in that state->link is not set true if a > resolution is found. > > Can that set be moved here? Or are there other conditions which also > need to be fulfilled before it is set? It's intentionally so because it's a failure case. In theory, the PHY shouldn't report link-up if the C73 priority resolution doesn't give a valid result, but given that there are C73 advertisements that we don't support, and that the future may add further advertisements, if our software resolution fails to find a speed, we need to stop the link coming up. Also... PHYs... hardware bugs... -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!