Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp285312rdh; Thu, 26 Oct 2023 02:01:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGf7PsQQPt8ekdt6k+I1WrUpkup0aprwa1FYnF0ndKrlpVUg5+Wo9afDrX1a+4zTu2bN+14 X-Received: by 2002:a05:690c:9d:b0:5a7:dbf4:6a1e with SMTP id be29-20020a05690c009d00b005a7dbf46a1emr19751010ywb.33.1698310911751; Thu, 26 Oct 2023 02:01:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698310911; cv=none; d=google.com; s=arc-20160816; b=BvHcZxcIG+LAFFvdIpMo6lPMqD3jL+eQeXJAQgmLWcSnAWFYbfSzsV9qamIkfHqUYA Nplua7MYBGR7cO2BhNclMpSYx7xWtYjMfwK3RZR3K0anC9RwpOXhIS5MTw/+vEfVZB2i Jx6p8yXhIUsp7qh91adkG4vTmHMRd7bKVw558yzeSUxA6afxlUYd14kTM7v0yrzXKgEY 0y07AFPIRCN2ga7fgVjZNt68dtSI4X3hRvoSz7vE3ttX/PuegGW9EOOkOkbVo2/DTd5U rr8h9DiDQgRx0xXB31X5z2Fjmzp7Sh7l4P7TrHd9gTCayhX3Q/bhfsc+1jhSS0qbj6s8 a7GA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=adNJy/4UeJRmrE+wmagYutX6eDj2Rk2xxlqLxwJ8GBc=; fh=9iaPZ7Cuvnr9YGK8Ce9odLdEfPssUqvmoD+zBo30J0M=; b=uGZo1aK7mEHXZV3rMdTnFJv1Y5n+vqnqEQOJFYu3FNkFIPoc1JM08qQpIHgxngAvtW hWFkgjsoDjFCGIUDtwBSHbH92bneTjc/oMcxsXss3vy/pOBWroxxSW4Ei0LJ7ZQHQ/1A KGpwxgm+2fTbMaHX+8avFXAfZgS2Ons1BVFzod7derEpxymhhBFFQCpIZGu8oX7Ezx13 8hf6JG56KYO3ZLL8iD9xCBBSTTa9eJWgei97uMLvia4mmhsgIG+tuR3Y0tyH3bltLiAw ZeRsCq5sKlZqHme+X26OrY5te6OnLb+PYrKGzt/xcVJxxL1opvvuEukbp+gD4yFV1bsf v5mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=tc+ZjSRr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id s6-20020a815e06000000b0058d0f8e3d9bsi16158860ywb.228.2023.10.26.02.01.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 02:01:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=tc+ZjSRr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id D32B4813563E; Thu, 26 Oct 2023 02:01:48 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229710AbjJZJB3 (ORCPT + 99 others); Thu, 26 Oct 2023 05:01:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229518AbjJZJB1 (ORCPT ); Thu, 26 Oct 2023 05:01:27 -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 4CAF810E; Thu, 26 Oct 2023 02:01:24 -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=adNJy/4UeJRmrE+wmagYutX6eDj2Rk2xxlqLxwJ8GBc=; b=tc+ZjSRrVNeo+HvRa3G/H14x2a uoLp8OIUDZNzKT3pWCLe4LAvEjT5rs8K1b2DHU61g9KCudKZuSq0kLzImEYwdVNqNviNliLnZvQ7T KvpbL8lDAZOvWPIcEKP7O06dxzHB2tNRRXg2UOxLqL0fRTFP/iPwXdjYwIFHusAhf2BzvHW3m/dka EGSn89Ttk5Lz1Anf/ri/nZIGm7WjtJaUfjfQt1/i91jMVbCMugvzlhSsVfBXfXAlOBXjZfCiIP+Dz NKxcCBxpbPs1ELGbcoDcuSRdyh5VxDMpPwoCDz01m+jef62IbOIKHzsKKgLxM6WGZzhXjSctoBx0u xfysKz/Q==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:54862) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1qvwEw-0006Ug-0s; Thu, 26 Oct 2023 10:01:18 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1qvwEw-0007yE-22; Thu, 26 Oct 2023 10:01:18 +0100 Date: Thu, 26 Oct 2023 10:01:18 +0100 From: "Russell King (Oracle)" To: Raju Lakkaraju Cc: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org, linux-kernel@vger.kernel.org, andrew@lunn.ch, Jose.Abreu@synopsys.com, fancer.lancer@gmail.com, UNGLinuxDriver@microchip.com Subject: Re: [PATCH net-next V1] net: pcs: xpcs: Add 2500BASE-X case in get state for XPCS drivers Message-ID: References: <20231026054305.336968-1-Raju.Lakkaraju@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231026054305.336968-1-Raju.Lakkaraju@microchip.com> Sender: Russell King (Oracle) X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email 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 (agentk.vger.email [0.0.0.0]); Thu, 26 Oct 2023 02:01:49 -0700 (PDT) On Thu, Oct 26, 2023 at 11:13:05AM +0530, Raju Lakkaraju wrote: > + sts = xpcs_read(xpcs, MDIO_MMD_VEND2, DW_VR_MII_MMD_STS); > + > + state->link = !!(sts & DW_VR_MII_MMD_STS_LINK_STS); > + if (!state->link) { > + state->speed = SPEED_UNKNOWN; > + state->pause = MLO_PAUSE_NONE; > + state->duplex = DUPLEX_UNKNOWN; > + return 0; > + } You don't need this. If autoneg is enabled then these are initialised prior to calling this by phylink using: state->speed = SPEED_UNKNOWN; state->duplex = DUPLEX_UNKNOWN; state->pause = MLO_PAUSE_NONE; or if not using autoneg: state->speed = pl->link_config.speed; state->duplex = pl->link_config.duplex; state->pause = pl->link_config.pause; so you don't need to touch them if the link is down. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!