Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp2993705pxm; Mon, 28 Feb 2022 09:55:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJwlgif8D35p0EGMArJ1E+SWVWwkhxINwxO49b4V7Y27+bkQWk+zECR35LTI0sSXpqNM6dP4 X-Received: by 2002:a17:90a:d797:b0:1bc:652f:d0fd with SMTP id z23-20020a17090ad79700b001bc652fd0fdmr18003705pju.16.1646070937607; Mon, 28 Feb 2022 09:55:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646070937; cv=none; d=google.com; s=arc-20160816; b=ZIXnTgpoMJWuHEu1leHcRrdD/KfI9usSsrZkBq5AxmzrhARci0ZKbmWjvLCzeNV+Jz FeCMnDqd0RwmVhVFPYBYKTJWrE/AJMgqNddYF1X0ad3ENDbpkHwm6DU9LoQ4hDnYJm4O 5/wBl5eIzgQw2+6yXx0nOBrA+lR+rEUIjb71wSL64KZtf/8ViVnWx0il9IwtZ3snuTWG wlQ1maYX5KpJmYit87ZvwYzW9asEwC3dOfU16nSSrnFjgpqMgPZWMD2j+cio7jIUeALL eedbZYik1hoK5wWDTt/aqIHuCKL+fvMeLQo/MYSCAzu+hJC61jhPEFGc4jdgj7hFLjtL jPtA== 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=OJ1gRNEUSqP52FWYxziDdfpkPpm8wJ65QOTUW1Ma5gs=; b=DcIZmAhJ83kArAO4tbs3yIIeE8Yh/lbdPeZo/79AwOw99igwt5Zb3Sq/7P1ruuahi6 vajgeD1M7nUX6LD2S9ZZHB255bk1XpGYW9SuxzyckNLK4Q5qJD8fHtohp1ZFVmuEiuWM sIoZSmgSJAdD/BC2H5lrTNkhKOGDKYknjp3uTMFAW76+r1BzpIkY3IYWm50p9HC/Gj/6 n/RhlJcJL+mn2vEaaxELiE2pDsDsWR0O0EqnwhegmCZiU4KByTZjjn3vP1Sn3HX9JiNr X7zNCNevFGUG80xvYZ4REggOyHzEbiKxBBbQXAxTJAH6K52oP3QBn1dnynaX/5AuDQhO QjqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=OnzF8RGS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o21-20020a635d55000000b003737c6010f6si10287560pgm.692.2022.02.28.09.55.21; Mon, 28 Feb 2022 09:55:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=OnzF8RGS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233168AbiB1ONa (ORCPT + 99 others); Mon, 28 Feb 2022 09:13:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231997AbiB1ON3 (ORCPT ); Mon, 28 Feb 2022 09:13:29 -0500 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 C3CAE37002; Mon, 28 Feb 2022 06:12:46 -0800 (PST) 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=OJ1gRNEUSqP52FWYxziDdfpkPpm8wJ65QOTUW1Ma5gs=; b=OnzF8RGS5nV7aqrahARKNDCydG pzBm1owZD1yQlCjCVadmPQURAZD/Xauadw6Mxb13umjb0aUw97bLnN/STjwc+m71T3bYwxqwG00bu yzLBOXs7+oyd0alB+J/wxySJe4lQ+mQafyhp6XnIV+RB64BJ6CFiCnt2OCUwE+LexiiLAYPyFc5y9 TaoNY/b6DvBa6Ej0gVwVjLPUc8b9hEDdAB52JRZwYQ2m5iiQX3PoKEU+hC6gZFirfgKUJD6um29M8 ZSHcrhRtMuulyP/8VO57elTr5/rCxCCmPZkuM4NrI/jxEsyu/k0z8rquDDYfOIqBdkpDzG/cX+eKi AahWfjlw==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:57562) 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 1nOglY-0008Qb-1F; Mon, 28 Feb 2022 14:12:44 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1nOglV-0006E9-Dm; Mon, 28 Feb 2022 14:12:41 +0000 Date: Mon, 28 Feb 2022 14:12:41 +0000 From: "Russell King (Oracle)" To: Arun Ramadoss Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Lunn , Heiner Kallweit , Jakub Kicinski , "David S . Miller" Subject: Re: [RFC PATCH net-next 4/4] net: phy: added master-slave config and cable diagnostics for Lan937x Message-ID: References: <20220228140510.20883-1-arun.ramadoss@microchip.com> <20220228140510.20883-5-arun.ramadoss@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220228140510.20883-5-arun.ramadoss@microchip.com> Sender: Russell King (Oracle) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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 On Mon, Feb 28, 2022 at 07:35:10PM +0530, Arun Ramadoss wrote: > To configure the Lan937x T1 phy as master or slave using the ethtool -s > master-slave , the config_aneg and > read status functions are added. And for the cable-diagnostics, used the > lan87xx routines. > > Signed-off-by: Prasanna Vengateshan > Signed-off-by: Arun Ramadoss > --- > drivers/net/phy/microchip_t1.c | 75 ++++++++++++++++++++++++++++++++++ > 1 file changed, 75 insertions(+) > > diff --git a/drivers/net/phy/microchip_t1.c b/drivers/net/phy/microchip_t1.c > index 634a1423182a..3a0d4c4fab0a 100644 > --- a/drivers/net/phy/microchip_t1.c > +++ b/drivers/net/phy/microchip_t1.c > @@ -81,6 +81,9 @@ > #define T1_REG_BANK_SEL 8 > #define T1_REG_ADDR_MASK 0xFF > > +#define T1_MODE_STAT_REG 0x11 > +#define T1_LINK_UP_MSK BIT(0) > + > #define DRIVER_AUTHOR "Nisar Sayed " > #define DRIVER_DESC "Microchip LAN87XX/LAN937x T1 PHY driver" > > @@ -435,6 +438,11 @@ static int lan_phy_config_init(struct phy_device *phydev) > if (rc < 0) > phydev_err(phydev, "failed to initialize phy\n"); > > + phydev->duplex = DUPLEX_FULL; > + phydev->speed = SPEED_100; > + phydev->pause = 0; > + phydev->asym_pause = 0; Shouldn't this be done in lan937x_read_status()? Have you tested this patch with various invocations of ethtool -s ? E.g. autoneg on, autoneg off at various forced speeds, both suitable for the PHY and unsuitable? Are all these sensibly handled? Thanks. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!