Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp644107ybk; Wed, 20 May 2020 08:26:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3nbsPDILy4/WbS/oWI7Cr02MRH2gp2VR2RWbI3onoNvbxC0IJDnwtvFoHa4/VTLUG5Xrq X-Received: by 2002:a17:906:7256:: with SMTP id n22mr4318236ejk.31.1589988365835; Wed, 20 May 2020 08:26:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589988365; cv=none; d=google.com; s=arc-20160816; b=m4eN6H34VmepRh2mg9ueuWA4NGp4OFqyvIeyYL7b82FfoXkmO4ZhZifQeKrMhv9rfI Naas69ZEFqjk71uqQfWH1VXdYavQQyaCV1HzYq+t+sRclJjSX5JZGMNGTo2Lu0FDid+v +3tOtqIwCw/3q9Tce9Tsu9g8ePBeea6ZFpt63qZALIjU7Q8IkwdjqhabnOR04curbWJb b7T2SGETzv4mWFqQaa6UgMdG5NwcQ5sGLsdmwgGoUHJv8iPVc4Qq8NmmLtKQcnVFE1DB PHtM0TNk07cN8SVH98egbByl9MyDNf/T3EAV2eWxjDEm1a12SzUnCW9xlOfhN69CX2iM x7cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=at30f/W9H0PVlvZ9CPBqhEXlN7ycot3a3vTYxCcoVjM=; b=dP5ueiWuIZXqh2z++Vxt5emDA9cJUlJ4TDHF3CgWP2fLp5z8DUPFil9ygrV55IlcVE NM2VYwpYS5Nw+fagKOSpIHg0H3xd8FKOpIyVegH8MOolVWgQpUA68hj4VTxYP0+cPbRe u3PRycgLBOsTAw6JUmWTXhWcp3uOussDPs27s8hQqGyxJcUkAZF9SwVR5c5FaaSKUwF0 0tNDPu6w3m+DPLgRee9+zVynXdnpxrCelcobe84edbFk1ptBIMzReXrS2W9SNKOUes6P oPewhgvNmzRFTUxJWWNyUyvj7FC7mi2bQVfL29HHyll2Xa/j0GXUxfoeoDRkH6TRi8od JHug== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x8si1672569edj.571.2020.05.20.08.25.42; Wed, 20 May 2020 08:26:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726893AbgETPXy (ORCPT + 99 others); Wed, 20 May 2020 11:23:54 -0400 Received: from mx2.suse.de ([195.135.220.15]:53794 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726688AbgETPXy (ORCPT ); Wed, 20 May 2020 11:23:54 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id BB0E0B229; Wed, 20 May 2020 15:23:54 +0000 (UTC) Received: by lion.mk-sys.cz (Postfix, from userid 1000) id CF618604F6; Wed, 20 May 2020 17:23:50 +0200 (CEST) Date: Wed, 20 May 2020 17:23:50 +0200 From: Michal Kubecek To: netdev@vger.kernel.org Cc: Oleksij Rempel , Marek Vasut , Andrew Lunn , Florian Fainelli , Jonathan Corbet , linux-kernel@vger.kernel.org, Russell King , mkl@pengutronix.de, kernel@pengutronix.de, David Jander , Jakub Kicinski , Christian Herber , "David S. Miller" , Heiner Kallweit Subject: Re: [PATCH net-next v3 1/2] ethtool: provide UAPI for PHY Signal Quality Index (SQI) Message-ID: <20200520152350.GC8771@lion.mk-sys.cz> References: <20200520062915.29493-1-o.rempel@pengutronix.de> <20200520062915.29493-2-o.rempel@pengutronix.de> <20200520144544.GB8771@lion.mk-sys.cz> <20200520150711.rj4b22g3zhzej2aw@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200520150711.rj4b22g3zhzej2aw@pengutronix.de> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 20, 2020 at 05:07:11PM +0200, Oleksij Rempel wrote: > On Wed, May 20, 2020 at 04:45:44PM +0200, Michal Kubecek wrote: > > On Wed, May 20, 2020 at 08:29:14AM +0200, Oleksij Rempel wrote: > > > Signal Quality Index is a mandatory value required by "OPEN Alliance > > > SIG" for the 100Base-T1 PHYs [1]. This indicator can be used for cable > > > integrity diagnostic and investigating other noise sources and > > > implement by at least two vendors: NXP[2] and TI[3]. > > > > > > [1] http://www.opensig.org/download/document/218/Advanced_PHY_features_for_automotive_Ethernet_V1.0.pdf > > > [2] https://www.nxp.com/docs/en/data-sheet/TJA1100.pdf > > > [3] https://www.ti.com/product/DP83TC811R-Q1 > > > > > > Signed-off-by: Oleksij Rempel > > > --- > > > > This looks good to me, there is just one thing I'm not sure about: > > > > > diff --git a/include/linux/phy.h b/include/linux/phy.h > > > index 59344db43fcb1..950ba479754bd 100644 > > > --- a/include/linux/phy.h > > > +++ b/include/linux/phy.h > > > @@ -706,6 +706,8 @@ struct phy_driver { > > > struct ethtool_tunable *tuna, > > > const void *data); > > > int (*set_loopback)(struct phy_device *dev, bool enable); > > > + int (*get_sqi)(struct phy_device *dev); > > > + int (*get_sqi_max)(struct phy_device *dev); > > > }; > > > #define to_phy_driver(d) container_of(to_mdio_common_driver(d), \ > > > struct phy_driver, mdiodrv) > > > > I'm not sure if it's a good idea to define two separate callbacks. It > > means adding two pointers instead of one (for every instance of the > > structure, not only those implementing them), doing two calls, running > > the same checks twice, locking twice, checking the result twice. > > > > Also, passing a structure pointer would mean less code changed if we > > decide to add more related state values later. > > > > What do you think? > > > > If you don't agree, I have no objections so > > > > Reviewed-by: Michal Kubecek > > I have no strong opinion on it. Should I rework it? It's up to you. It was a suggestion for possible improvement but I have no problem with this version being applied. Michal