Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp615075ybk; Wed, 20 May 2020 07:47:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx870QT3QCPg+3mHoCnwezv6aBv30W2c2rZd0hoLbHb6Oorb+pxuuPvbqmnxRu5+58lzcjp X-Received: by 2002:a05:6402:22a6:: with SMTP id cx6mr3795208edb.76.1589986063507; Wed, 20 May 2020 07:47:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589986063; cv=none; d=google.com; s=arc-20160816; b=RY6p6ssa20rdchGEVgzzy9nPx05/bUfADKQoY48R5iRZB5QhxrSwFCCQoKqeZ9xl0k oJlgScBxoE8oRNLp52VvMTaIMIbu7DCWgQnDM5iOD4Gq5S3swh/+1xG1W9H+Bwnvk4pc qEWFXq6J5d/yvwB8+jCGY6uZtjGhLTsy3u3JtshSJRQxWuJafOEtkJaNEePJVW+YpYXN vUMbhU1KdgrEygEs0YWyAygMOF7ak/9g8EzRhPmZUCc7d05fFcDDAxyo1mRUmooVY9/D EN3BGPlYZ9EQw0faSaSU0fJrE5j7VJy1kXbOFqe4U8vRTEn+jM9JC4D40W/YoJVrnXLX 3BWA== 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=Jdy/M6RecwByEXh6EMYo8IUN0j67qqtBFguFGlJW8w0=; b=eisqp/G14tGKTON11hhJQwvTBXSl4t97TFyL7WcNjlkpnA41kN32+r+ABhYBLXsOcA S9RsQDW0m1kyvp1PRbZXGf0V6SAyNISaI9t6qvVxaYLYf/RO0/Abi6I8zx5cd+5VuoS9 aTdhGb+Xa7lhg+8J2c0EMj2oNchWMdIMqdeogOsvoRtl8BqiBaj5kD0AhEkSG+xVc2JU oEKdRMx2+7s10M4nc7AShHDCA7JXwOGl7vjlBJC3ek+k1yNWs+b4DRHIl7LvfUSHe5qo HpjObMe3SOO92zVwx+yBzJd5c3q4nHbIv682meJIIob8N1YsOewGlhu0UiNts9F38JT2 AfrA== 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 l2si1573704edi.237.2020.05.20.07.47.19; Wed, 20 May 2020 07:47:43 -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 S1726785AbgETOps (ORCPT + 99 others); Wed, 20 May 2020 10:45:48 -0400 Received: from mx2.suse.de ([195.135.220.15]:56556 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726510AbgETOpr (ORCPT ); Wed, 20 May 2020 10:45:47 -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 4275AAB5C; Wed, 20 May 2020 14:45:48 +0000 (UTC) Received: by lion.mk-sys.cz (Postfix, from userid 1000) id 25BD2604F6; Wed, 20 May 2020 16:45:44 +0200 (CEST) Date: Wed, 20 May 2020 16:45:44 +0200 From: Michal Kubecek To: netdev@vger.kernel.org Cc: Oleksij Rempel , Andrew Lunn , "David S. Miller" , Florian Fainelli , Heiner Kallweit , Jakub Kicinski , Jonathan Corbet , David Jander , kernel@pengutronix.de, linux-kernel@vger.kernel.org, Russell King , mkl@pengutronix.de, Marek Vasut , Christian Herber Subject: Re: [PATCH net-next v3 1/2] ethtool: provide UAPI for PHY Signal Quality Index (SQI) Message-ID: <20200520144544.GB8771@lion.mk-sys.cz> References: <20200520062915.29493-1-o.rempel@pengutronix.de> <20200520062915.29493-2-o.rempel@pengutronix.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="cvVnyQ+4j833TQvp" Content-Disposition: inline In-Reply-To: <20200520062915.29493-2-o.rempel@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 --cvVnyQ+4j833TQvp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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]. >=20 > [1] http://www.opensig.org/download/document/218/Advanced_PHY_features_fo= r_automotive_Ethernet_V1.0.pdf > [2] https://www.nxp.com/docs/en/data-sheet/TJA1100.pdf > [3] https://www.ti.com/product/DP83TC811R-Q1 >=20 > 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 Michal --cvVnyQ+4j833TQvp Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEWN3j3bieVmp26mKO538sG/LRdpUFAl7FQpIACgkQ538sG/LR dpV0dgf9EtLDViFGNOKw6wA8VFfIA2ANEsV19HAMn4YfQZ8pORVhIoJsKw8sAK64 l9xidgkJ+CuzNSzsynX7a1jQc8inPdZ2qNsQwi6f6q/5ndtGoGtieEvMU+4EvlnN J0DehPfI9geLnzz7PjTuCYVbhBryTZoi0+otYDPPS1b1xhKlPdnNBHjnK2bsTrO4 7ysx/iQT4PRhuy8R7+1c3BwHKpq0Ofhk3zFZtrIahQF4dUIcNFSec+Hs5LEb9wwt w96SKsAhwpgUeqMs/+eHHNIbjGQtrM42Kl2oA0MIUqW72rVETsnmlVyZH8gJVwWo mgAqSTHL0MtZKJR0/Guq+4KM1AVKsQ== =uNvL -----END PGP SIGNATURE----- --cvVnyQ+4j833TQvp--