[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <361eb94a4da73d1fa21893e8e294639f0fc0bcd2.camel@analog.com>
Date: Thu, 5 Sep 2019 06:25:13 +0000
From: "Ardelean, Alexandru" <alexandru.Ardelean@...log.com>
To: "andrew@...n.ch" <andrew@...n.ch>
CC: "davem@...emloft.net" <davem@...emloft.net>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"f.fainelli@...il.com" <f.fainelli@...il.com>,
"hkallweit1@...il.com" <hkallweit1@...il.com>
Subject: Re: [PATCH v2 1/2] ethtool: implement Energy Detect Powerdown support
via phy-tunable
On Wed, 2019-09-04 at 21:53 +0200, Andrew Lunn wrote:
> [External]
>
> On Wed, Sep 04, 2019 at 07:23:21PM +0300, Alexandru Ardelean wrote:
>
> Hi Alexandru
>
> Somewhere we need a comment stating what EDPD means. Here would be a
> good place.
ack
>
> > +#define ETHTOOL_PHY_EDPD_DFLT_TX_INTERVAL 0x7fff
> > +#define ETHTOOL_PHY_EDPD_NO_TX 0x8000
> > +#define ETHTOOL_PHY_EDPD_DISABLE 0
>
> I think you are passing a u16. So why not 0xfffe and 0xffff? We also
> need to make it clear what the units are for interval. This file
I initially thought about keeping this u8 and going with 0xff & 0xfe.
But 254 or 253 could be too small to specify the value of an interval.
Also (maybe due ti all the coding-patterns that I saw over the course of some time), make me feel that I should add a
flag somewhere.
Bottom line is: 0xfffe and 0xffff also work from my side, if it is acceptable (by the community).
Another approach I considered, was to maybe have this EDPD just do enable & disable (which is sufficient for the `adin`
PHY & `micrel` as well).
That would mean that if we would ever want to configure the TX interval (in the future), we would need an extra PHY-
tunable parameter just for that; because changing the enable/disable behavior would be dangerous.
And also, deferring the TX-interval configuration, does not sound like good design/pattern, since it can allow for tons
of PHY-tunable parameters for every little knob.
> specifies the contract between the kernel and user space. So we need
> to clearly define what we mean here. Lots of comments are better than
> no comments.
Will come back with more comments.
>
> Andrew
Powered by blists - more mailing lists