All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Kubecek <mkubecek@suse.cz>
To: netdev@vger.kernel.org
Cc: Oleksij Rempel <o.rempel@pengutronix.de>,
	Marek Vasut <marex@denx.de>, Andrew Lunn <andrew@lunn.ch>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Jonathan Corbet <corbet@lwn.net>,
	linux-kernel@vger.kernel.org,
	Russell King <linux@armlinux.org.uk>,
	mkl@pengutronix.de, kernel@pengutronix.de,
	David Jander <david@protonic.nl>,
	Jakub Kicinski <kuba@kernel.org>,
	Christian Herber <christian.herber@nxp.com>,
	"David S. Miller" <davem@davemloft.net>,
	Heiner Kallweit <hkallweit1@gmail.com>
Subject: Re: [PATCH net-next v3 1/2] ethtool: provide UAPI for PHY Signal Quality Index (SQI)
Date: Wed, 20 May 2020 17:23:50 +0200	[thread overview]
Message-ID: <20200520152350.GC8771@lion.mk-sys.cz> (raw)
In-Reply-To: <20200520150711.rj4b22g3zhzej2aw@pengutronix.de>

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 <o.rempel@pengutronix.de>
> > > ---
> > 
> > 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 <mkubecek@suse.cz>
> 
> 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

  reply	other threads:[~2020-05-20 15:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-20  6:29 [PATCH net-next v3 0/2] provide KAPI for SQI Oleksij Rempel
2020-05-20  6:29 ` [PATCH net-next v3 1/2] ethtool: provide UAPI for PHY Signal Quality Index (SQI) Oleksij Rempel
2020-05-20 14:29   ` Andrew Lunn
2020-05-20 14:45   ` Michal Kubecek
2020-05-20 15:07     ` Oleksij Rempel
2020-05-20 15:23       ` Michal Kubecek [this message]
2020-05-20 15:30       ` Andrew Lunn
2020-05-20 17:39         ` Oleksij Rempel
2020-05-20  6:29 ` [PATCH net-next v3 2/2] net: phy: tja11xx: add SQI support Oleksij Rempel
2020-05-20 14:29   ` Andrew Lunn
2020-05-22  0:18 ` [PATCH net-next v3 0/2] provide KAPI for SQI David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200520152350.GC8771@lion.mk-sys.cz \
    --to=mkubecek@suse.cz \
    --cc=andrew@lunn.ch \
    --cc=christian.herber@nxp.com \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=david@protonic.nl \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=marex@denx.de \
    --cc=mkl@pengutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.